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