{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SMSChannelRequest = SMSChannelRequest'
{
SMSChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
SMSChannelRequest -> Maybe Text
senderId :: Prelude.Maybe Prelude.Text,
SMSChannelRequest -> Maybe Text
shortCode :: Prelude.Maybe Prelude.Text
}
deriving (SMSChannelRequest -> SMSChannelRequest -> Bool
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]
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
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. 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'
{ $sel:enabled:SMSChannelRequest' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
$sel:senderId:SMSChannelRequest' :: Maybe Text
senderId = forall a. Maybe a
Prelude.Nothing,
$sel:shortCode:SMSChannelRequest' :: Maybe Text
shortCode = forall a. Maybe a
Prelude.Nothing
}
sMSChannelRequest_enabled :: Lens.Lens' SMSChannelRequest (Prelude.Maybe Prelude.Bool)
sMSChannelRequest_enabled :: Lens' SMSChannelRequest (Maybe Bool)
sMSChannelRequest_enabled = 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 :: Lens' SMSChannelRequest (Maybe Text)
sMSChannelRequest_senderId = 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)
sMSChannelRequest_shortCode :: Lens.Lens' SMSChannelRequest (Prelude.Maybe Prelude.Text)
sMSChannelRequest_shortCode :: Lens' SMSChannelRequest (Maybe Text)
sMSChannelRequest_shortCode = 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)
instance Prelude.Hashable SMSChannelRequest where
hashWithSalt :: Int -> SMSChannelRequest -> Int
hashWithSalt Int
_salt SMSChannelRequest' {Maybe Bool
Maybe Text
shortCode :: Maybe Text
senderId :: Maybe Text
enabled :: Maybe Bool
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
senderId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shortCode
instance Prelude.NFData SMSChannelRequest where
rnf :: SMSChannelRequest -> ()
rnf SMSChannelRequest' {Maybe Bool
Maybe Text
shortCode :: Maybe Text
senderId :: Maybe Text
enabled :: Maybe Bool
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
senderId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shortCode
instance Data.ToJSON SMSChannelRequest where
toJSON :: SMSChannelRequest -> Value
toJSON SMSChannelRequest' {Maybe Bool
Maybe Text
shortCode :: Maybe Text
senderId :: Maybe Text
enabled :: Maybe Bool
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Enabled" 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 Bool
enabled,
(Key
"SenderId" 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
senderId,
(Key
"ShortCode" 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
shortCode
]
)