{-# 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.AppSync.Types.UserPoolConfig where
import Amazonka.AppSync.Types.DefaultAction
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
data UserPoolConfig = UserPoolConfig'
{
UserPoolConfig -> Maybe Text
appIdClientRegex :: Prelude.Maybe Prelude.Text,
UserPoolConfig -> Text
userPoolId :: Prelude.Text,
UserPoolConfig -> Text
awsRegion :: Prelude.Text,
UserPoolConfig -> DefaultAction
defaultAction :: DefaultAction
}
deriving (UserPoolConfig -> UserPoolConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserPoolConfig -> UserPoolConfig -> Bool
$c/= :: UserPoolConfig -> UserPoolConfig -> Bool
== :: UserPoolConfig -> UserPoolConfig -> Bool
$c== :: UserPoolConfig -> UserPoolConfig -> Bool
Prelude.Eq, ReadPrec [UserPoolConfig]
ReadPrec UserPoolConfig
Int -> ReadS UserPoolConfig
ReadS [UserPoolConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserPoolConfig]
$creadListPrec :: ReadPrec [UserPoolConfig]
readPrec :: ReadPrec UserPoolConfig
$creadPrec :: ReadPrec UserPoolConfig
readList :: ReadS [UserPoolConfig]
$creadList :: ReadS [UserPoolConfig]
readsPrec :: Int -> ReadS UserPoolConfig
$creadsPrec :: Int -> ReadS UserPoolConfig
Prelude.Read, Int -> UserPoolConfig -> ShowS
[UserPoolConfig] -> ShowS
UserPoolConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserPoolConfig] -> ShowS
$cshowList :: [UserPoolConfig] -> ShowS
show :: UserPoolConfig -> String
$cshow :: UserPoolConfig -> String
showsPrec :: Int -> UserPoolConfig -> ShowS
$cshowsPrec :: Int -> UserPoolConfig -> ShowS
Prelude.Show, forall x. Rep UserPoolConfig x -> UserPoolConfig
forall x. UserPoolConfig -> Rep UserPoolConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserPoolConfig x -> UserPoolConfig
$cfrom :: forall x. UserPoolConfig -> Rep UserPoolConfig x
Prelude.Generic)
newUserPoolConfig ::
Prelude.Text ->
Prelude.Text ->
DefaultAction ->
UserPoolConfig
newUserPoolConfig :: Text -> Text -> DefaultAction -> UserPoolConfig
newUserPoolConfig
Text
pUserPoolId_
Text
pAwsRegion_
DefaultAction
pDefaultAction_ =
UserPoolConfig'
{ $sel:appIdClientRegex:UserPoolConfig' :: Maybe Text
appIdClientRegex = forall a. Maybe a
Prelude.Nothing,
$sel:userPoolId:UserPoolConfig' :: Text
userPoolId = Text
pUserPoolId_,
$sel:awsRegion:UserPoolConfig' :: Text
awsRegion = Text
pAwsRegion_,
$sel:defaultAction:UserPoolConfig' :: DefaultAction
defaultAction = DefaultAction
pDefaultAction_
}
userPoolConfig_appIdClientRegex :: Lens.Lens' UserPoolConfig (Prelude.Maybe Prelude.Text)
userPoolConfig_appIdClientRegex :: Lens' UserPoolConfig (Maybe Text)
userPoolConfig_appIdClientRegex = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolConfig' {Maybe Text
appIdClientRegex :: Maybe Text
$sel:appIdClientRegex:UserPoolConfig' :: UserPoolConfig -> Maybe Text
appIdClientRegex} -> Maybe Text
appIdClientRegex) (\s :: UserPoolConfig
s@UserPoolConfig' {} Maybe Text
a -> UserPoolConfig
s {$sel:appIdClientRegex:UserPoolConfig' :: Maybe Text
appIdClientRegex = Maybe Text
a} :: UserPoolConfig)
userPoolConfig_userPoolId :: Lens.Lens' UserPoolConfig Prelude.Text
userPoolConfig_userPoolId :: Lens' UserPoolConfig Text
userPoolConfig_userPoolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolConfig' {Text
userPoolId :: Text
$sel:userPoolId:UserPoolConfig' :: UserPoolConfig -> Text
userPoolId} -> Text
userPoolId) (\s :: UserPoolConfig
s@UserPoolConfig' {} Text
a -> UserPoolConfig
s {$sel:userPoolId:UserPoolConfig' :: Text
userPoolId = Text
a} :: UserPoolConfig)
userPoolConfig_awsRegion :: Lens.Lens' UserPoolConfig Prelude.Text
userPoolConfig_awsRegion :: Lens' UserPoolConfig Text
userPoolConfig_awsRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolConfig' {Text
awsRegion :: Text
$sel:awsRegion:UserPoolConfig' :: UserPoolConfig -> Text
awsRegion} -> Text
awsRegion) (\s :: UserPoolConfig
s@UserPoolConfig' {} Text
a -> UserPoolConfig
s {$sel:awsRegion:UserPoolConfig' :: Text
awsRegion = Text
a} :: UserPoolConfig)
userPoolConfig_defaultAction :: Lens.Lens' UserPoolConfig DefaultAction
userPoolConfig_defaultAction :: Lens' UserPoolConfig DefaultAction
userPoolConfig_defaultAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserPoolConfig' {DefaultAction
defaultAction :: DefaultAction
$sel:defaultAction:UserPoolConfig' :: UserPoolConfig -> DefaultAction
defaultAction} -> DefaultAction
defaultAction) (\s :: UserPoolConfig
s@UserPoolConfig' {} DefaultAction
a -> UserPoolConfig
s {$sel:defaultAction:UserPoolConfig' :: DefaultAction
defaultAction = DefaultAction
a} :: UserPoolConfig)
instance Data.FromJSON UserPoolConfig where
parseJSON :: Value -> Parser UserPoolConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UserPoolConfig"
( \Object
x ->
Maybe Text -> Text -> Text -> DefaultAction -> UserPoolConfig
UserPoolConfig'
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
"appIdClientRegex")
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
"userPoolId")
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
"awsRegion")
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
"defaultAction")
)
instance Prelude.Hashable UserPoolConfig where
hashWithSalt :: Int -> UserPoolConfig -> Int
hashWithSalt Int
_salt UserPoolConfig' {Maybe Text
Text
DefaultAction
defaultAction :: DefaultAction
awsRegion :: Text
userPoolId :: Text
appIdClientRegex :: Maybe Text
$sel:defaultAction:UserPoolConfig' :: UserPoolConfig -> DefaultAction
$sel:awsRegion:UserPoolConfig' :: UserPoolConfig -> Text
$sel:userPoolId:UserPoolConfig' :: UserPoolConfig -> Text
$sel:appIdClientRegex:UserPoolConfig' :: UserPoolConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appIdClientRegex
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userPoolId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsRegion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DefaultAction
defaultAction
instance Prelude.NFData UserPoolConfig where
rnf :: UserPoolConfig -> ()
rnf UserPoolConfig' {Maybe Text
Text
DefaultAction
defaultAction :: DefaultAction
awsRegion :: Text
userPoolId :: Text
appIdClientRegex :: Maybe Text
$sel:defaultAction:UserPoolConfig' :: UserPoolConfig -> DefaultAction
$sel:awsRegion:UserPoolConfig' :: UserPoolConfig -> Text
$sel:userPoolId:UserPoolConfig' :: UserPoolConfig -> Text
$sel:appIdClientRegex:UserPoolConfig' :: UserPoolConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appIdClientRegex
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userPoolId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsRegion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DefaultAction
defaultAction
instance Data.ToJSON UserPoolConfig where
toJSON :: UserPoolConfig -> Value
toJSON UserPoolConfig' {Maybe Text
Text
DefaultAction
defaultAction :: DefaultAction
awsRegion :: Text
userPoolId :: Text
appIdClientRegex :: Maybe Text
$sel:defaultAction:UserPoolConfig' :: UserPoolConfig -> DefaultAction
$sel:awsRegion:UserPoolConfig' :: UserPoolConfig -> Text
$sel:userPoolId:UserPoolConfig' :: UserPoolConfig -> Text
$sel:appIdClientRegex:UserPoolConfig' :: UserPoolConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"appIdClientRegex" 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
appIdClientRegex,
forall a. a -> Maybe a
Prelude.Just (Key
"userPoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userPoolId),
forall a. a -> Maybe a
Prelude.Just (Key
"awsRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
awsRegion),
forall a. a -> Maybe a
Prelude.Just
(Key
"defaultAction" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DefaultAction
defaultAction)
]
)