{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SmsConfigurationType = SmsConfigurationType'
{
SmsConfigurationType -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
SmsConfigurationType -> Text
snsCallerArn :: Prelude.Text
}
deriving (SmsConfigurationType -> SmsConfigurationType -> Bool
(SmsConfigurationType -> SmsConfigurationType -> Bool)
-> (SmsConfigurationType -> SmsConfigurationType -> Bool)
-> Eq SmsConfigurationType
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]
(Int -> ReadS SmsConfigurationType)
-> ReadS [SmsConfigurationType]
-> ReadPrec SmsConfigurationType
-> ReadPrec [SmsConfigurationType]
-> Read 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
(Int -> SmsConfigurationType -> ShowS)
-> (SmsConfigurationType -> String)
-> ([SmsConfigurationType] -> ShowS)
-> Show SmsConfigurationType
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. SmsConfigurationType -> Rep SmsConfigurationType x)
-> (forall x. Rep SmsConfigurationType x -> SmsConfigurationType)
-> Generic SmsConfigurationType
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' :: Maybe Text -> Text -> SmsConfigurationType
SmsConfigurationType'
{ $sel:externalId:SmsConfigurationType' :: Maybe Text
externalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snsCallerArn:SmsConfigurationType' :: Text
snsCallerArn = Text
pSnsCallerArn_
}
smsConfigurationType_externalId :: Lens.Lens' SmsConfigurationType (Prelude.Maybe Prelude.Text)
smsConfigurationType_externalId :: (Maybe Text -> f (Maybe Text))
-> SmsConfigurationType -> f SmsConfigurationType
smsConfigurationType_externalId = (SmsConfigurationType -> Maybe Text)
-> (SmsConfigurationType -> Maybe Text -> SmsConfigurationType)
-> Lens
SmsConfigurationType SmsConfigurationType (Maybe Text) (Maybe Text)
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_snsCallerArn :: Lens.Lens' SmsConfigurationType Prelude.Text
smsConfigurationType_snsCallerArn :: (Text -> f Text) -> SmsConfigurationType -> f SmsConfigurationType
smsConfigurationType_snsCallerArn = (SmsConfigurationType -> Text)
-> (SmsConfigurationType -> Text -> SmsConfigurationType)
-> Lens SmsConfigurationType SmsConfigurationType Text Text
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 Core.FromJSON SmsConfigurationType where
parseJSON :: Value -> Parser SmsConfigurationType
parseJSON =
String
-> (Object -> Parser SmsConfigurationType)
-> Value
-> Parser SmsConfigurationType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SmsConfigurationType"
( \Object
x ->
Maybe Text -> Text -> SmsConfigurationType
SmsConfigurationType'
(Maybe Text -> Text -> SmsConfigurationType)
-> Parser (Maybe Text) -> Parser (Text -> SmsConfigurationType)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExternalId")
Parser (Text -> SmsConfigurationType)
-> Parser Text -> Parser SmsConfigurationType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SnsCallerArn")
)
instance Prelude.Hashable SmsConfigurationType
instance Prelude.NFData SmsConfigurationType
instance Core.ToJSON SmsConfigurationType where
toJSON :: SmsConfigurationType -> Value
toJSON SmsConfigurationType' {Maybe Text
Text
snsCallerArn :: Text
externalId :: Maybe Text
$sel:snsCallerArn:SmsConfigurationType' :: SmsConfigurationType -> Text
$sel:externalId:SmsConfigurationType' :: SmsConfigurationType -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ExternalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
externalId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SnsCallerArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
snsCallerArn)
]
)