{-# 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.SMSMfaSettingsType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SMSMfaSettingsType = SMSMfaSettingsType'
{
SMSMfaSettingsType -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
SMSMfaSettingsType -> Maybe Bool
preferredMfa :: Prelude.Maybe Prelude.Bool
}
deriving (SMSMfaSettingsType -> SMSMfaSettingsType -> Bool
(SMSMfaSettingsType -> SMSMfaSettingsType -> Bool)
-> (SMSMfaSettingsType -> SMSMfaSettingsType -> Bool)
-> Eq SMSMfaSettingsType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SMSMfaSettingsType -> SMSMfaSettingsType -> Bool
$c/= :: SMSMfaSettingsType -> SMSMfaSettingsType -> Bool
== :: SMSMfaSettingsType -> SMSMfaSettingsType -> Bool
$c== :: SMSMfaSettingsType -> SMSMfaSettingsType -> Bool
Prelude.Eq, ReadPrec [SMSMfaSettingsType]
ReadPrec SMSMfaSettingsType
Int -> ReadS SMSMfaSettingsType
ReadS [SMSMfaSettingsType]
(Int -> ReadS SMSMfaSettingsType)
-> ReadS [SMSMfaSettingsType]
-> ReadPrec SMSMfaSettingsType
-> ReadPrec [SMSMfaSettingsType]
-> Read SMSMfaSettingsType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SMSMfaSettingsType]
$creadListPrec :: ReadPrec [SMSMfaSettingsType]
readPrec :: ReadPrec SMSMfaSettingsType
$creadPrec :: ReadPrec SMSMfaSettingsType
readList :: ReadS [SMSMfaSettingsType]
$creadList :: ReadS [SMSMfaSettingsType]
readsPrec :: Int -> ReadS SMSMfaSettingsType
$creadsPrec :: Int -> ReadS SMSMfaSettingsType
Prelude.Read, Int -> SMSMfaSettingsType -> ShowS
[SMSMfaSettingsType] -> ShowS
SMSMfaSettingsType -> String
(Int -> SMSMfaSettingsType -> ShowS)
-> (SMSMfaSettingsType -> String)
-> ([SMSMfaSettingsType] -> ShowS)
-> Show SMSMfaSettingsType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SMSMfaSettingsType] -> ShowS
$cshowList :: [SMSMfaSettingsType] -> ShowS
show :: SMSMfaSettingsType -> String
$cshow :: SMSMfaSettingsType -> String
showsPrec :: Int -> SMSMfaSettingsType -> ShowS
$cshowsPrec :: Int -> SMSMfaSettingsType -> ShowS
Prelude.Show, (forall x. SMSMfaSettingsType -> Rep SMSMfaSettingsType x)
-> (forall x. Rep SMSMfaSettingsType x -> SMSMfaSettingsType)
-> Generic SMSMfaSettingsType
forall x. Rep SMSMfaSettingsType x -> SMSMfaSettingsType
forall x. SMSMfaSettingsType -> Rep SMSMfaSettingsType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SMSMfaSettingsType x -> SMSMfaSettingsType
$cfrom :: forall x. SMSMfaSettingsType -> Rep SMSMfaSettingsType x
Prelude.Generic)
newSMSMfaSettingsType ::
SMSMfaSettingsType
newSMSMfaSettingsType :: SMSMfaSettingsType
newSMSMfaSettingsType =
SMSMfaSettingsType' :: Maybe Bool -> Maybe Bool -> SMSMfaSettingsType
SMSMfaSettingsType'
{ $sel:enabled:SMSMfaSettingsType' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:preferredMfa:SMSMfaSettingsType' :: Maybe Bool
preferredMfa = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
sMSMfaSettingsType_enabled :: Lens.Lens' SMSMfaSettingsType (Prelude.Maybe Prelude.Bool)
sMSMfaSettingsType_enabled :: (Maybe Bool -> f (Maybe Bool))
-> SMSMfaSettingsType -> f SMSMfaSettingsType
sMSMfaSettingsType_enabled = (SMSMfaSettingsType -> Maybe Bool)
-> (SMSMfaSettingsType -> Maybe Bool -> SMSMfaSettingsType)
-> Lens
SMSMfaSettingsType SMSMfaSettingsType (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMfaSettingsType' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:SMSMfaSettingsType' :: SMSMfaSettingsType -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: SMSMfaSettingsType
s@SMSMfaSettingsType' {} Maybe Bool
a -> SMSMfaSettingsType
s {$sel:enabled:SMSMfaSettingsType' :: Maybe Bool
enabled = Maybe Bool
a} :: SMSMfaSettingsType)
sMSMfaSettingsType_preferredMfa :: Lens.Lens' SMSMfaSettingsType (Prelude.Maybe Prelude.Bool)
sMSMfaSettingsType_preferredMfa :: (Maybe Bool -> f (Maybe Bool))
-> SMSMfaSettingsType -> f SMSMfaSettingsType
sMSMfaSettingsType_preferredMfa = (SMSMfaSettingsType -> Maybe Bool)
-> (SMSMfaSettingsType -> Maybe Bool -> SMSMfaSettingsType)
-> Lens
SMSMfaSettingsType SMSMfaSettingsType (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSMfaSettingsType' {Maybe Bool
preferredMfa :: Maybe Bool
$sel:preferredMfa:SMSMfaSettingsType' :: SMSMfaSettingsType -> Maybe Bool
preferredMfa} -> Maybe Bool
preferredMfa) (\s :: SMSMfaSettingsType
s@SMSMfaSettingsType' {} Maybe Bool
a -> SMSMfaSettingsType
s {$sel:preferredMfa:SMSMfaSettingsType' :: Maybe Bool
preferredMfa = Maybe Bool
a} :: SMSMfaSettingsType)
instance Prelude.Hashable SMSMfaSettingsType
instance Prelude.NFData SMSMfaSettingsType
instance Core.ToJSON SMSMfaSettingsType where
toJSON :: SMSMfaSettingsType -> Value
toJSON SMSMfaSettingsType' {Maybe Bool
preferredMfa :: Maybe Bool
enabled :: Maybe Bool
$sel:preferredMfa:SMSMfaSettingsType' :: SMSMfaSettingsType -> Maybe Bool
$sel:enabled:SMSMfaSettingsType' :: SMSMfaSettingsType -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Enabled" 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
enabled,
(Text
"PreferredMfa" 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
preferredMfa
]
)