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