{-# 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.SmsConfigurationType where
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 SmsConfigurationType = SmsConfigurationType'
{
SmsConfigurationType -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
SmsConfigurationType -> Maybe Text
snsRegion :: Prelude.Maybe Prelude.Text,
SmsConfigurationType -> Text
snsCallerArn :: Prelude.Text
}
deriving (SmsConfigurationType -> SmsConfigurationType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SmsConfigurationType -> SmsConfigurationType -> Bool
$c/= :: SmsConfigurationType -> SmsConfigurationType -> Bool
== :: SmsConfigurationType -> SmsConfigurationType -> Bool
$c== :: SmsConfigurationType -> SmsConfigurationType -> Bool
Prelude.Eq, ReadPrec [SmsConfigurationType]
ReadPrec SmsConfigurationType
Int -> ReadS SmsConfigurationType
ReadS [SmsConfigurationType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SmsConfigurationType]
$creadListPrec :: ReadPrec [SmsConfigurationType]
readPrec :: ReadPrec SmsConfigurationType
$creadPrec :: ReadPrec SmsConfigurationType
readList :: ReadS [SmsConfigurationType]
$creadList :: ReadS [SmsConfigurationType]
readsPrec :: Int -> ReadS SmsConfigurationType
$creadsPrec :: Int -> ReadS SmsConfigurationType
Prelude.Read, Int -> SmsConfigurationType -> ShowS
[SmsConfigurationType] -> ShowS
SmsConfigurationType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SmsConfigurationType] -> ShowS
$cshowList :: [SmsConfigurationType] -> ShowS
show :: SmsConfigurationType -> String
$cshow :: SmsConfigurationType -> String
showsPrec :: Int -> SmsConfigurationType -> ShowS
$cshowsPrec :: Int -> SmsConfigurationType -> ShowS
Prelude.Show, forall x. Rep SmsConfigurationType x -> SmsConfigurationType
forall x. SmsConfigurationType -> Rep SmsConfigurationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SmsConfigurationType x -> SmsConfigurationType
$cfrom :: forall x. SmsConfigurationType -> Rep SmsConfigurationType x
Prelude.Generic)
newSmsConfigurationType ::
Prelude.Text ->
SmsConfigurationType
newSmsConfigurationType :: Text -> SmsConfigurationType
newSmsConfigurationType Text
pSnsCallerArn_ =
SmsConfigurationType'
{ $sel:externalId:SmsConfigurationType' :: Maybe Text
externalId = forall a. Maybe a
Prelude.Nothing,
$sel:snsRegion:SmsConfigurationType' :: Maybe Text
snsRegion = forall a. Maybe a
Prelude.Nothing,
$sel:snsCallerArn:SmsConfigurationType' :: Text
snsCallerArn = Text
pSnsCallerArn_
}
smsConfigurationType_externalId :: Lens.Lens' SmsConfigurationType (Prelude.Maybe Prelude.Text)
smsConfigurationType_externalId :: Lens' SmsConfigurationType (Maybe Text)
smsConfigurationType_externalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmsConfigurationType' {Maybe Text
externalId :: Maybe Text
$sel:externalId:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: SmsConfigurationType
s@SmsConfigurationType' {} Maybe Text
a -> SmsConfigurationType
s {$sel:externalId:SmsConfigurationType' :: Maybe Text
externalId = Maybe Text
a} :: SmsConfigurationType)
smsConfigurationType_snsRegion :: Lens.Lens' SmsConfigurationType (Prelude.Maybe Prelude.Text)
smsConfigurationType_snsRegion :: Lens' SmsConfigurationType (Maybe Text)
smsConfigurationType_snsRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmsConfigurationType' {Maybe Text
snsRegion :: Maybe Text
$sel:snsRegion:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
snsRegion} -> Maybe Text
snsRegion) (\s :: SmsConfigurationType
s@SmsConfigurationType' {} Maybe Text
a -> SmsConfigurationType
s {$sel:snsRegion:SmsConfigurationType' :: Maybe Text
snsRegion = Maybe Text
a} :: SmsConfigurationType)
smsConfigurationType_snsCallerArn :: Lens.Lens' SmsConfigurationType Prelude.Text
smsConfigurationType_snsCallerArn :: Lens' SmsConfigurationType Text
smsConfigurationType_snsCallerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SmsConfigurationType' {Text
snsCallerArn :: Text
$sel:snsCallerArn:SmsConfigurationType' :: SmsConfigurationType -> Text
snsCallerArn} -> Text
snsCallerArn) (\s :: SmsConfigurationType
s@SmsConfigurationType' {} Text
a -> SmsConfigurationType
s {$sel:snsCallerArn:SmsConfigurationType' :: Text
snsCallerArn = Text
a} :: SmsConfigurationType)
instance Data.FromJSON SmsConfigurationType where
parseJSON :: Value -> Parser SmsConfigurationType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SmsConfigurationType"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> SmsConfigurationType
SmsConfigurationType'
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
"ExternalId")
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
"SnsRegion")
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
"SnsCallerArn")
)
instance Prelude.Hashable SmsConfigurationType where
hashWithSalt :: Int -> SmsConfigurationType -> Int
hashWithSalt Int
_salt SmsConfigurationType' {Maybe Text
Text
snsCallerArn :: Text
snsRegion :: Maybe Text
externalId :: Maybe Text
$sel:snsCallerArn:SmsConfigurationType' :: SmsConfigurationType -> Text
$sel:snsRegion:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
$sel:externalId:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsRegion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snsCallerArn
instance Prelude.NFData SmsConfigurationType where
rnf :: SmsConfigurationType -> ()
rnf SmsConfigurationType' {Maybe Text
Text
snsCallerArn :: Text
snsRegion :: Maybe Text
externalId :: Maybe Text
$sel:snsCallerArn:SmsConfigurationType' :: SmsConfigurationType -> Text
$sel:snsRegion:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
$sel:externalId:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsRegion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snsCallerArn
instance Data.ToJSON SmsConfigurationType where
toJSON :: SmsConfigurationType -> Value
toJSON SmsConfigurationType' {Maybe Text
Text
snsCallerArn :: Text
snsRegion :: Maybe Text
externalId :: Maybe Text
$sel:snsCallerArn:SmsConfigurationType' :: SmsConfigurationType -> Text
$sel:snsRegion:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
$sel:externalId:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ExternalId" 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
externalId,
(Key
"SnsRegion" 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
snsRegion,
forall a. a -> Maybe a
Prelude.Just (Key
"SnsCallerArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
snsCallerArn)
]
)