{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AmplifyBackend.Types.UpdateBackendAuthIdentityPoolConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AmplifyBackend.Types.UpdateBackendAuthIdentityPoolConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Describes the authorization configuration for the Amazon Cognito
-- identity pool, provisioned as a part of your auth resource in the
-- Amplify project.
--
-- /See:/ 'newUpdateBackendAuthIdentityPoolConfig' smart constructor.
data UpdateBackendAuthIdentityPoolConfig = UpdateBackendAuthIdentityPoolConfig'
  { -- | A boolean value that can be set to allow or disallow guest-level
    -- authorization into your Amplify app.
    UpdateBackendAuthIdentityPoolConfig -> Maybe Bool
unauthenticatedLogin :: Prelude.Maybe Prelude.Bool
  }
  deriving (UpdateBackendAuthIdentityPoolConfig
-> UpdateBackendAuthIdentityPoolConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBackendAuthIdentityPoolConfig
-> UpdateBackendAuthIdentityPoolConfig -> Bool
$c/= :: UpdateBackendAuthIdentityPoolConfig
-> UpdateBackendAuthIdentityPoolConfig -> Bool
== :: UpdateBackendAuthIdentityPoolConfig
-> UpdateBackendAuthIdentityPoolConfig -> Bool
$c== :: UpdateBackendAuthIdentityPoolConfig
-> UpdateBackendAuthIdentityPoolConfig -> Bool
Prelude.Eq, ReadPrec [UpdateBackendAuthIdentityPoolConfig]
ReadPrec UpdateBackendAuthIdentityPoolConfig
Int -> ReadS UpdateBackendAuthIdentityPoolConfig
ReadS [UpdateBackendAuthIdentityPoolConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBackendAuthIdentityPoolConfig]
$creadListPrec :: ReadPrec [UpdateBackendAuthIdentityPoolConfig]
readPrec :: ReadPrec UpdateBackendAuthIdentityPoolConfig
$creadPrec :: ReadPrec UpdateBackendAuthIdentityPoolConfig
readList :: ReadS [UpdateBackendAuthIdentityPoolConfig]
$creadList :: ReadS [UpdateBackendAuthIdentityPoolConfig]
readsPrec :: Int -> ReadS UpdateBackendAuthIdentityPoolConfig
$creadsPrec :: Int -> ReadS UpdateBackendAuthIdentityPoolConfig
Prelude.Read, Int -> UpdateBackendAuthIdentityPoolConfig -> ShowS
[UpdateBackendAuthIdentityPoolConfig] -> ShowS
UpdateBackendAuthIdentityPoolConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBackendAuthIdentityPoolConfig] -> ShowS
$cshowList :: [UpdateBackendAuthIdentityPoolConfig] -> ShowS
show :: UpdateBackendAuthIdentityPoolConfig -> String
$cshow :: UpdateBackendAuthIdentityPoolConfig -> String
showsPrec :: Int -> UpdateBackendAuthIdentityPoolConfig -> ShowS
$cshowsPrec :: Int -> UpdateBackendAuthIdentityPoolConfig -> ShowS
Prelude.Show, forall x.
Rep UpdateBackendAuthIdentityPoolConfig x
-> UpdateBackendAuthIdentityPoolConfig
forall x.
UpdateBackendAuthIdentityPoolConfig
-> Rep UpdateBackendAuthIdentityPoolConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateBackendAuthIdentityPoolConfig x
-> UpdateBackendAuthIdentityPoolConfig
$cfrom :: forall x.
UpdateBackendAuthIdentityPoolConfig
-> Rep UpdateBackendAuthIdentityPoolConfig x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBackendAuthIdentityPoolConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'unauthenticatedLogin', 'updateBackendAuthIdentityPoolConfig_unauthenticatedLogin' - A boolean value that can be set to allow or disallow guest-level
-- authorization into your Amplify app.
newUpdateBackendAuthIdentityPoolConfig ::
  UpdateBackendAuthIdentityPoolConfig
newUpdateBackendAuthIdentityPoolConfig :: UpdateBackendAuthIdentityPoolConfig
newUpdateBackendAuthIdentityPoolConfig =
  UpdateBackendAuthIdentityPoolConfig'
    { $sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: Maybe Bool
unauthenticatedLogin =
        forall a. Maybe a
Prelude.Nothing
    }

-- | A boolean value that can be set to allow or disallow guest-level
-- authorization into your Amplify app.
updateBackendAuthIdentityPoolConfig_unauthenticatedLogin :: Lens.Lens' UpdateBackendAuthIdentityPoolConfig (Prelude.Maybe Prelude.Bool)
updateBackendAuthIdentityPoolConfig_unauthenticatedLogin :: Lens' UpdateBackendAuthIdentityPoolConfig (Maybe Bool)
updateBackendAuthIdentityPoolConfig_unauthenticatedLogin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthIdentityPoolConfig' {Maybe Bool
unauthenticatedLogin :: Maybe Bool
$sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: UpdateBackendAuthIdentityPoolConfig -> Maybe Bool
unauthenticatedLogin} -> Maybe Bool
unauthenticatedLogin) (\s :: UpdateBackendAuthIdentityPoolConfig
s@UpdateBackendAuthIdentityPoolConfig' {} Maybe Bool
a -> UpdateBackendAuthIdentityPoolConfig
s {$sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: Maybe Bool
unauthenticatedLogin = Maybe Bool
a} :: UpdateBackendAuthIdentityPoolConfig)

instance
  Prelude.Hashable
    UpdateBackendAuthIdentityPoolConfig
  where
  hashWithSalt :: Int -> UpdateBackendAuthIdentityPoolConfig -> Int
hashWithSalt
    Int
_salt
    UpdateBackendAuthIdentityPoolConfig' {Maybe Bool
unauthenticatedLogin :: Maybe Bool
$sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: UpdateBackendAuthIdentityPoolConfig -> Maybe Bool
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
unauthenticatedLogin

instance
  Prelude.NFData
    UpdateBackendAuthIdentityPoolConfig
  where
  rnf :: UpdateBackendAuthIdentityPoolConfig -> ()
rnf UpdateBackendAuthIdentityPoolConfig' {Maybe Bool
unauthenticatedLogin :: Maybe Bool
$sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: UpdateBackendAuthIdentityPoolConfig -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
unauthenticatedLogin

instance
  Data.ToJSON
    UpdateBackendAuthIdentityPoolConfig
  where
  toJSON :: UpdateBackendAuthIdentityPoolConfig -> Value
toJSON UpdateBackendAuthIdentityPoolConfig' {Maybe Bool
unauthenticatedLogin :: Maybe Bool
$sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: UpdateBackendAuthIdentityPoolConfig -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"unauthenticatedLogin" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
unauthenticatedLogin
          ]
      )