{-# 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.SmsMfaConfigType where
import Amazonka.CognitoIdentityProvider.Types.SmsConfigurationType
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 SmsMfaConfigType = SmsMfaConfigType'
{
SmsMfaConfigType -> Maybe Text
smsAuthenticationMessage :: Prelude.Maybe Prelude.Text,
SmsMfaConfigType -> Maybe SmsConfigurationType
smsConfiguration :: Prelude.Maybe SmsConfigurationType
}
deriving (SmsMfaConfigType -> SmsMfaConfigType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SmsMfaConfigType -> SmsMfaConfigType -> Bool
$c/= :: SmsMfaConfigType -> SmsMfaConfigType -> Bool
== :: SmsMfaConfigType -> SmsMfaConfigType -> Bool
$c== :: SmsMfaConfigType -> SmsMfaConfigType -> Bool
Prelude.Eq, ReadPrec [SmsMfaConfigType]
ReadPrec SmsMfaConfigType
Int -> ReadS SmsMfaConfigType
ReadS [SmsMfaConfigType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SmsMfaConfigType]
$creadListPrec :: ReadPrec [SmsMfaConfigType]
readPrec :: ReadPrec SmsMfaConfigType
$creadPrec :: ReadPrec SmsMfaConfigType
readList :: ReadS [SmsMfaConfigType]
$creadList :: ReadS [SmsMfaConfigType]
readsPrec :: Int -> ReadS SmsMfaConfigType
$creadsPrec :: Int -> ReadS SmsMfaConfigType
Prelude.Read, Int -> SmsMfaConfigType -> ShowS
[SmsMfaConfigType] -> ShowS
SmsMfaConfigType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SmsMfaConfigType] -> ShowS
$cshowList :: [SmsMfaConfigType] -> ShowS
show :: SmsMfaConfigType -> String
$cshow :: SmsMfaConfigType -> String
showsPrec :: Int -> SmsMfaConfigType -> ShowS
$cshowsPrec :: Int -> SmsMfaConfigType -> ShowS
Prelude.Show, forall x. Rep SmsMfaConfigType x -> SmsMfaConfigType
forall x. SmsMfaConfigType -> Rep SmsMfaConfigType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SmsMfaConfigType x -> SmsMfaConfigType
$cfrom :: forall x. SmsMfaConfigType -> Rep SmsMfaConfigType x
Prelude.Generic)
newSmsMfaConfigType ::
SmsMfaConfigType
newSmsMfaConfigType :: SmsMfaConfigType
newSmsMfaConfigType =
SmsMfaConfigType'
{ $sel:smsAuthenticationMessage:SmsMfaConfigType' :: Maybe Text
smsAuthenticationMessage =
forall a. Maybe a
Prelude.Nothing,
$sel:smsConfiguration:SmsMfaConfigType' :: Maybe SmsConfigurationType
smsConfiguration = forall a. Maybe a
Prelude.Nothing
}
smsMfaConfigType_smsAuthenticationMessage :: Lens.Lens' SmsMfaConfigType (Prelude.Maybe Prelude.Text)
smsMfaConfigType_smsAuthenticationMessage :: Lens' SmsMfaConfigType (Maybe Text)
smsMfaConfigType_smsAuthenticationMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmsMfaConfigType' {Maybe Text
smsAuthenticationMessage :: Maybe Text
$sel:smsAuthenticationMessage:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe Text
smsAuthenticationMessage} -> Maybe Text
smsAuthenticationMessage) (\s :: SmsMfaConfigType
s@SmsMfaConfigType' {} Maybe Text
a -> SmsMfaConfigType
s {$sel:smsAuthenticationMessage:SmsMfaConfigType' :: Maybe Text
smsAuthenticationMessage = Maybe Text
a} :: SmsMfaConfigType)
smsMfaConfigType_smsConfiguration :: Lens.Lens' SmsMfaConfigType (Prelude.Maybe SmsConfigurationType)
smsMfaConfigType_smsConfiguration :: Lens' SmsMfaConfigType (Maybe SmsConfigurationType)
smsMfaConfigType_smsConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmsMfaConfigType' {Maybe SmsConfigurationType
smsConfiguration :: Maybe SmsConfigurationType
$sel:smsConfiguration:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe SmsConfigurationType
smsConfiguration} -> Maybe SmsConfigurationType
smsConfiguration) (\s :: SmsMfaConfigType
s@SmsMfaConfigType' {} Maybe SmsConfigurationType
a -> SmsMfaConfigType
s {$sel:smsConfiguration:SmsMfaConfigType' :: Maybe SmsConfigurationType
smsConfiguration = Maybe SmsConfigurationType
a} :: SmsMfaConfigType)
instance Data.FromJSON SmsMfaConfigType where
parseJSON :: Value -> Parser SmsMfaConfigType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SmsMfaConfigType"
( \Object
x ->
Maybe Text -> Maybe SmsConfigurationType -> SmsMfaConfigType
SmsMfaConfigType'
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
"SmsAuthenticationMessage")
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
"SmsConfiguration")
)
instance Prelude.Hashable SmsMfaConfigType where
hashWithSalt :: Int -> SmsMfaConfigType -> Int
hashWithSalt Int
_salt SmsMfaConfigType' {Maybe Text
Maybe SmsConfigurationType
smsConfiguration :: Maybe SmsConfigurationType
smsAuthenticationMessage :: Maybe Text
$sel:smsConfiguration:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe SmsConfigurationType
$sel:smsAuthenticationMessage:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
smsAuthenticationMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SmsConfigurationType
smsConfiguration
instance Prelude.NFData SmsMfaConfigType where
rnf :: SmsMfaConfigType -> ()
rnf SmsMfaConfigType' {Maybe Text
Maybe SmsConfigurationType
smsConfiguration :: Maybe SmsConfigurationType
smsAuthenticationMessage :: Maybe Text
$sel:smsConfiguration:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe SmsConfigurationType
$sel:smsAuthenticationMessage:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
smsAuthenticationMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SmsConfigurationType
smsConfiguration
instance Data.ToJSON SmsMfaConfigType where
toJSON :: SmsMfaConfigType -> Value
toJSON SmsMfaConfigType' {Maybe Text
Maybe SmsConfigurationType
smsConfiguration :: Maybe SmsConfigurationType
smsAuthenticationMessage :: Maybe Text
$sel:smsConfiguration:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe SmsConfigurationType
$sel:smsAuthenticationMessage:SmsMfaConfigType' :: SmsMfaConfigType -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SmsAuthenticationMessage" 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
smsAuthenticationMessage,
(Key
"SmsConfiguration" 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 SmsConfigurationType
smsConfiguration
]
)