{-# 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.CognitoIdentity.Types.IdentityPool
-- 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.CognitoIdentity.Types.IdentityPool where

import Amazonka.CognitoIdentity.Types.CognitoIdentityProvider
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

-- | An object representing an Amazon Cognito identity pool.
--
-- /See:/ 'newIdentityPool' smart constructor.
data IdentityPool = IdentityPool'
  { -- | 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/.
    IdentityPool -> Maybe Bool
allowClassicFlow :: Prelude.Maybe Prelude.Bool,
    -- | A list representing an Amazon Cognito user pool and its client ID.
    IdentityPool -> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders :: Prelude.Maybe [CognitoIdentityProvider],
    -- | The \"domain\" by which Cognito will refer to your users.
    IdentityPool -> 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.
    IdentityPool -> Maybe (HashMap Text Text)
identityPoolTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ARNs of the OpenID Connect providers.
    IdentityPool -> Maybe [Text]
openIdConnectProviderARNs :: Prelude.Maybe [Prelude.Text],
    -- | An array of Amazon Resource Names (ARNs) of the SAML provider for your
    -- identity pool.
    IdentityPool -> Maybe [Text]
samlProviderARNs :: Prelude.Maybe [Prelude.Text],
    -- | Optional key:value pairs mapping provider names to provider app IDs.
    IdentityPool -> Maybe (HashMap Text Text)
supportedLoginProviders :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | An identity pool ID in the format REGION:GUID.
    IdentityPool -> Text
identityPoolId :: Prelude.Text,
    -- | A string that you provide.
    IdentityPool -> Text
identityPoolName :: Prelude.Text,
    -- | TRUE if the identity pool supports unauthenticated logins.
    IdentityPool -> Bool
allowUnauthenticatedIdentities :: Prelude.Bool
  }
  deriving (IdentityPool -> IdentityPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityPool -> IdentityPool -> Bool
$c/= :: IdentityPool -> IdentityPool -> Bool
== :: IdentityPool -> IdentityPool -> Bool
$c== :: IdentityPool -> IdentityPool -> Bool
Prelude.Eq, ReadPrec [IdentityPool]
ReadPrec IdentityPool
Int -> ReadS IdentityPool
ReadS [IdentityPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityPool]
$creadListPrec :: ReadPrec [IdentityPool]
readPrec :: ReadPrec IdentityPool
$creadPrec :: ReadPrec IdentityPool
readList :: ReadS [IdentityPool]
$creadList :: ReadS [IdentityPool]
readsPrec :: Int -> ReadS IdentityPool
$creadsPrec :: Int -> ReadS IdentityPool
Prelude.Read, Int -> IdentityPool -> ShowS
[IdentityPool] -> ShowS
IdentityPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityPool] -> ShowS
$cshowList :: [IdentityPool] -> ShowS
show :: IdentityPool -> String
$cshow :: IdentityPool -> String
showsPrec :: Int -> IdentityPool -> ShowS
$cshowsPrec :: Int -> IdentityPool -> ShowS
Prelude.Show, forall x. Rep IdentityPool x -> IdentityPool
forall x. IdentityPool -> Rep IdentityPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdentityPool x -> IdentityPool
$cfrom :: forall x. IdentityPool -> Rep IdentityPool x
Prelude.Generic)

-- |
-- Create a value of 'IdentityPool' 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:
--
-- 'allowClassicFlow', 'identityPool_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/.
--
-- 'cognitoIdentityProviders', 'identityPool_cognitoIdentityProviders' - A list representing an Amazon Cognito user pool and its client ID.
--
-- 'developerProviderName', 'identityPool_developerProviderName' - The \"domain\" by which Cognito will refer to your users.
--
-- 'identityPoolTags', 'identityPool_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', 'identityPool_openIdConnectProviderARNs' - The ARNs of the OpenID Connect providers.
--
-- 'samlProviderARNs', 'identityPool_samlProviderARNs' - An array of Amazon Resource Names (ARNs) of the SAML provider for your
-- identity pool.
--
-- 'supportedLoginProviders', 'identityPool_supportedLoginProviders' - Optional key:value pairs mapping provider names to provider app IDs.
--
-- 'identityPoolId', 'identityPool_identityPoolId' - An identity pool ID in the format REGION:GUID.
--
-- 'identityPoolName', 'identityPool_identityPoolName' - A string that you provide.
--
-- 'allowUnauthenticatedIdentities', 'identityPool_allowUnauthenticatedIdentities' - TRUE if the identity pool supports unauthenticated logins.
newIdentityPool ::
  -- | 'identityPoolId'
  Prelude.Text ->
  -- | 'identityPoolName'
  Prelude.Text ->
  -- | 'allowUnauthenticatedIdentities'
  Prelude.Bool ->
  IdentityPool
newIdentityPool :: Text -> Text -> Bool -> IdentityPool
newIdentityPool
  Text
pIdentityPoolId_
  Text
pIdentityPoolName_
  Bool
pAllowUnauthenticatedIdentities_ =
    IdentityPool'
      { $sel:allowClassicFlow:IdentityPool' :: Maybe Bool
allowClassicFlow = forall a. Maybe a
Prelude.Nothing,
        $sel:cognitoIdentityProviders:IdentityPool' :: Maybe [CognitoIdentityProvider]
cognitoIdentityProviders = forall a. Maybe a
Prelude.Nothing,
        $sel:developerProviderName:IdentityPool' :: Maybe Text
developerProviderName = forall a. Maybe a
Prelude.Nothing,
        $sel:identityPoolTags:IdentityPool' :: Maybe (HashMap Text Text)
identityPoolTags = forall a. Maybe a
Prelude.Nothing,
        $sel:openIdConnectProviderARNs:IdentityPool' :: Maybe [Text]
openIdConnectProviderARNs = forall a. Maybe a
Prelude.Nothing,
        $sel:samlProviderARNs:IdentityPool' :: Maybe [Text]
samlProviderARNs = forall a. Maybe a
Prelude.Nothing,
        $sel:supportedLoginProviders:IdentityPool' :: Maybe (HashMap Text Text)
supportedLoginProviders = forall a. Maybe a
Prelude.Nothing,
        $sel:identityPoolId:IdentityPool' :: Text
identityPoolId = Text
pIdentityPoolId_,
        $sel:identityPoolName:IdentityPool' :: Text
identityPoolName = Text
pIdentityPoolName_,
        $sel:allowUnauthenticatedIdentities:IdentityPool' :: Bool
allowUnauthenticatedIdentities =
          Bool
pAllowUnauthenticatedIdentities_
      }

-- | 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/.
identityPool_allowClassicFlow :: Lens.Lens' IdentityPool (Prelude.Maybe Prelude.Bool)
identityPool_allowClassicFlow :: Lens' IdentityPool (Maybe Bool)
identityPool_allowClassicFlow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Maybe Bool
allowClassicFlow :: Maybe Bool
$sel:allowClassicFlow:IdentityPool' :: IdentityPool -> Maybe Bool
allowClassicFlow} -> Maybe Bool
allowClassicFlow) (\s :: IdentityPool
s@IdentityPool' {} Maybe Bool
a -> IdentityPool
s {$sel:allowClassicFlow:IdentityPool' :: Maybe Bool
allowClassicFlow = Maybe Bool
a} :: IdentityPool)

-- | A list representing an Amazon Cognito user pool and its client ID.
identityPool_cognitoIdentityProviders :: Lens.Lens' IdentityPool (Prelude.Maybe [CognitoIdentityProvider])
identityPool_cognitoIdentityProviders :: Lens' IdentityPool (Maybe [CognitoIdentityProvider])
identityPool_cognitoIdentityProviders = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Maybe [CognitoIdentityProvider]
cognitoIdentityProviders :: Maybe [CognitoIdentityProvider]
$sel:cognitoIdentityProviders:IdentityPool' :: IdentityPool -> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders} -> Maybe [CognitoIdentityProvider]
cognitoIdentityProviders) (\s :: IdentityPool
s@IdentityPool' {} Maybe [CognitoIdentityProvider]
a -> IdentityPool
s {$sel:cognitoIdentityProviders:IdentityPool' :: Maybe [CognitoIdentityProvider]
cognitoIdentityProviders = Maybe [CognitoIdentityProvider]
a} :: IdentityPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | 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.
identityPool_identityPoolTags :: Lens.Lens' IdentityPool (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
identityPool_identityPoolTags :: Lens' IdentityPool (Maybe (HashMap Text Text))
identityPool_identityPoolTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Maybe (HashMap Text Text)
identityPoolTags :: Maybe (HashMap Text Text)
$sel:identityPoolTags:IdentityPool' :: IdentityPool -> Maybe (HashMap Text Text)
identityPoolTags} -> Maybe (HashMap Text Text)
identityPoolTags) (\s :: IdentityPool
s@IdentityPool' {} Maybe (HashMap Text Text)
a -> IdentityPool
s {$sel:identityPoolTags:IdentityPool' :: Maybe (HashMap Text Text)
identityPoolTags = Maybe (HashMap Text Text)
a} :: IdentityPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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.
identityPool_openIdConnectProviderARNs :: Lens.Lens' IdentityPool (Prelude.Maybe [Prelude.Text])
identityPool_openIdConnectProviderARNs :: Lens' IdentityPool (Maybe [Text])
identityPool_openIdConnectProviderARNs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Maybe [Text]
openIdConnectProviderARNs :: Maybe [Text]
$sel:openIdConnectProviderARNs:IdentityPool' :: IdentityPool -> Maybe [Text]
openIdConnectProviderARNs} -> Maybe [Text]
openIdConnectProviderARNs) (\s :: IdentityPool
s@IdentityPool' {} Maybe [Text]
a -> IdentityPool
s {$sel:openIdConnectProviderARNs:IdentityPool' :: Maybe [Text]
openIdConnectProviderARNs = Maybe [Text]
a} :: IdentityPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of Amazon Resource Names (ARNs) of the SAML provider for your
-- identity pool.
identityPool_samlProviderARNs :: Lens.Lens' IdentityPool (Prelude.Maybe [Prelude.Text])
identityPool_samlProviderARNs :: Lens' IdentityPool (Maybe [Text])
identityPool_samlProviderARNs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Maybe [Text]
samlProviderARNs :: Maybe [Text]
$sel:samlProviderARNs:IdentityPool' :: IdentityPool -> Maybe [Text]
samlProviderARNs} -> Maybe [Text]
samlProviderARNs) (\s :: IdentityPool
s@IdentityPool' {} Maybe [Text]
a -> IdentityPool
s {$sel:samlProviderARNs:IdentityPool' :: Maybe [Text]
samlProviderARNs = Maybe [Text]
a} :: IdentityPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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.
identityPool_supportedLoginProviders :: Lens.Lens' IdentityPool (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
identityPool_supportedLoginProviders :: Lens' IdentityPool (Maybe (HashMap Text Text))
identityPool_supportedLoginProviders = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Maybe (HashMap Text Text)
supportedLoginProviders :: Maybe (HashMap Text Text)
$sel:supportedLoginProviders:IdentityPool' :: IdentityPool -> Maybe (HashMap Text Text)
supportedLoginProviders} -> Maybe (HashMap Text Text)
supportedLoginProviders) (\s :: IdentityPool
s@IdentityPool' {} Maybe (HashMap Text Text)
a -> IdentityPool
s {$sel:supportedLoginProviders:IdentityPool' :: Maybe (HashMap Text Text)
supportedLoginProviders = Maybe (HashMap Text Text)
a} :: IdentityPool) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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.
identityPool_identityPoolId :: Lens.Lens' IdentityPool Prelude.Text
identityPool_identityPoolId :: Lens' IdentityPool Text
identityPool_identityPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityPool' {Text
identityPoolId :: Text
$sel:identityPoolId:IdentityPool' :: IdentityPool -> Text
identityPoolId} -> Text
identityPoolId) (\s :: IdentityPool
s@IdentityPool' {} Text
a -> IdentityPool
s {$sel:identityPoolId:IdentityPool' :: Text
identityPoolId = Text
a} :: IdentityPool)

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

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

instance Data.FromJSON IdentityPool where
  parseJSON :: Value -> Parser IdentityPool
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"IdentityPool"
      ( \Object
x ->
          Maybe Bool
-> Maybe [CognitoIdentityProvider]
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe [Text]
-> Maybe [Text]
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Bool
-> IdentityPool
IdentityPool'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AllowClassicFlow")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CognitoIdentityProviders"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DeveloperProviderName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IdentityPoolTags"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OpenIdConnectProviderARNs"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SamlProviderARNs"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SupportedLoginProviders"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"IdentityPoolId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"IdentityPoolName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"AllowUnauthenticatedIdentities")
      )

instance Prelude.Hashable IdentityPool where
  hashWithSalt :: Int -> IdentityPool -> Int
hashWithSalt Int
_salt IdentityPool' {Bool
Maybe Bool
Maybe [Text]
Maybe [CognitoIdentityProvider]
Maybe Text
Maybe (HashMap Text Text)
Text
allowUnauthenticatedIdentities :: Bool
identityPoolName :: Text
identityPoolId :: Text
supportedLoginProviders :: Maybe (HashMap Text Text)
samlProviderARNs :: Maybe [Text]
openIdConnectProviderARNs :: Maybe [Text]
identityPoolTags :: Maybe (HashMap Text Text)
developerProviderName :: Maybe Text
cognitoIdentityProviders :: Maybe [CognitoIdentityProvider]
allowClassicFlow :: Maybe Bool
$sel:allowUnauthenticatedIdentities:IdentityPool' :: IdentityPool -> Bool
$sel:identityPoolName:IdentityPool' :: IdentityPool -> Text
$sel:identityPoolId:IdentityPool' :: IdentityPool -> Text
$sel:supportedLoginProviders:IdentityPool' :: IdentityPool -> Maybe (HashMap Text Text)
$sel:samlProviderARNs:IdentityPool' :: IdentityPool -> Maybe [Text]
$sel:openIdConnectProviderARNs:IdentityPool' :: IdentityPool -> Maybe [Text]
$sel:identityPoolTags:IdentityPool' :: IdentityPool -> Maybe (HashMap Text Text)
$sel:developerProviderName:IdentityPool' :: IdentityPool -> Maybe Text
$sel:cognitoIdentityProviders:IdentityPool' :: IdentityPool -> Maybe [CognitoIdentityProvider]
$sel:allowClassicFlow:IdentityPool' :: IdentityPool -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowClassicFlow
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CognitoIdentityProvider]
cognitoIdentityProviders
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
developerProviderName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
identityPoolTags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
openIdConnectProviderARNs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
samlProviderARNs
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
supportedLoginProviders
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identityPoolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identityPoolName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
allowUnauthenticatedIdentities

instance Prelude.NFData IdentityPool where
  rnf :: IdentityPool -> ()
rnf IdentityPool' {Bool
Maybe Bool
Maybe [Text]
Maybe [CognitoIdentityProvider]
Maybe Text
Maybe (HashMap Text Text)
Text
allowUnauthenticatedIdentities :: Bool
identityPoolName :: Text
identityPoolId :: Text
supportedLoginProviders :: Maybe (HashMap Text Text)
samlProviderARNs :: Maybe [Text]
openIdConnectProviderARNs :: Maybe [Text]
identityPoolTags :: Maybe (HashMap Text Text)
developerProviderName :: Maybe Text
cognitoIdentityProviders :: Maybe [CognitoIdentityProvider]
allowClassicFlow :: Maybe Bool
$sel:allowUnauthenticatedIdentities:IdentityPool' :: IdentityPool -> Bool
$sel:identityPoolName:IdentityPool' :: IdentityPool -> Text
$sel:identityPoolId:IdentityPool' :: IdentityPool -> Text
$sel:supportedLoginProviders:IdentityPool' :: IdentityPool -> Maybe (HashMap Text Text)
$sel:samlProviderARNs:IdentityPool' :: IdentityPool -> Maybe [Text]
$sel:openIdConnectProviderARNs:IdentityPool' :: IdentityPool -> Maybe [Text]
$sel:identityPoolTags:IdentityPool' :: IdentityPool -> Maybe (HashMap Text Text)
$sel:developerProviderName:IdentityPool' :: IdentityPool -> Maybe Text
$sel:cognitoIdentityProviders:IdentityPool' :: IdentityPool -> Maybe [CognitoIdentityProvider]
$sel:allowClassicFlow:IdentityPool' :: IdentityPool -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowClassicFlow
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CognitoIdentityProvider]
cognitoIdentityProviders
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
developerProviderName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
identityPoolTags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
openIdConnectProviderARNs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
samlProviderARNs
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
supportedLoginProviders
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
identityPoolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
identityPoolName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
allowUnauthenticatedIdentities

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