{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AmplifyBackend.Types.UpdateBackendAuthIdentityPoolConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(UpdateBackendAuthIdentityPoolConfig
 -> UpdateBackendAuthIdentityPoolConfig -> Bool)
-> (UpdateBackendAuthIdentityPoolConfig
    -> UpdateBackendAuthIdentityPoolConfig -> Bool)
-> Eq UpdateBackendAuthIdentityPoolConfig
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]
(Int -> ReadS UpdateBackendAuthIdentityPoolConfig)
-> ReadS [UpdateBackendAuthIdentityPoolConfig]
-> ReadPrec UpdateBackendAuthIdentityPoolConfig
-> ReadPrec [UpdateBackendAuthIdentityPoolConfig]
-> Read 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
(Int -> UpdateBackendAuthIdentityPoolConfig -> ShowS)
-> (UpdateBackendAuthIdentityPoolConfig -> String)
-> ([UpdateBackendAuthIdentityPoolConfig] -> ShowS)
-> Show UpdateBackendAuthIdentityPoolConfig
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.
 UpdateBackendAuthIdentityPoolConfig
 -> Rep UpdateBackendAuthIdentityPoolConfig x)
-> (forall x.
    Rep UpdateBackendAuthIdentityPoolConfig x
    -> UpdateBackendAuthIdentityPoolConfig)
-> Generic UpdateBackendAuthIdentityPoolConfig
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' :: Maybe Bool -> UpdateBackendAuthIdentityPoolConfig
UpdateBackendAuthIdentityPoolConfig'
    { $sel:unauthenticatedLogin:UpdateBackendAuthIdentityPoolConfig' :: Maybe Bool
unauthenticatedLogin =
        Maybe Bool
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 :: (Maybe Bool -> f (Maybe Bool))
-> UpdateBackendAuthIdentityPoolConfig
-> f UpdateBackendAuthIdentityPoolConfig
updateBackendAuthIdentityPoolConfig_unauthenticatedLogin = (UpdateBackendAuthIdentityPoolConfig -> Maybe Bool)
-> (UpdateBackendAuthIdentityPoolConfig
    -> Maybe Bool -> UpdateBackendAuthIdentityPoolConfig)
-> Lens
     UpdateBackendAuthIdentityPoolConfig
     UpdateBackendAuthIdentityPoolConfig
     (Maybe Bool)
     (Maybe Bool)
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

instance
  Prelude.NFData
    UpdateBackendAuthIdentityPoolConfig

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