{-# 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.CognitoIdentityProvider.Types.IdentityProviderType
-- 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.CognitoIdentityProvider.Types.IdentityProviderType where

import Amazonka.CognitoIdentityProvider.Types.IdentityProviderTypeType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A container for information about an identity provider.
--
-- /See:/ 'newIdentityProviderType' smart constructor.
data IdentityProviderType = IdentityProviderType'
  { -- | The date the identity provider was last modified.
    IdentityProviderType -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The user pool ID.
    IdentityProviderType -> Maybe Text
userPoolId :: Prelude.Maybe Prelude.Text,
    -- | The identity provider type.
    IdentityProviderType -> Maybe IdentityProviderTypeType
providerType :: Prelude.Maybe IdentityProviderTypeType,
    -- | The date the identity provider was created.
    IdentityProviderType -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | A list of identity provider identifiers.
    IdentityProviderType -> Maybe [Text]
idpIdentifiers :: Prelude.Maybe [Prelude.Text],
    -- | A mapping of identity provider attributes to standard and custom user
    -- pool attributes.
    IdentityProviderType -> Maybe (HashMap Text Text)
attributeMapping :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identity provider details. The following list describes the provider
    -- detail keys for each identity provider type.
    --
    -- -   For Google and Login with Amazon:
    --
    --     -   client_id
    --
    --     -   client_secret
    --
    --     -   authorize_scopes
    --
    -- -   For Facebook:
    --
    --     -   client_id
    --
    --     -   client_secret
    --
    --     -   authorize_scopes
    --
    --     -   api_version
    --
    -- -   For Sign in with Apple:
    --
    --     -   client_id
    --
    --     -   team_id
    --
    --     -   key_id
    --
    --     -   private_key
    --
    --     -   authorize_scopes
    --
    -- -   For OIDC providers:
    --
    --     -   client_id
    --
    --     -   client_secret
    --
    --     -   attributes_request_method
    --
    --     -   oidc_issuer
    --
    --     -   authorize_scopes
    --
    --     -   authorize_url /if not available from discovery URL specified by
    --         oidc_issuer key/
    --
    --     -   token_url /if not available from discovery URL specified by
    --         oidc_issuer key/
    --
    --     -   attributes_url /if not available from discovery URL specified by
    --         oidc_issuer key/
    --
    --     -   jwks_uri /if not available from discovery URL specified by
    --         oidc_issuer key/
    --
    -- -   For SAML providers:
    --
    --     -   MetadataFile OR MetadataURL
    --
    --     -   IDPSignOut /optional/
    IdentityProviderType -> Maybe (HashMap Text Text)
providerDetails :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identity provider name.
    IdentityProviderType -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text
  }
  deriving (IdentityProviderType -> IdentityProviderType -> Bool
(IdentityProviderType -> IdentityProviderType -> Bool)
-> (IdentityProviderType -> IdentityProviderType -> Bool)
-> Eq IdentityProviderType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityProviderType -> IdentityProviderType -> Bool
$c/= :: IdentityProviderType -> IdentityProviderType -> Bool
== :: IdentityProviderType -> IdentityProviderType -> Bool
$c== :: IdentityProviderType -> IdentityProviderType -> Bool
Prelude.Eq, ReadPrec [IdentityProviderType]
ReadPrec IdentityProviderType
Int -> ReadS IdentityProviderType
ReadS [IdentityProviderType]
(Int -> ReadS IdentityProviderType)
-> ReadS [IdentityProviderType]
-> ReadPrec IdentityProviderType
-> ReadPrec [IdentityProviderType]
-> Read IdentityProviderType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityProviderType]
$creadListPrec :: ReadPrec [IdentityProviderType]
readPrec :: ReadPrec IdentityProviderType
$creadPrec :: ReadPrec IdentityProviderType
readList :: ReadS [IdentityProviderType]
$creadList :: ReadS [IdentityProviderType]
readsPrec :: Int -> ReadS IdentityProviderType
$creadsPrec :: Int -> ReadS IdentityProviderType
Prelude.Read, Int -> IdentityProviderType -> ShowS
[IdentityProviderType] -> ShowS
IdentityProviderType -> String
(Int -> IdentityProviderType -> ShowS)
-> (IdentityProviderType -> String)
-> ([IdentityProviderType] -> ShowS)
-> Show IdentityProviderType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityProviderType] -> ShowS
$cshowList :: [IdentityProviderType] -> ShowS
show :: IdentityProviderType -> String
$cshow :: IdentityProviderType -> String
showsPrec :: Int -> IdentityProviderType -> ShowS
$cshowsPrec :: Int -> IdentityProviderType -> ShowS
Prelude.Show, (forall x. IdentityProviderType -> Rep IdentityProviderType x)
-> (forall x. Rep IdentityProviderType x -> IdentityProviderType)
-> Generic IdentityProviderType
forall x. Rep IdentityProviderType x -> IdentityProviderType
forall x. IdentityProviderType -> Rep IdentityProviderType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdentityProviderType x -> IdentityProviderType
$cfrom :: forall x. IdentityProviderType -> Rep IdentityProviderType x
Prelude.Generic)

-- |
-- Create a value of 'IdentityProviderType' 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:
--
-- 'lastModifiedDate', 'identityProviderType_lastModifiedDate' - The date the identity provider was last modified.
--
-- 'userPoolId', 'identityProviderType_userPoolId' - The user pool ID.
--
-- 'providerType', 'identityProviderType_providerType' - The identity provider type.
--
-- 'creationDate', 'identityProviderType_creationDate' - The date the identity provider was created.
--
-- 'idpIdentifiers', 'identityProviderType_idpIdentifiers' - A list of identity provider identifiers.
--
-- 'attributeMapping', 'identityProviderType_attributeMapping' - A mapping of identity provider attributes to standard and custom user
-- pool attributes.
--
-- 'providerDetails', 'identityProviderType_providerDetails' - The identity provider details. The following list describes the provider
-- detail keys for each identity provider type.
--
-- -   For Google and Login with Amazon:
--
--     -   client_id
--
--     -   client_secret
--
--     -   authorize_scopes
--
-- -   For Facebook:
--
--     -   client_id
--
--     -   client_secret
--
--     -   authorize_scopes
--
--     -   api_version
--
-- -   For Sign in with Apple:
--
--     -   client_id
--
--     -   team_id
--
--     -   key_id
--
--     -   private_key
--
--     -   authorize_scopes
--
-- -   For OIDC providers:
--
--     -   client_id
--
--     -   client_secret
--
--     -   attributes_request_method
--
--     -   oidc_issuer
--
--     -   authorize_scopes
--
--     -   authorize_url /if not available from discovery URL specified by
--         oidc_issuer key/
--
--     -   token_url /if not available from discovery URL specified by
--         oidc_issuer key/
--
--     -   attributes_url /if not available from discovery URL specified by
--         oidc_issuer key/
--
--     -   jwks_uri /if not available from discovery URL specified by
--         oidc_issuer key/
--
-- -   For SAML providers:
--
--     -   MetadataFile OR MetadataURL
--
--     -   IDPSignOut /optional/
--
-- 'providerName', 'identityProviderType_providerName' - The identity provider name.
newIdentityProviderType ::
  IdentityProviderType
newIdentityProviderType :: IdentityProviderType
newIdentityProviderType =
  IdentityProviderType' :: Maybe POSIX
-> Maybe Text
-> Maybe IdentityProviderTypeType
-> Maybe POSIX
-> Maybe [Text]
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe Text
-> IdentityProviderType
IdentityProviderType'
    { $sel:lastModifiedDate:IdentityProviderType' :: Maybe POSIX
lastModifiedDate =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:IdentityProviderType' :: Maybe Text
userPoolId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:providerType:IdentityProviderType' :: Maybe IdentityProviderTypeType
providerType = Maybe IdentityProviderTypeType
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:IdentityProviderType' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:idpIdentifiers:IdentityProviderType' :: Maybe [Text]
idpIdentifiers = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:attributeMapping:IdentityProviderType' :: Maybe (HashMap Text Text)
attributeMapping = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:providerDetails:IdentityProviderType' :: Maybe (HashMap Text Text)
providerDetails = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:providerName:IdentityProviderType' :: Maybe Text
providerName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The date the identity provider was last modified.
identityProviderType_lastModifiedDate :: Lens.Lens' IdentityProviderType (Prelude.Maybe Prelude.UTCTime)
identityProviderType_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_lastModifiedDate = (IdentityProviderType -> Maybe POSIX)
-> (IdentityProviderType -> Maybe POSIX -> IdentityProviderType)
-> Lens
     IdentityProviderType
     IdentityProviderType
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderType' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:IdentityProviderType' :: IdentityProviderType -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe POSIX
a -> IdentityProviderType
s {$sel:lastModifiedDate:IdentityProviderType' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: IdentityProviderType) ((Maybe POSIX -> f (Maybe POSIX))
 -> IdentityProviderType -> f IdentityProviderType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> IdentityProviderType
-> f IdentityProviderType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The user pool ID.
identityProviderType_userPoolId :: Lens.Lens' IdentityProviderType (Prelude.Maybe Prelude.Text)
identityProviderType_userPoolId :: (Maybe Text -> f (Maybe Text))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_userPoolId = (IdentityProviderType -> Maybe Text)
-> (IdentityProviderType -> Maybe Text -> IdentityProviderType)
-> Lens
     IdentityProviderType IdentityProviderType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderType' {Maybe Text
userPoolId :: Maybe Text
$sel:userPoolId:IdentityProviderType' :: IdentityProviderType -> Maybe Text
userPoolId} -> Maybe Text
userPoolId) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe Text
a -> IdentityProviderType
s {$sel:userPoolId:IdentityProviderType' :: Maybe Text
userPoolId = Maybe Text
a} :: IdentityProviderType)

-- | The identity provider type.
identityProviderType_providerType :: Lens.Lens' IdentityProviderType (Prelude.Maybe IdentityProviderTypeType)
identityProviderType_providerType :: (Maybe IdentityProviderTypeType
 -> f (Maybe IdentityProviderTypeType))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_providerType = (IdentityProviderType -> Maybe IdentityProviderTypeType)
-> (IdentityProviderType
    -> Maybe IdentityProviderTypeType -> IdentityProviderType)
-> Lens
     IdentityProviderType
     IdentityProviderType
     (Maybe IdentityProviderTypeType)
     (Maybe IdentityProviderTypeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderType' {Maybe IdentityProviderTypeType
providerType :: Maybe IdentityProviderTypeType
$sel:providerType:IdentityProviderType' :: IdentityProviderType -> Maybe IdentityProviderTypeType
providerType} -> Maybe IdentityProviderTypeType
providerType) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe IdentityProviderTypeType
a -> IdentityProviderType
s {$sel:providerType:IdentityProviderType' :: Maybe IdentityProviderTypeType
providerType = Maybe IdentityProviderTypeType
a} :: IdentityProviderType)

-- | The date the identity provider was created.
identityProviderType_creationDate :: Lens.Lens' IdentityProviderType (Prelude.Maybe Prelude.UTCTime)
identityProviderType_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_creationDate = (IdentityProviderType -> Maybe POSIX)
-> (IdentityProviderType -> Maybe POSIX -> IdentityProviderType)
-> Lens
     IdentityProviderType
     IdentityProviderType
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderType' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:IdentityProviderType' :: IdentityProviderType -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe POSIX
a -> IdentityProviderType
s {$sel:creationDate:IdentityProviderType' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: IdentityProviderType) ((Maybe POSIX -> f (Maybe POSIX))
 -> IdentityProviderType -> f IdentityProviderType)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> IdentityProviderType
-> f IdentityProviderType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A list of identity provider identifiers.
identityProviderType_idpIdentifiers :: Lens.Lens' IdentityProviderType (Prelude.Maybe [Prelude.Text])
identityProviderType_idpIdentifiers :: (Maybe [Text] -> f (Maybe [Text]))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_idpIdentifiers = (IdentityProviderType -> Maybe [Text])
-> (IdentityProviderType -> Maybe [Text] -> IdentityProviderType)
-> Lens
     IdentityProviderType
     IdentityProviderType
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderType' {Maybe [Text]
idpIdentifiers :: Maybe [Text]
$sel:idpIdentifiers:IdentityProviderType' :: IdentityProviderType -> Maybe [Text]
idpIdentifiers} -> Maybe [Text]
idpIdentifiers) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe [Text]
a -> IdentityProviderType
s {$sel:idpIdentifiers:IdentityProviderType' :: Maybe [Text]
idpIdentifiers = Maybe [Text]
a} :: IdentityProviderType) ((Maybe [Text] -> f (Maybe [Text]))
 -> IdentityProviderType -> f IdentityProviderType)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> IdentityProviderType
-> f IdentityProviderType
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 mapping of identity provider attributes to standard and custom user
-- pool attributes.
identityProviderType_attributeMapping :: Lens.Lens' IdentityProviderType (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
identityProviderType_attributeMapping :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_attributeMapping = (IdentityProviderType -> Maybe (HashMap Text Text))
-> (IdentityProviderType
    -> Maybe (HashMap Text Text) -> IdentityProviderType)
-> Lens
     IdentityProviderType
     IdentityProviderType
     (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 (\IdentityProviderType' {Maybe (HashMap Text Text)
attributeMapping :: Maybe (HashMap Text Text)
$sel:attributeMapping:IdentityProviderType' :: IdentityProviderType -> Maybe (HashMap Text Text)
attributeMapping} -> Maybe (HashMap Text Text)
attributeMapping) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe (HashMap Text Text)
a -> IdentityProviderType
s {$sel:attributeMapping:IdentityProviderType' :: Maybe (HashMap Text Text)
attributeMapping = Maybe (HashMap Text Text)
a} :: IdentityProviderType) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> IdentityProviderType -> f IdentityProviderType)
-> ((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)))
-> IdentityProviderType
-> f IdentityProviderType
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 identity provider details. The following list describes the provider
-- detail keys for each identity provider type.
--
-- -   For Google and Login with Amazon:
--
--     -   client_id
--
--     -   client_secret
--
--     -   authorize_scopes
--
-- -   For Facebook:
--
--     -   client_id
--
--     -   client_secret
--
--     -   authorize_scopes
--
--     -   api_version
--
-- -   For Sign in with Apple:
--
--     -   client_id
--
--     -   team_id
--
--     -   key_id
--
--     -   private_key
--
--     -   authorize_scopes
--
-- -   For OIDC providers:
--
--     -   client_id
--
--     -   client_secret
--
--     -   attributes_request_method
--
--     -   oidc_issuer
--
--     -   authorize_scopes
--
--     -   authorize_url /if not available from discovery URL specified by
--         oidc_issuer key/
--
--     -   token_url /if not available from discovery URL specified by
--         oidc_issuer key/
--
--     -   attributes_url /if not available from discovery URL specified by
--         oidc_issuer key/
--
--     -   jwks_uri /if not available from discovery URL specified by
--         oidc_issuer key/
--
-- -   For SAML providers:
--
--     -   MetadataFile OR MetadataURL
--
--     -   IDPSignOut /optional/
identityProviderType_providerDetails :: Lens.Lens' IdentityProviderType (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
identityProviderType_providerDetails :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_providerDetails = (IdentityProviderType -> Maybe (HashMap Text Text))
-> (IdentityProviderType
    -> Maybe (HashMap Text Text) -> IdentityProviderType)
-> Lens
     IdentityProviderType
     IdentityProviderType
     (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 (\IdentityProviderType' {Maybe (HashMap Text Text)
providerDetails :: Maybe (HashMap Text Text)
$sel:providerDetails:IdentityProviderType' :: IdentityProviderType -> Maybe (HashMap Text Text)
providerDetails} -> Maybe (HashMap Text Text)
providerDetails) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe (HashMap Text Text)
a -> IdentityProviderType
s {$sel:providerDetails:IdentityProviderType' :: Maybe (HashMap Text Text)
providerDetails = Maybe (HashMap Text Text)
a} :: IdentityProviderType) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> IdentityProviderType -> f IdentityProviderType)
-> ((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)))
-> IdentityProviderType
-> f IdentityProviderType
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 identity provider name.
identityProviderType_providerName :: Lens.Lens' IdentityProviderType (Prelude.Maybe Prelude.Text)
identityProviderType_providerName :: (Maybe Text -> f (Maybe Text))
-> IdentityProviderType -> f IdentityProviderType
identityProviderType_providerName = (IdentityProviderType -> Maybe Text)
-> (IdentityProviderType -> Maybe Text -> IdentityProviderType)
-> Lens
     IdentityProviderType IdentityProviderType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderType' {Maybe Text
providerName :: Maybe Text
$sel:providerName:IdentityProviderType' :: IdentityProviderType -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: IdentityProviderType
s@IdentityProviderType' {} Maybe Text
a -> IdentityProviderType
s {$sel:providerName:IdentityProviderType' :: Maybe Text
providerName = Maybe Text
a} :: IdentityProviderType)

instance Core.FromJSON IdentityProviderType where
  parseJSON :: Value -> Parser IdentityProviderType
parseJSON =
    String
-> (Object -> Parser IdentityProviderType)
-> Value
-> Parser IdentityProviderType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IdentityProviderType"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe IdentityProviderTypeType
-> Maybe POSIX
-> Maybe [Text]
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Maybe Text
-> IdentityProviderType
IdentityProviderType'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe IdentityProviderTypeType
 -> Maybe POSIX
 -> Maybe [Text]
 -> Maybe (HashMap Text Text)
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> IdentityProviderType)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe IdentityProviderTypeType
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> IdentityProviderType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedDate")
            Parser
  (Maybe Text
   -> Maybe IdentityProviderTypeType
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> IdentityProviderType)
-> Parser (Maybe Text)
-> Parser
     (Maybe IdentityProviderTypeType
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> IdentityProviderType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserPoolId")
            Parser
  (Maybe IdentityProviderTypeType
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> IdentityProviderType)
-> Parser (Maybe IdentityProviderTypeType)
-> Parser
     (Maybe POSIX
      -> Maybe [Text]
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> IdentityProviderType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IdentityProviderTypeType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProviderType")
            Parser
  (Maybe POSIX
   -> Maybe [Text]
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> IdentityProviderType)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe [Text]
      -> Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> IdentityProviderType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
            Parser
  (Maybe [Text]
   -> Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> IdentityProviderType)
-> Parser (Maybe [Text])
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe (HashMap Text Text) -> Maybe Text -> IdentityProviderType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IdpIdentifiers" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe (HashMap Text Text) -> Maybe Text -> IdentityProviderType)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe (HashMap Text Text) -> Maybe Text -> IdentityProviderType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AttributeMapping"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe (HashMap Text Text) -> Maybe Text -> IdentityProviderType)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> IdentityProviderType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProviderDetails"
                            Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> IdentityProviderType)
-> Parser (Maybe Text) -> Parser IdentityProviderType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProviderName")
      )

instance Prelude.Hashable IdentityProviderType

instance Prelude.NFData IdentityProviderType