{-# 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.CognitoIdentityProvider.Types.AdminCreateUserConfigType where
import Amazonka.CognitoIdentityProvider.Types.MessageTemplateType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AdminCreateUserConfigType = AdminCreateUserConfigType'
{
AdminCreateUserConfigType -> Maybe Bool
allowAdminCreateUserOnly :: Prelude.Maybe Prelude.Bool,
AdminCreateUserConfigType -> Maybe Natural
unusedAccountValidityDays :: Prelude.Maybe Prelude.Natural,
AdminCreateUserConfigType -> Maybe MessageTemplateType
inviteMessageTemplate :: Prelude.Maybe MessageTemplateType
}
deriving (AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool
(AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool)
-> (AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool)
-> Eq AdminCreateUserConfigType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool
$c/= :: AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool
== :: AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool
$c== :: AdminCreateUserConfigType -> AdminCreateUserConfigType -> Bool
Prelude.Eq, ReadPrec [AdminCreateUserConfigType]
ReadPrec AdminCreateUserConfigType
Int -> ReadS AdminCreateUserConfigType
ReadS [AdminCreateUserConfigType]
(Int -> ReadS AdminCreateUserConfigType)
-> ReadS [AdminCreateUserConfigType]
-> ReadPrec AdminCreateUserConfigType
-> ReadPrec [AdminCreateUserConfigType]
-> Read AdminCreateUserConfigType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminCreateUserConfigType]
$creadListPrec :: ReadPrec [AdminCreateUserConfigType]
readPrec :: ReadPrec AdminCreateUserConfigType
$creadPrec :: ReadPrec AdminCreateUserConfigType
readList :: ReadS [AdminCreateUserConfigType]
$creadList :: ReadS [AdminCreateUserConfigType]
readsPrec :: Int -> ReadS AdminCreateUserConfigType
$creadsPrec :: Int -> ReadS AdminCreateUserConfigType
Prelude.Read, Int -> AdminCreateUserConfigType -> ShowS
[AdminCreateUserConfigType] -> ShowS
AdminCreateUserConfigType -> String
(Int -> AdminCreateUserConfigType -> ShowS)
-> (AdminCreateUserConfigType -> String)
-> ([AdminCreateUserConfigType] -> ShowS)
-> Show AdminCreateUserConfigType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminCreateUserConfigType] -> ShowS
$cshowList :: [AdminCreateUserConfigType] -> ShowS
show :: AdminCreateUserConfigType -> String
$cshow :: AdminCreateUserConfigType -> String
showsPrec :: Int -> AdminCreateUserConfigType -> ShowS
$cshowsPrec :: Int -> AdminCreateUserConfigType -> ShowS
Prelude.Show, (forall x.
AdminCreateUserConfigType -> Rep AdminCreateUserConfigType x)
-> (forall x.
Rep AdminCreateUserConfigType x -> AdminCreateUserConfigType)
-> Generic AdminCreateUserConfigType
forall x.
Rep AdminCreateUserConfigType x -> AdminCreateUserConfigType
forall x.
AdminCreateUserConfigType -> Rep AdminCreateUserConfigType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminCreateUserConfigType x -> AdminCreateUserConfigType
$cfrom :: forall x.
AdminCreateUserConfigType -> Rep AdminCreateUserConfigType x
Prelude.Generic)
newAdminCreateUserConfigType ::
AdminCreateUserConfigType
newAdminCreateUserConfigType :: AdminCreateUserConfigType
newAdminCreateUserConfigType =
AdminCreateUserConfigType' :: Maybe Bool
-> Maybe Natural
-> Maybe MessageTemplateType
-> AdminCreateUserConfigType
AdminCreateUserConfigType'
{ $sel:allowAdminCreateUserOnly:AdminCreateUserConfigType' :: Maybe Bool
allowAdminCreateUserOnly =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:unusedAccountValidityDays:AdminCreateUserConfigType' :: Maybe Natural
unusedAccountValidityDays = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:inviteMessageTemplate:AdminCreateUserConfigType' :: Maybe MessageTemplateType
inviteMessageTemplate = Maybe MessageTemplateType
forall a. Maybe a
Prelude.Nothing
}
adminCreateUserConfigType_allowAdminCreateUserOnly :: Lens.Lens' AdminCreateUserConfigType (Prelude.Maybe Prelude.Bool)
adminCreateUserConfigType_allowAdminCreateUserOnly :: (Maybe Bool -> f (Maybe Bool))
-> AdminCreateUserConfigType -> f AdminCreateUserConfigType
adminCreateUserConfigType_allowAdminCreateUserOnly = (AdminCreateUserConfigType -> Maybe Bool)
-> (AdminCreateUserConfigType
-> Maybe Bool -> AdminCreateUserConfigType)
-> Lens
AdminCreateUserConfigType
AdminCreateUserConfigType
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminCreateUserConfigType' {Maybe Bool
allowAdminCreateUserOnly :: Maybe Bool
$sel:allowAdminCreateUserOnly:AdminCreateUserConfigType' :: AdminCreateUserConfigType -> Maybe Bool
allowAdminCreateUserOnly} -> Maybe Bool
allowAdminCreateUserOnly) (\s :: AdminCreateUserConfigType
s@AdminCreateUserConfigType' {} Maybe Bool
a -> AdminCreateUserConfigType
s {$sel:allowAdminCreateUserOnly:AdminCreateUserConfigType' :: Maybe Bool
allowAdminCreateUserOnly = Maybe Bool
a} :: AdminCreateUserConfigType)
adminCreateUserConfigType_unusedAccountValidityDays :: Lens.Lens' AdminCreateUserConfigType (Prelude.Maybe Prelude.Natural)
adminCreateUserConfigType_unusedAccountValidityDays :: (Maybe Natural -> f (Maybe Natural))
-> AdminCreateUserConfigType -> f AdminCreateUserConfigType
adminCreateUserConfigType_unusedAccountValidityDays = (AdminCreateUserConfigType -> Maybe Natural)
-> (AdminCreateUserConfigType
-> Maybe Natural -> AdminCreateUserConfigType)
-> Lens
AdminCreateUserConfigType
AdminCreateUserConfigType
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminCreateUserConfigType' {Maybe Natural
unusedAccountValidityDays :: Maybe Natural
$sel:unusedAccountValidityDays:AdminCreateUserConfigType' :: AdminCreateUserConfigType -> Maybe Natural
unusedAccountValidityDays} -> Maybe Natural
unusedAccountValidityDays) (\s :: AdminCreateUserConfigType
s@AdminCreateUserConfigType' {} Maybe Natural
a -> AdminCreateUserConfigType
s {$sel:unusedAccountValidityDays:AdminCreateUserConfigType' :: Maybe Natural
unusedAccountValidityDays = Maybe Natural
a} :: AdminCreateUserConfigType)
adminCreateUserConfigType_inviteMessageTemplate :: Lens.Lens' AdminCreateUserConfigType (Prelude.Maybe MessageTemplateType)
adminCreateUserConfigType_inviteMessageTemplate :: (Maybe MessageTemplateType -> f (Maybe MessageTemplateType))
-> AdminCreateUserConfigType -> f AdminCreateUserConfigType
adminCreateUserConfigType_inviteMessageTemplate = (AdminCreateUserConfigType -> Maybe MessageTemplateType)
-> (AdminCreateUserConfigType
-> Maybe MessageTemplateType -> AdminCreateUserConfigType)
-> Lens
AdminCreateUserConfigType
AdminCreateUserConfigType
(Maybe MessageTemplateType)
(Maybe MessageTemplateType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminCreateUserConfigType' {Maybe MessageTemplateType
inviteMessageTemplate :: Maybe MessageTemplateType
$sel:inviteMessageTemplate:AdminCreateUserConfigType' :: AdminCreateUserConfigType -> Maybe MessageTemplateType
inviteMessageTemplate} -> Maybe MessageTemplateType
inviteMessageTemplate) (\s :: AdminCreateUserConfigType
s@AdminCreateUserConfigType' {} Maybe MessageTemplateType
a -> AdminCreateUserConfigType
s {$sel:inviteMessageTemplate:AdminCreateUserConfigType' :: Maybe MessageTemplateType
inviteMessageTemplate = Maybe MessageTemplateType
a} :: AdminCreateUserConfigType)
instance Core.FromJSON AdminCreateUserConfigType where
parseJSON :: Value -> Parser AdminCreateUserConfigType
parseJSON =
String
-> (Object -> Parser AdminCreateUserConfigType)
-> Value
-> Parser AdminCreateUserConfigType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AdminCreateUserConfigType"
( \Object
x ->
Maybe Bool
-> Maybe Natural
-> Maybe MessageTemplateType
-> AdminCreateUserConfigType
AdminCreateUserConfigType'
(Maybe Bool
-> Maybe Natural
-> Maybe MessageTemplateType
-> AdminCreateUserConfigType)
-> Parser (Maybe Bool)
-> Parser
(Maybe Natural
-> Maybe MessageTemplateType -> AdminCreateUserConfigType)
forall (f :: * -> *) a b. Functor 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
"AllowAdminCreateUserOnly")
Parser
(Maybe Natural
-> Maybe MessageTemplateType -> AdminCreateUserConfigType)
-> Parser (Maybe Natural)
-> Parser (Maybe MessageTemplateType -> AdminCreateUserConfigType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UnusedAccountValidityDays")
Parser (Maybe MessageTemplateType -> AdminCreateUserConfigType)
-> Parser (Maybe MessageTemplateType)
-> Parser AdminCreateUserConfigType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MessageTemplateType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InviteMessageTemplate")
)
instance Prelude.Hashable AdminCreateUserConfigType
instance Prelude.NFData AdminCreateUserConfigType
instance Core.ToJSON AdminCreateUserConfigType where
toJSON :: AdminCreateUserConfigType -> Value
toJSON AdminCreateUserConfigType' {Maybe Bool
Maybe Natural
Maybe MessageTemplateType
inviteMessageTemplate :: Maybe MessageTemplateType
unusedAccountValidityDays :: Maybe Natural
allowAdminCreateUserOnly :: Maybe Bool
$sel:inviteMessageTemplate:AdminCreateUserConfigType' :: AdminCreateUserConfigType -> Maybe MessageTemplateType
$sel:unusedAccountValidityDays:AdminCreateUserConfigType' :: AdminCreateUserConfigType -> Maybe Natural
$sel:allowAdminCreateUserOnly:AdminCreateUserConfigType' :: AdminCreateUserConfigType -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AllowAdminCreateUserOnly" 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
allowAdminCreateUserOnly,
(Text
"UnusedAccountValidityDays" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
unusedAccountValidityDays,
(Text
"InviteMessageTemplate" Text -> MessageTemplateType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(MessageTemplateType -> Pair)
-> Maybe MessageTemplateType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MessageTemplateType
inviteMessageTemplate
]
)