{-# 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.SMSTemplateRequest 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 SMSTemplateRequest = SMSTemplateRequest'
{
SMSTemplateRequest -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe Text
recommenderId :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe Text
templateDescription :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (SMSTemplateRequest -> SMSTemplateRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SMSTemplateRequest -> SMSTemplateRequest -> Bool
$c/= :: SMSTemplateRequest -> SMSTemplateRequest -> Bool
== :: SMSTemplateRequest -> SMSTemplateRequest -> Bool
$c== :: SMSTemplateRequest -> SMSTemplateRequest -> Bool
Prelude.Eq, ReadPrec [SMSTemplateRequest]
ReadPrec SMSTemplateRequest
Int -> ReadS SMSTemplateRequest
ReadS [SMSTemplateRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SMSTemplateRequest]
$creadListPrec :: ReadPrec [SMSTemplateRequest]
readPrec :: ReadPrec SMSTemplateRequest
$creadPrec :: ReadPrec SMSTemplateRequest
readList :: ReadS [SMSTemplateRequest]
$creadList :: ReadS [SMSTemplateRequest]
readsPrec :: Int -> ReadS SMSTemplateRequest
$creadsPrec :: Int -> ReadS SMSTemplateRequest
Prelude.Read, Int -> SMSTemplateRequest -> ShowS
[SMSTemplateRequest] -> ShowS
SMSTemplateRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SMSTemplateRequest] -> ShowS
$cshowList :: [SMSTemplateRequest] -> ShowS
show :: SMSTemplateRequest -> String
$cshow :: SMSTemplateRequest -> String
showsPrec :: Int -> SMSTemplateRequest -> ShowS
$cshowsPrec :: Int -> SMSTemplateRequest -> ShowS
Prelude.Show, forall x. Rep SMSTemplateRequest x -> SMSTemplateRequest
forall x. SMSTemplateRequest -> Rep SMSTemplateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SMSTemplateRequest x -> SMSTemplateRequest
$cfrom :: forall x. SMSTemplateRequest -> Rep SMSTemplateRequest x
Prelude.Generic)
newSMSTemplateRequest ::
SMSTemplateRequest
newSMSTemplateRequest :: SMSTemplateRequest
newSMSTemplateRequest =
SMSTemplateRequest'
{ $sel:body:SMSTemplateRequest' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
$sel:defaultSubstitutions:SMSTemplateRequest' :: Maybe Text
defaultSubstitutions = forall a. Maybe a
Prelude.Nothing,
$sel:recommenderId:SMSTemplateRequest' :: Maybe Text
recommenderId = forall a. Maybe a
Prelude.Nothing,
$sel:templateDescription:SMSTemplateRequest' :: Maybe Text
templateDescription = forall a. Maybe a
Prelude.Nothing,
$sel:tags:SMSTemplateRequest' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
}
sMSTemplateRequest_body :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_body :: Lens' SMSTemplateRequest (Maybe Text)
sMSTemplateRequest_body = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateRequest' {Maybe Text
body :: Maybe Text
$sel:body:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
body} -> Maybe Text
body) (\s :: SMSTemplateRequest
s@SMSTemplateRequest' {} Maybe Text
a -> SMSTemplateRequest
s {$sel:body:SMSTemplateRequest' :: Maybe Text
body = Maybe Text
a} :: SMSTemplateRequest)
sMSTemplateRequest_defaultSubstitutions :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_defaultSubstitutions :: Lens' SMSTemplateRequest (Maybe Text)
sMSTemplateRequest_defaultSubstitutions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateRequest' {Maybe Text
defaultSubstitutions :: Maybe Text
$sel:defaultSubstitutions:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
defaultSubstitutions} -> Maybe Text
defaultSubstitutions) (\s :: SMSTemplateRequest
s@SMSTemplateRequest' {} Maybe Text
a -> SMSTemplateRequest
s {$sel:defaultSubstitutions:SMSTemplateRequest' :: Maybe Text
defaultSubstitutions = Maybe Text
a} :: SMSTemplateRequest)
sMSTemplateRequest_recommenderId :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_recommenderId :: Lens' SMSTemplateRequest (Maybe Text)
sMSTemplateRequest_recommenderId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateRequest' {Maybe Text
recommenderId :: Maybe Text
$sel:recommenderId:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
recommenderId} -> Maybe Text
recommenderId) (\s :: SMSTemplateRequest
s@SMSTemplateRequest' {} Maybe Text
a -> SMSTemplateRequest
s {$sel:recommenderId:SMSTemplateRequest' :: Maybe Text
recommenderId = Maybe Text
a} :: SMSTemplateRequest)
sMSTemplateRequest_templateDescription :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_templateDescription :: Lens' SMSTemplateRequest (Maybe Text)
sMSTemplateRequest_templateDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateRequest' {Maybe Text
templateDescription :: Maybe Text
$sel:templateDescription:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
templateDescription} -> Maybe Text
templateDescription) (\s :: SMSTemplateRequest
s@SMSTemplateRequest' {} Maybe Text
a -> SMSTemplateRequest
s {$sel:templateDescription:SMSTemplateRequest' :: Maybe Text
templateDescription = Maybe Text
a} :: SMSTemplateRequest)
sMSTemplateRequest_tags :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sMSTemplateRequest_tags :: Lens' SMSTemplateRequest (Maybe (HashMap Text Text))
sMSTemplateRequest_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSTemplateRequest' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SMSTemplateRequest
s@SMSTemplateRequest' {} Maybe (HashMap Text Text)
a -> SMSTemplateRequest
s {$sel:tags:SMSTemplateRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SMSTemplateRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable SMSTemplateRequest where
hashWithSalt :: Int -> SMSTemplateRequest -> Int
hashWithSalt Int
_salt SMSTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
templateDescription :: Maybe Text
recommenderId :: Maybe Text
defaultSubstitutions :: Maybe Text
body :: Maybe Text
$sel:tags:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe (HashMap Text Text)
$sel:templateDescription:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:recommenderId:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:defaultSubstitutions:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:body:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
body
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultSubstitutions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommenderId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
instance Prelude.NFData SMSTemplateRequest where
rnf :: SMSTemplateRequest -> ()
rnf SMSTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
templateDescription :: Maybe Text
recommenderId :: Maybe Text
defaultSubstitutions :: Maybe Text
body :: Maybe Text
$sel:tags:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe (HashMap Text Text)
$sel:templateDescription:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:recommenderId:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:defaultSubstitutions:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:body:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
body
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultSubstitutions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommenderId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
instance Data.ToJSON SMSTemplateRequest where
toJSON :: SMSTemplateRequest -> Value
toJSON SMSTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
templateDescription :: Maybe Text
recommenderId :: Maybe Text
defaultSubstitutions :: Maybe Text
body :: Maybe Text
$sel:tags:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe (HashMap Text Text)
$sel:templateDescription:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:recommenderId:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:defaultSubstitutions:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:body:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Body" 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
body,
(Key
"DefaultSubstitutions" 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
defaultSubstitutions,
(Key
"RecommenderId" 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
recommenderId,
(Key
"TemplateDescription" 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
templateDescription,
(Key
"tags" 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 (HashMap Text Text)
tags
]
)