{-# 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 #-}
module Amazonka.CognitoIdentity.Types.CognitoIdentityProvider where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CognitoIdentityProvider = CognitoIdentityProvider'
{
CognitoIdentityProvider -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
CognitoIdentityProvider -> Maybe Bool
serverSideTokenCheck :: Prelude.Maybe Prelude.Bool,
CognitoIdentityProvider -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text
}
deriving (CognitoIdentityProvider -> CognitoIdentityProvider -> Bool
(CognitoIdentityProvider -> CognitoIdentityProvider -> Bool)
-> (CognitoIdentityProvider -> CognitoIdentityProvider -> Bool)
-> Eq CognitoIdentityProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CognitoIdentityProvider -> CognitoIdentityProvider -> Bool
$c/= :: CognitoIdentityProvider -> CognitoIdentityProvider -> Bool
== :: CognitoIdentityProvider -> CognitoIdentityProvider -> Bool
$c== :: CognitoIdentityProvider -> CognitoIdentityProvider -> Bool
Prelude.Eq, ReadPrec [CognitoIdentityProvider]
ReadPrec CognitoIdentityProvider
Int -> ReadS CognitoIdentityProvider
ReadS [CognitoIdentityProvider]
(Int -> ReadS CognitoIdentityProvider)
-> ReadS [CognitoIdentityProvider]
-> ReadPrec CognitoIdentityProvider
-> ReadPrec [CognitoIdentityProvider]
-> Read CognitoIdentityProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CognitoIdentityProvider]
$creadListPrec :: ReadPrec [CognitoIdentityProvider]
readPrec :: ReadPrec CognitoIdentityProvider
$creadPrec :: ReadPrec CognitoIdentityProvider
readList :: ReadS [CognitoIdentityProvider]
$creadList :: ReadS [CognitoIdentityProvider]
readsPrec :: Int -> ReadS CognitoIdentityProvider
$creadsPrec :: Int -> ReadS CognitoIdentityProvider
Prelude.Read, Int -> CognitoIdentityProvider -> ShowS
[CognitoIdentityProvider] -> ShowS
CognitoIdentityProvider -> String
(Int -> CognitoIdentityProvider -> ShowS)
-> (CognitoIdentityProvider -> String)
-> ([CognitoIdentityProvider] -> ShowS)
-> Show CognitoIdentityProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CognitoIdentityProvider] -> ShowS
$cshowList :: [CognitoIdentityProvider] -> ShowS
show :: CognitoIdentityProvider -> String
$cshow :: CognitoIdentityProvider -> String
showsPrec :: Int -> CognitoIdentityProvider -> ShowS
$cshowsPrec :: Int -> CognitoIdentityProvider -> ShowS
Prelude.Show, (forall x.
CognitoIdentityProvider -> Rep CognitoIdentityProvider x)
-> (forall x.
Rep CognitoIdentityProvider x -> CognitoIdentityProvider)
-> Generic CognitoIdentityProvider
forall x. Rep CognitoIdentityProvider x -> CognitoIdentityProvider
forall x. CognitoIdentityProvider -> Rep CognitoIdentityProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CognitoIdentityProvider x -> CognitoIdentityProvider
$cfrom :: forall x. CognitoIdentityProvider -> Rep CognitoIdentityProvider x
Prelude.Generic)
newCognitoIdentityProvider ::
CognitoIdentityProvider
newCognitoIdentityProvider :: CognitoIdentityProvider
newCognitoIdentityProvider =
CognitoIdentityProvider' :: Maybe Text -> Maybe Bool -> Maybe Text -> CognitoIdentityProvider
CognitoIdentityProvider'
{ $sel:clientId:CognitoIdentityProvider' :: Maybe Text
clientId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serverSideTokenCheck:CognitoIdentityProvider' :: Maybe Bool
serverSideTokenCheck = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:providerName:CognitoIdentityProvider' :: Maybe Text
providerName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
cognitoIdentityProvider_clientId :: Lens.Lens' CognitoIdentityProvider (Prelude.Maybe Prelude.Text)
cognitoIdentityProvider_clientId :: (Maybe Text -> f (Maybe Text))
-> CognitoIdentityProvider -> f CognitoIdentityProvider
cognitoIdentityProvider_clientId = (CognitoIdentityProvider -> Maybe Text)
-> (CognitoIdentityProvider
-> Maybe Text -> CognitoIdentityProvider)
-> Lens
CognitoIdentityProvider
CognitoIdentityProvider
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoIdentityProvider' {Maybe Text
clientId :: Maybe Text
$sel:clientId:CognitoIdentityProvider' :: CognitoIdentityProvider -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: CognitoIdentityProvider
s@CognitoIdentityProvider' {} Maybe Text
a -> CognitoIdentityProvider
s {$sel:clientId:CognitoIdentityProvider' :: Maybe Text
clientId = Maybe Text
a} :: CognitoIdentityProvider)
cognitoIdentityProvider_serverSideTokenCheck :: Lens.Lens' CognitoIdentityProvider (Prelude.Maybe Prelude.Bool)
cognitoIdentityProvider_serverSideTokenCheck :: (Maybe Bool -> f (Maybe Bool))
-> CognitoIdentityProvider -> f CognitoIdentityProvider
cognitoIdentityProvider_serverSideTokenCheck = (CognitoIdentityProvider -> Maybe Bool)
-> (CognitoIdentityProvider
-> Maybe Bool -> CognitoIdentityProvider)
-> Lens
CognitoIdentityProvider
CognitoIdentityProvider
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoIdentityProvider' {Maybe Bool
serverSideTokenCheck :: Maybe Bool
$sel:serverSideTokenCheck:CognitoIdentityProvider' :: CognitoIdentityProvider -> Maybe Bool
serverSideTokenCheck} -> Maybe Bool
serverSideTokenCheck) (\s :: CognitoIdentityProvider
s@CognitoIdentityProvider' {} Maybe Bool
a -> CognitoIdentityProvider
s {$sel:serverSideTokenCheck:CognitoIdentityProvider' :: Maybe Bool
serverSideTokenCheck = Maybe Bool
a} :: CognitoIdentityProvider)
cognitoIdentityProvider_providerName :: Lens.Lens' CognitoIdentityProvider (Prelude.Maybe Prelude.Text)
cognitoIdentityProvider_providerName :: (Maybe Text -> f (Maybe Text))
-> CognitoIdentityProvider -> f CognitoIdentityProvider
cognitoIdentityProvider_providerName = (CognitoIdentityProvider -> Maybe Text)
-> (CognitoIdentityProvider
-> Maybe Text -> CognitoIdentityProvider)
-> Lens
CognitoIdentityProvider
CognitoIdentityProvider
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CognitoIdentityProvider' {Maybe Text
providerName :: Maybe Text
$sel:providerName:CognitoIdentityProvider' :: CognitoIdentityProvider -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: CognitoIdentityProvider
s@CognitoIdentityProvider' {} Maybe Text
a -> CognitoIdentityProvider
s {$sel:providerName:CognitoIdentityProvider' :: Maybe Text
providerName = Maybe Text
a} :: CognitoIdentityProvider)
instance Core.FromJSON CognitoIdentityProvider where
parseJSON :: Value -> Parser CognitoIdentityProvider
parseJSON =
String
-> (Object -> Parser CognitoIdentityProvider)
-> Value
-> Parser CognitoIdentityProvider
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CognitoIdentityProvider"
( \Object
x ->
Maybe Text -> Maybe Bool -> Maybe Text -> CognitoIdentityProvider
CognitoIdentityProvider'
(Maybe Text -> Maybe Bool -> Maybe Text -> CognitoIdentityProvider)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Text -> CognitoIdentityProvider)
forall (f :: * -> *) a b. Functor 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
"ClientId")
Parser (Maybe Bool -> Maybe Text -> CognitoIdentityProvider)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> CognitoIdentityProvider)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServerSideTokenCheck")
Parser (Maybe Text -> CognitoIdentityProvider)
-> Parser (Maybe Text) -> Parser CognitoIdentityProvider
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 CognitoIdentityProvider
instance Prelude.NFData CognitoIdentityProvider
instance Core.ToJSON CognitoIdentityProvider where
toJSON :: CognitoIdentityProvider -> Value
toJSON CognitoIdentityProvider' {Maybe Bool
Maybe Text
providerName :: Maybe Text
serverSideTokenCheck :: Maybe Bool
clientId :: Maybe Text
$sel:providerName:CognitoIdentityProvider' :: CognitoIdentityProvider -> Maybe Text
$sel:serverSideTokenCheck:CognitoIdentityProvider' :: CognitoIdentityProvider -> Maybe Bool
$sel:clientId:CognitoIdentityProvider' :: CognitoIdentityProvider -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ClientId" 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
clientId,
(Text
"ServerSideTokenCheck" 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
serverSideTokenCheck,
(Text
"ProviderName" 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
providerName
]
)