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

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

-- |
-- Module      : Amazonka.CognitoIdentity.UpdateIdentityPool
-- 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)
--
-- Updates an identity pool.
--
-- You must use AWS Developer credentials to call this API.
module Amazonka.CognitoIdentity.UpdateIdentityPool
  ( -- * Creating a Request
    UpdateIdentityPool (..),
    newUpdateIdentityPool,

    -- * Request Lenses
    updateIdentityPool_samlProviderARNs,
    updateIdentityPool_supportedLoginProviders,
    updateIdentityPool_allowClassicFlow,
    updateIdentityPool_developerProviderName,
    updateIdentityPool_identityPoolTags,
    updateIdentityPool_openIdConnectProviderARNs,
    updateIdentityPool_cognitoIdentityProviders,
    updateIdentityPool_identityPoolId,
    updateIdentityPool_identityPoolName,
    updateIdentityPool_allowUnauthenticatedIdentities,

    -- * Destructuring the Response
    IdentityPool (..),
    newIdentityPool,

    -- * Response Lenses
    identityPool_samlProviderARNs,
    identityPool_supportedLoginProviders,
    identityPool_allowClassicFlow,
    identityPool_developerProviderName,
    identityPool_identityPoolTags,
    identityPool_openIdConnectProviderARNs,
    identityPool_cognitoIdentityProviders,
    identityPool_identityPoolId,
    identityPool_identityPoolName,
    identityPool_allowUnauthenticatedIdentities,
  )
where

import Amazonka.CognitoIdentity.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | An object representing an Amazon Cognito identity pool.
--
-- /See:/ 'newUpdateIdentityPool' smart constructor.
data UpdateIdentityPool = UpdateIdentityPool'
  { -- | An array of Amazon Resource Names (ARNs) of the SAML provider for your
    -- identity pool.
    UpdateIdentityPool -> Maybe [Text]
samlProviderARNs :: Prelude.Maybe [Prelude.Text],
    -- | Optional key:value pairs mapping provider names to provider app IDs.
    UpdateIdentityPool -> Maybe (HashMap Text Text)
supportedLoginProviders :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Enables or disables the Basic (Classic) authentication flow. For more
    -- information, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html Identity Pools (Federated Identities) Authentication Flow>
    -- in the /Amazon Cognito Developer Guide/.
    UpdateIdentityPool -> Maybe Bool
allowClassicFlow :: Prelude.Maybe Prelude.Bool,
    -- | The \"domain\" by which Cognito will refer to your users.
    UpdateIdentityPool -> Maybe Text
developerProviderName :: Prelude.Maybe Prelude.Text,
    -- | The tags that are assigned to the identity pool. A tag is a label that
    -- you can apply to identity pools to categorize and manage them in
    -- different ways, such as by purpose, owner, environment, or other
    -- criteria.
    UpdateIdentityPool -> Maybe (HashMap Text Text)
identityPoolTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ARNs of the OpenID Connect providers.
    UpdateIdentityPool -> Maybe [Text]
openIdConnectProviderARNs :: Prelude.Maybe [Prelude.Text],
    -- | A list representing an Amazon Cognito user pool and its client ID.
    UpdateIdentityPool -> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders :: Prelude.Maybe [CognitoIdentityProvider],
    -- | An identity pool ID in the format REGION:GUID.
    UpdateIdentityPool -> Text
identityPoolId :: Prelude.Text,
    -- | A string that you provide.
    UpdateIdentityPool -> Text
identityPoolName :: Prelude.Text,
    -- | TRUE if the identity pool supports unauthenticated logins.
    UpdateIdentityPool -> Bool
allowUnauthenticatedIdentities :: Prelude.Bool
  }
  deriving (UpdateIdentityPool -> UpdateIdentityPool -> Bool
(UpdateIdentityPool -> UpdateIdentityPool -> Bool)
-> (UpdateIdentityPool -> UpdateIdentityPool -> Bool)
-> Eq UpdateIdentityPool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIdentityPool -> UpdateIdentityPool -> Bool
$c/= :: UpdateIdentityPool -> UpdateIdentityPool -> Bool
== :: UpdateIdentityPool -> UpdateIdentityPool -> Bool
$c== :: UpdateIdentityPool -> UpdateIdentityPool -> Bool
Prelude.Eq, ReadPrec [UpdateIdentityPool]
ReadPrec UpdateIdentityPool
Int -> ReadS UpdateIdentityPool
ReadS [UpdateIdentityPool]
(Int -> ReadS UpdateIdentityPool)
-> ReadS [UpdateIdentityPool]
-> ReadPrec UpdateIdentityPool
-> ReadPrec [UpdateIdentityPool]
-> Read UpdateIdentityPool
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIdentityPool]
$creadListPrec :: ReadPrec [UpdateIdentityPool]
readPrec :: ReadPrec UpdateIdentityPool
$creadPrec :: ReadPrec UpdateIdentityPool
readList :: ReadS [UpdateIdentityPool]
$creadList :: ReadS [UpdateIdentityPool]
readsPrec :: Int -> ReadS UpdateIdentityPool
$creadsPrec :: Int -> ReadS UpdateIdentityPool
Prelude.Read, Int -> UpdateIdentityPool -> ShowS
[UpdateIdentityPool] -> ShowS
UpdateIdentityPool -> String
(Int -> UpdateIdentityPool -> ShowS)
-> (UpdateIdentityPool -> String)
-> ([UpdateIdentityPool] -> ShowS)
-> Show UpdateIdentityPool
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIdentityPool] -> ShowS
$cshowList :: [UpdateIdentityPool] -> ShowS
show :: UpdateIdentityPool -> String
$cshow :: UpdateIdentityPool -> String
showsPrec :: Int -> UpdateIdentityPool -> ShowS
$cshowsPrec :: Int -> UpdateIdentityPool -> ShowS
Prelude.Show, (forall x. UpdateIdentityPool -> Rep UpdateIdentityPool x)
-> (forall x. Rep UpdateIdentityPool x -> UpdateIdentityPool)
-> Generic UpdateIdentityPool
forall x. Rep UpdateIdentityPool x -> UpdateIdentityPool
forall x. UpdateIdentityPool -> Rep UpdateIdentityPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateIdentityPool x -> UpdateIdentityPool
$cfrom :: forall x. UpdateIdentityPool -> Rep UpdateIdentityPool x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIdentityPool' 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:
--
-- 'samlProviderARNs', 'updateIdentityPool_samlProviderARNs' - An array of Amazon Resource Names (ARNs) of the SAML provider for your
-- identity pool.
--
-- 'supportedLoginProviders', 'updateIdentityPool_supportedLoginProviders' - Optional key:value pairs mapping provider names to provider app IDs.
--
-- 'allowClassicFlow', 'updateIdentityPool_allowClassicFlow' - Enables or disables the Basic (Classic) authentication flow. For more
-- information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html Identity Pools (Federated Identities) Authentication Flow>
-- in the /Amazon Cognito Developer Guide/.
--
-- 'developerProviderName', 'updateIdentityPool_developerProviderName' - The \"domain\" by which Cognito will refer to your users.
--
-- 'identityPoolTags', 'updateIdentityPool_identityPoolTags' - The tags that are assigned to the identity pool. A tag is a label that
-- you can apply to identity pools to categorize and manage them in
-- different ways, such as by purpose, owner, environment, or other
-- criteria.
--
-- 'openIdConnectProviderARNs', 'updateIdentityPool_openIdConnectProviderARNs' - The ARNs of the OpenID Connect providers.
--
-- 'cognitoIdentityProviders', 'updateIdentityPool_cognitoIdentityProviders' - A list representing an Amazon Cognito user pool and its client ID.
--
-- 'identityPoolId', 'updateIdentityPool_identityPoolId' - An identity pool ID in the format REGION:GUID.
--
-- 'identityPoolName', 'updateIdentityPool_identityPoolName' - A string that you provide.
--
-- 'allowUnauthenticatedIdentities', 'updateIdentityPool_allowUnauthenticatedIdentities' - TRUE if the identity pool supports unauthenticated logins.
newUpdateIdentityPool ::
  -- | 'identityPoolId'
  Prelude.Text ->
  -- | 'identityPoolName'
  Prelude.Text ->
  -- | 'allowUnauthenticatedIdentities'
  Prelude.Bool ->
  UpdateIdentityPool
newUpdateIdentityPool :: Text -> Text -> Bool -> UpdateIdentityPool
newUpdateIdentityPool
  Text
pIdentityPoolId_
  Text
pIdentityPoolName_
  Bool
pAllowUnauthenticatedIdentities_ =
    UpdateIdentityPool' :: Maybe [Text]
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe [Text]
-> Maybe [CognitoIdentityProvider]
-> Text
-> Text
-> Bool
-> UpdateIdentityPool
UpdateIdentityPool'
      { $sel:samlProviderARNs:UpdateIdentityPool' :: Maybe [Text]
samlProviderARNs =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:supportedLoginProviders:UpdateIdentityPool' :: Maybe (HashMap Text Text)
supportedLoginProviders = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:allowClassicFlow:UpdateIdentityPool' :: Maybe Bool
allowClassicFlow = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:developerProviderName:UpdateIdentityPool' :: Maybe Text
developerProviderName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:identityPoolTags:UpdateIdentityPool' :: Maybe (HashMap Text Text)
identityPoolTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:openIdConnectProviderARNs:UpdateIdentityPool' :: Maybe [Text]
openIdConnectProviderARNs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:cognitoIdentityProviders:UpdateIdentityPool' :: Maybe [CognitoIdentityProvider]
cognitoIdentityProviders = Maybe [CognitoIdentityProvider]
forall a. Maybe a
Prelude.Nothing,
        $sel:identityPoolId:UpdateIdentityPool' :: Text
identityPoolId = Text
pIdentityPoolId_,
        $sel:identityPoolName:UpdateIdentityPool' :: Text
identityPoolName = Text
pIdentityPoolName_,
        $sel:allowUnauthenticatedIdentities:UpdateIdentityPool' :: Bool
allowUnauthenticatedIdentities =
          Bool
pAllowUnauthenticatedIdentities_
      }

-- | An array of Amazon Resource Names (ARNs) of the SAML provider for your
-- identity pool.
updateIdentityPool_samlProviderARNs :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe [Prelude.Text])
updateIdentityPool_samlProviderARNs :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_samlProviderARNs = (UpdateIdentityPool -> Maybe [Text])
-> (UpdateIdentityPool -> Maybe [Text] -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool UpdateIdentityPool (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe [Text]
samlProviderARNs :: Maybe [Text]
$sel:samlProviderARNs:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe [Text]
samlProviderARNs} -> Maybe [Text]
samlProviderARNs) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe [Text]
a -> UpdateIdentityPool
s {$sel:samlProviderARNs:UpdateIdentityPool' :: Maybe [Text]
samlProviderARNs = Maybe [Text]
a} :: UpdateIdentityPool) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateIdentityPool -> f UpdateIdentityPool)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateIdentityPool
-> f UpdateIdentityPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Optional key:value pairs mapping provider names to provider app IDs.
updateIdentityPool_supportedLoginProviders :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIdentityPool_supportedLoginProviders :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_supportedLoginProviders = (UpdateIdentityPool -> Maybe (HashMap Text Text))
-> (UpdateIdentityPool
    -> Maybe (HashMap Text Text) -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool
     UpdateIdentityPool
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe (HashMap Text Text)
supportedLoginProviders :: Maybe (HashMap Text Text)
$sel:supportedLoginProviders:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe (HashMap Text Text)
supportedLoginProviders} -> Maybe (HashMap Text Text)
supportedLoginProviders) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe (HashMap Text Text)
a -> UpdateIdentityPool
s {$sel:supportedLoginProviders:UpdateIdentityPool' :: Maybe (HashMap Text Text)
supportedLoginProviders = Maybe (HashMap Text Text)
a} :: UpdateIdentityPool) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIdentityPool -> f UpdateIdentityPool)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIdentityPool
-> f UpdateIdentityPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Enables or disables the Basic (Classic) authentication flow. For more
-- information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html Identity Pools (Federated Identities) Authentication Flow>
-- in the /Amazon Cognito Developer Guide/.
updateIdentityPool_allowClassicFlow :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe Prelude.Bool)
updateIdentityPool_allowClassicFlow :: (Maybe Bool -> f (Maybe Bool))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_allowClassicFlow = (UpdateIdentityPool -> Maybe Bool)
-> (UpdateIdentityPool -> Maybe Bool -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool UpdateIdentityPool (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe Bool
allowClassicFlow :: Maybe Bool
$sel:allowClassicFlow:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe Bool
allowClassicFlow} -> Maybe Bool
allowClassicFlow) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe Bool
a -> UpdateIdentityPool
s {$sel:allowClassicFlow:UpdateIdentityPool' :: Maybe Bool
allowClassicFlow = Maybe Bool
a} :: UpdateIdentityPool)

-- | The \"domain\" by which Cognito will refer to your users.
updateIdentityPool_developerProviderName :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe Prelude.Text)
updateIdentityPool_developerProviderName :: (Maybe Text -> f (Maybe Text))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_developerProviderName = (UpdateIdentityPool -> Maybe Text)
-> (UpdateIdentityPool -> Maybe Text -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool UpdateIdentityPool (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe Text
developerProviderName :: Maybe Text
$sel:developerProviderName:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe Text
developerProviderName} -> Maybe Text
developerProviderName) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe Text
a -> UpdateIdentityPool
s {$sel:developerProviderName:UpdateIdentityPool' :: Maybe Text
developerProviderName = Maybe Text
a} :: UpdateIdentityPool)

-- | The tags that are assigned to the identity pool. A tag is a label that
-- you can apply to identity pools to categorize and manage them in
-- different ways, such as by purpose, owner, environment, or other
-- criteria.
updateIdentityPool_identityPoolTags :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIdentityPool_identityPoolTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_identityPoolTags = (UpdateIdentityPool -> Maybe (HashMap Text Text))
-> (UpdateIdentityPool
    -> Maybe (HashMap Text Text) -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool
     UpdateIdentityPool
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe (HashMap Text Text)
identityPoolTags :: Maybe (HashMap Text Text)
$sel:identityPoolTags:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe (HashMap Text Text)
identityPoolTags} -> Maybe (HashMap Text Text)
identityPoolTags) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe (HashMap Text Text)
a -> UpdateIdentityPool
s {$sel:identityPoolTags:UpdateIdentityPool' :: Maybe (HashMap Text Text)
identityPoolTags = Maybe (HashMap Text Text)
a} :: UpdateIdentityPool) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIdentityPool -> f UpdateIdentityPool)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIdentityPool
-> f UpdateIdentityPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARNs of the OpenID Connect providers.
updateIdentityPool_openIdConnectProviderARNs :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe [Prelude.Text])
updateIdentityPool_openIdConnectProviderARNs :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_openIdConnectProviderARNs = (UpdateIdentityPool -> Maybe [Text])
-> (UpdateIdentityPool -> Maybe [Text] -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool UpdateIdentityPool (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe [Text]
openIdConnectProviderARNs :: Maybe [Text]
$sel:openIdConnectProviderARNs:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe [Text]
openIdConnectProviderARNs} -> Maybe [Text]
openIdConnectProviderARNs) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe [Text]
a -> UpdateIdentityPool
s {$sel:openIdConnectProviderARNs:UpdateIdentityPool' :: Maybe [Text]
openIdConnectProviderARNs = Maybe [Text]
a} :: UpdateIdentityPool) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateIdentityPool -> f UpdateIdentityPool)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateIdentityPool
-> f UpdateIdentityPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list representing an Amazon Cognito user pool and its client ID.
updateIdentityPool_cognitoIdentityProviders :: Lens.Lens' UpdateIdentityPool (Prelude.Maybe [CognitoIdentityProvider])
updateIdentityPool_cognitoIdentityProviders :: (Maybe [CognitoIdentityProvider]
 -> f (Maybe [CognitoIdentityProvider]))
-> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_cognitoIdentityProviders = (UpdateIdentityPool -> Maybe [CognitoIdentityProvider])
-> (UpdateIdentityPool
    -> Maybe [CognitoIdentityProvider] -> UpdateIdentityPool)
-> Lens
     UpdateIdentityPool
     UpdateIdentityPool
     (Maybe [CognitoIdentityProvider])
     (Maybe [CognitoIdentityProvider])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Maybe [CognitoIdentityProvider]
cognitoIdentityProviders :: Maybe [CognitoIdentityProvider]
$sel:cognitoIdentityProviders:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders} -> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Maybe [CognitoIdentityProvider]
a -> UpdateIdentityPool
s {$sel:cognitoIdentityProviders:UpdateIdentityPool' :: Maybe [CognitoIdentityProvider]
cognitoIdentityProviders = Maybe [CognitoIdentityProvider]
a} :: UpdateIdentityPool) ((Maybe [CognitoIdentityProvider]
  -> f (Maybe [CognitoIdentityProvider]))
 -> UpdateIdentityPool -> f UpdateIdentityPool)
-> ((Maybe [CognitoIdentityProvider]
     -> f (Maybe [CognitoIdentityProvider]))
    -> Maybe [CognitoIdentityProvider]
    -> f (Maybe [CognitoIdentityProvider]))
-> (Maybe [CognitoIdentityProvider]
    -> f (Maybe [CognitoIdentityProvider]))
-> UpdateIdentityPool
-> f UpdateIdentityPool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CognitoIdentityProvider]
  [CognitoIdentityProvider]
  [CognitoIdentityProvider]
  [CognitoIdentityProvider]
-> Iso
     (Maybe [CognitoIdentityProvider])
     (Maybe [CognitoIdentityProvider])
     (Maybe [CognitoIdentityProvider])
     (Maybe [CognitoIdentityProvider])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [CognitoIdentityProvider]
  [CognitoIdentityProvider]
  [CognitoIdentityProvider]
  [CognitoIdentityProvider]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identity pool ID in the format REGION:GUID.
updateIdentityPool_identityPoolId :: Lens.Lens' UpdateIdentityPool Prelude.Text
updateIdentityPool_identityPoolId :: (Text -> f Text) -> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_identityPoolId = (UpdateIdentityPool -> Text)
-> (UpdateIdentityPool -> Text -> UpdateIdentityPool)
-> Lens UpdateIdentityPool UpdateIdentityPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Text
identityPoolId :: Text
$sel:identityPoolId:UpdateIdentityPool' :: UpdateIdentityPool -> Text
identityPoolId} -> Text
identityPoolId) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Text
a -> UpdateIdentityPool
s {$sel:identityPoolId:UpdateIdentityPool' :: Text
identityPoolId = Text
a} :: UpdateIdentityPool)

-- | A string that you provide.
updateIdentityPool_identityPoolName :: Lens.Lens' UpdateIdentityPool Prelude.Text
updateIdentityPool_identityPoolName :: (Text -> f Text) -> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_identityPoolName = (UpdateIdentityPool -> Text)
-> (UpdateIdentityPool -> Text -> UpdateIdentityPool)
-> Lens UpdateIdentityPool UpdateIdentityPool Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Text
identityPoolName :: Text
$sel:identityPoolName:UpdateIdentityPool' :: UpdateIdentityPool -> Text
identityPoolName} -> Text
identityPoolName) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Text
a -> UpdateIdentityPool
s {$sel:identityPoolName:UpdateIdentityPool' :: Text
identityPoolName = Text
a} :: UpdateIdentityPool)

-- | TRUE if the identity pool supports unauthenticated logins.
updateIdentityPool_allowUnauthenticatedIdentities :: Lens.Lens' UpdateIdentityPool Prelude.Bool
updateIdentityPool_allowUnauthenticatedIdentities :: (Bool -> f Bool) -> UpdateIdentityPool -> f UpdateIdentityPool
updateIdentityPool_allowUnauthenticatedIdentities = (UpdateIdentityPool -> Bool)
-> (UpdateIdentityPool -> Bool -> UpdateIdentityPool)
-> Lens UpdateIdentityPool UpdateIdentityPool Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityPool' {Bool
allowUnauthenticatedIdentities :: Bool
$sel:allowUnauthenticatedIdentities:UpdateIdentityPool' :: UpdateIdentityPool -> Bool
allowUnauthenticatedIdentities} -> Bool
allowUnauthenticatedIdentities) (\s :: UpdateIdentityPool
s@UpdateIdentityPool' {} Bool
a -> UpdateIdentityPool
s {$sel:allowUnauthenticatedIdentities:UpdateIdentityPool' :: Bool
allowUnauthenticatedIdentities = Bool
a} :: UpdateIdentityPool)

instance Core.AWSRequest UpdateIdentityPool where
  type AWSResponse UpdateIdentityPool = IdentityPool
  request :: UpdateIdentityPool -> Request UpdateIdentityPool
request = Service -> UpdateIdentityPool -> Request UpdateIdentityPool
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateIdentityPool
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIdentityPool)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateIdentityPool))
-> Logger
-> Service
-> Proxy UpdateIdentityPool
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIdentityPool)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      (\Int
s ResponseHeaders
h Object
x -> Object -> Either String IdentityPool
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)

instance Prelude.Hashable UpdateIdentityPool

instance Prelude.NFData UpdateIdentityPool

instance Core.ToHeaders UpdateIdentityPool where
  toHeaders :: UpdateIdentityPool -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateIdentityPool -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCognitoIdentityService.UpdateIdentityPool" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateIdentityPool where
  toJSON :: UpdateIdentityPool -> Value
toJSON UpdateIdentityPool' {Bool
Maybe Bool
Maybe [Text]
Maybe [CognitoIdentityProvider]
Maybe Text
Maybe (HashMap Text Text)
Text
allowUnauthenticatedIdentities :: Bool
identityPoolName :: Text
identityPoolId :: Text
cognitoIdentityProviders :: Maybe [CognitoIdentityProvider]
openIdConnectProviderARNs :: Maybe [Text]
identityPoolTags :: Maybe (HashMap Text Text)
developerProviderName :: Maybe Text
allowClassicFlow :: Maybe Bool
supportedLoginProviders :: Maybe (HashMap Text Text)
samlProviderARNs :: Maybe [Text]
$sel:allowUnauthenticatedIdentities:UpdateIdentityPool' :: UpdateIdentityPool -> Bool
$sel:identityPoolName:UpdateIdentityPool' :: UpdateIdentityPool -> Text
$sel:identityPoolId:UpdateIdentityPool' :: UpdateIdentityPool -> Text
$sel:cognitoIdentityProviders:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe [CognitoIdentityProvider]
$sel:openIdConnectProviderARNs:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe [Text]
$sel:identityPoolTags:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe (HashMap Text Text)
$sel:developerProviderName:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe Text
$sel:allowClassicFlow:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe Bool
$sel:supportedLoginProviders:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe (HashMap Text Text)
$sel:samlProviderARNs:UpdateIdentityPool' :: UpdateIdentityPool -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SamlProviderARNs" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
samlProviderARNs,
            (Text
"SupportedLoginProviders" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
supportedLoginProviders,
            (Text
"AllowClassicFlow" 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
allowClassicFlow,
            (Text
"DeveloperProviderName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
developerProviderName,
            (Text
"IdentityPoolTags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
identityPoolTags,
            (Text
"OpenIdConnectProviderARNs" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
openIdConnectProviderARNs,
            (Text
"CognitoIdentityProviders" Text -> [CognitoIdentityProvider] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([CognitoIdentityProvider] -> Pair)
-> Maybe [CognitoIdentityProvider] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdentityPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityPoolId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdentityPoolName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityPoolName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"AllowUnauthenticatedIdentities"
                  Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
allowUnauthenticatedIdentities
              )
          ]
      )

instance Core.ToPath UpdateIdentityPool where
  toPath :: UpdateIdentityPool -> ByteString
toPath = ByteString -> UpdateIdentityPool -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateIdentityPool where
  toQuery :: UpdateIdentityPool -> QueryString
toQuery = QueryString -> UpdateIdentityPool -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty