{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SMSTemplateRequest = SMSTemplateRequest'
{
SMSTemplateRequest -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe Text
templateDescription :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe Text
defaultSubstitutions :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe Text
recommenderId :: Prelude.Maybe Prelude.Text,
SMSTemplateRequest -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (SMSTemplateRequest -> SMSTemplateRequest -> Bool
(SMSTemplateRequest -> SMSTemplateRequest -> Bool)
-> (SMSTemplateRequest -> SMSTemplateRequest -> Bool)
-> Eq SMSTemplateRequest
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]
(Int -> ReadS SMSTemplateRequest)
-> ReadS [SMSTemplateRequest]
-> ReadPrec SMSTemplateRequest
-> ReadPrec [SMSTemplateRequest]
-> Read 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
(Int -> SMSTemplateRequest -> ShowS)
-> (SMSTemplateRequest -> String)
-> ([SMSTemplateRequest] -> ShowS)
-> Show SMSTemplateRequest
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. SMSTemplateRequest -> Rep SMSTemplateRequest x)
-> (forall x. Rep SMSTemplateRequest x -> SMSTemplateRequest)
-> Generic SMSTemplateRequest
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> SMSTemplateRequest
SMSTemplateRequest'
{ $sel:body:SMSTemplateRequest' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:templateDescription:SMSTemplateRequest' :: Maybe Text
templateDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultSubstitutions:SMSTemplateRequest' :: Maybe Text
defaultSubstitutions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:recommenderId:SMSTemplateRequest' :: Maybe Text
recommenderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:SMSTemplateRequest' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
sMSTemplateRequest_body :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_body :: (Maybe Text -> f (Maybe Text))
-> SMSTemplateRequest -> f SMSTemplateRequest
sMSTemplateRequest_body = (SMSTemplateRequest -> Maybe Text)
-> (SMSTemplateRequest -> Maybe Text -> SMSTemplateRequest)
-> Lens
SMSTemplateRequest SMSTemplateRequest (Maybe Text) (Maybe Text)
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_templateDescription :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_templateDescription :: (Maybe Text -> f (Maybe Text))
-> SMSTemplateRequest -> f SMSTemplateRequest
sMSTemplateRequest_templateDescription = (SMSTemplateRequest -> Maybe Text)
-> (SMSTemplateRequest -> Maybe Text -> SMSTemplateRequest)
-> Lens
SMSTemplateRequest SMSTemplateRequest (Maybe Text) (Maybe Text)
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_defaultSubstitutions :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe Prelude.Text)
sMSTemplateRequest_defaultSubstitutions :: (Maybe Text -> f (Maybe Text))
-> SMSTemplateRequest -> f SMSTemplateRequest
sMSTemplateRequest_defaultSubstitutions = (SMSTemplateRequest -> Maybe Text)
-> (SMSTemplateRequest -> Maybe Text -> SMSTemplateRequest)
-> Lens
SMSTemplateRequest SMSTemplateRequest (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SMSTemplateRequest -> f SMSTemplateRequest
sMSTemplateRequest_recommenderId = (SMSTemplateRequest -> Maybe Text)
-> (SMSTemplateRequest -> Maybe Text -> SMSTemplateRequest)
-> Lens
SMSTemplateRequest SMSTemplateRequest (Maybe Text) (Maybe Text)
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_tags :: Lens.Lens' SMSTemplateRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sMSTemplateRequest_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SMSTemplateRequest -> f SMSTemplateRequest
sMSTemplateRequest_tags = (SMSTemplateRequest -> Maybe (HashMap Text Text))
-> (SMSTemplateRequest
-> Maybe (HashMap Text Text) -> SMSTemplateRequest)
-> Lens
SMSTemplateRequest
SMSTemplateRequest
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SMSTemplateRequest -> f SMSTemplateRequest)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SMSTemplateRequest
-> f SMSTemplateRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable SMSTemplateRequest
instance Prelude.NFData SMSTemplateRequest
instance Core.ToJSON SMSTemplateRequest where
toJSON :: SMSTemplateRequest -> Value
toJSON SMSTemplateRequest' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
recommenderId :: Maybe Text
defaultSubstitutions :: Maybe Text
templateDescription :: Maybe Text
body :: Maybe Text
$sel:tags:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe (HashMap Text Text)
$sel:recommenderId:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:defaultSubstitutions:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:templateDescription:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
$sel:body:SMSTemplateRequest' :: SMSTemplateRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Body" 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
body,
(Text
"TemplateDescription" 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
templateDescription,
(Text
"DefaultSubstitutions" 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
defaultSubstitutions,
(Text
"RecommenderId" 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
recommenderId,
(Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
]
)