{-# 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.SendUsersMessageRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.DirectMessageConfiguration
import Amazonka.Pinpoint.Types.EndpointSendConfiguration
import Amazonka.Pinpoint.Types.TemplateConfiguration
import qualified Amazonka.Prelude as Prelude
data SendUsersMessageRequest = SendUsersMessageRequest'
{
SendUsersMessageRequest -> Maybe Text
traceId :: Prelude.Maybe Prelude.Text,
SendUsersMessageRequest -> Maybe (HashMap Text Text)
context :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
SendUsersMessageRequest -> Maybe TemplateConfiguration
templateConfiguration :: Prelude.Maybe TemplateConfiguration,
SendUsersMessageRequest -> DirectMessageConfiguration
messageConfiguration :: DirectMessageConfiguration,
SendUsersMessageRequest -> HashMap Text EndpointSendConfiguration
users :: Prelude.HashMap Prelude.Text EndpointSendConfiguration
}
deriving (SendUsersMessageRequest -> SendUsersMessageRequest -> Bool
(SendUsersMessageRequest -> SendUsersMessageRequest -> Bool)
-> (SendUsersMessageRequest -> SendUsersMessageRequest -> Bool)
-> Eq SendUsersMessageRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendUsersMessageRequest -> SendUsersMessageRequest -> Bool
$c/= :: SendUsersMessageRequest -> SendUsersMessageRequest -> Bool
== :: SendUsersMessageRequest -> SendUsersMessageRequest -> Bool
$c== :: SendUsersMessageRequest -> SendUsersMessageRequest -> Bool
Prelude.Eq, ReadPrec [SendUsersMessageRequest]
ReadPrec SendUsersMessageRequest
Int -> ReadS SendUsersMessageRequest
ReadS [SendUsersMessageRequest]
(Int -> ReadS SendUsersMessageRequest)
-> ReadS [SendUsersMessageRequest]
-> ReadPrec SendUsersMessageRequest
-> ReadPrec [SendUsersMessageRequest]
-> Read SendUsersMessageRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendUsersMessageRequest]
$creadListPrec :: ReadPrec [SendUsersMessageRequest]
readPrec :: ReadPrec SendUsersMessageRequest
$creadPrec :: ReadPrec SendUsersMessageRequest
readList :: ReadS [SendUsersMessageRequest]
$creadList :: ReadS [SendUsersMessageRequest]
readsPrec :: Int -> ReadS SendUsersMessageRequest
$creadsPrec :: Int -> ReadS SendUsersMessageRequest
Prelude.Read, Int -> SendUsersMessageRequest -> ShowS
[SendUsersMessageRequest] -> ShowS
SendUsersMessageRequest -> String
(Int -> SendUsersMessageRequest -> ShowS)
-> (SendUsersMessageRequest -> String)
-> ([SendUsersMessageRequest] -> ShowS)
-> Show SendUsersMessageRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendUsersMessageRequest] -> ShowS
$cshowList :: [SendUsersMessageRequest] -> ShowS
show :: SendUsersMessageRequest -> String
$cshow :: SendUsersMessageRequest -> String
showsPrec :: Int -> SendUsersMessageRequest -> ShowS
$cshowsPrec :: Int -> SendUsersMessageRequest -> ShowS
Prelude.Show, (forall x.
SendUsersMessageRequest -> Rep SendUsersMessageRequest x)
-> (forall x.
Rep SendUsersMessageRequest x -> SendUsersMessageRequest)
-> Generic SendUsersMessageRequest
forall x. Rep SendUsersMessageRequest x -> SendUsersMessageRequest
forall x. SendUsersMessageRequest -> Rep SendUsersMessageRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendUsersMessageRequest x -> SendUsersMessageRequest
$cfrom :: forall x. SendUsersMessageRequest -> Rep SendUsersMessageRequest x
Prelude.Generic)
newSendUsersMessageRequest ::
DirectMessageConfiguration ->
SendUsersMessageRequest
newSendUsersMessageRequest :: DirectMessageConfiguration -> SendUsersMessageRequest
newSendUsersMessageRequest DirectMessageConfiguration
pMessageConfiguration_ =
SendUsersMessageRequest' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe TemplateConfiguration
-> DirectMessageConfiguration
-> HashMap Text EndpointSendConfiguration
-> SendUsersMessageRequest
SendUsersMessageRequest'
{ $sel:traceId:SendUsersMessageRequest' :: Maybe Text
traceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:context:SendUsersMessageRequest' :: Maybe (HashMap Text Text)
context = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:templateConfiguration:SendUsersMessageRequest' :: Maybe TemplateConfiguration
templateConfiguration = Maybe TemplateConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:messageConfiguration:SendUsersMessageRequest' :: DirectMessageConfiguration
messageConfiguration = DirectMessageConfiguration
pMessageConfiguration_,
$sel:users:SendUsersMessageRequest' :: HashMap Text EndpointSendConfiguration
users = HashMap Text EndpointSendConfiguration
forall a. Monoid a => a
Prelude.mempty
}
sendUsersMessageRequest_traceId :: Lens.Lens' SendUsersMessageRequest (Prelude.Maybe Prelude.Text)
sendUsersMessageRequest_traceId :: (Maybe Text -> f (Maybe Text))
-> SendUsersMessageRequest -> f SendUsersMessageRequest
sendUsersMessageRequest_traceId = (SendUsersMessageRequest -> Maybe Text)
-> (SendUsersMessageRequest
-> Maybe Text -> SendUsersMessageRequest)
-> Lens
SendUsersMessageRequest
SendUsersMessageRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendUsersMessageRequest' {Maybe Text
traceId :: Maybe Text
$sel:traceId:SendUsersMessageRequest' :: SendUsersMessageRequest -> Maybe Text
traceId} -> Maybe Text
traceId) (\s :: SendUsersMessageRequest
s@SendUsersMessageRequest' {} Maybe Text
a -> SendUsersMessageRequest
s {$sel:traceId:SendUsersMessageRequest' :: Maybe Text
traceId = Maybe Text
a} :: SendUsersMessageRequest)
sendUsersMessageRequest_context :: Lens.Lens' SendUsersMessageRequest (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
sendUsersMessageRequest_context :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SendUsersMessageRequest -> f SendUsersMessageRequest
sendUsersMessageRequest_context = (SendUsersMessageRequest -> Maybe (HashMap Text Text))
-> (SendUsersMessageRequest
-> Maybe (HashMap Text Text) -> SendUsersMessageRequest)
-> Lens
SendUsersMessageRequest
SendUsersMessageRequest
(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 (\SendUsersMessageRequest' {Maybe (HashMap Text Text)
context :: Maybe (HashMap Text Text)
$sel:context:SendUsersMessageRequest' :: SendUsersMessageRequest -> Maybe (HashMap Text Text)
context} -> Maybe (HashMap Text Text)
context) (\s :: SendUsersMessageRequest
s@SendUsersMessageRequest' {} Maybe (HashMap Text Text)
a -> SendUsersMessageRequest
s {$sel:context:SendUsersMessageRequest' :: Maybe (HashMap Text Text)
context = Maybe (HashMap Text Text)
a} :: SendUsersMessageRequest) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SendUsersMessageRequest -> f SendUsersMessageRequest)
-> ((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)))
-> SendUsersMessageRequest
-> f SendUsersMessageRequest
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
sendUsersMessageRequest_templateConfiguration :: Lens.Lens' SendUsersMessageRequest (Prelude.Maybe TemplateConfiguration)
sendUsersMessageRequest_templateConfiguration :: (Maybe TemplateConfiguration -> f (Maybe TemplateConfiguration))
-> SendUsersMessageRequest -> f SendUsersMessageRequest
sendUsersMessageRequest_templateConfiguration = (SendUsersMessageRequest -> Maybe TemplateConfiguration)
-> (SendUsersMessageRequest
-> Maybe TemplateConfiguration -> SendUsersMessageRequest)
-> Lens
SendUsersMessageRequest
SendUsersMessageRequest
(Maybe TemplateConfiguration)
(Maybe TemplateConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendUsersMessageRequest' {Maybe TemplateConfiguration
templateConfiguration :: Maybe TemplateConfiguration
$sel:templateConfiguration:SendUsersMessageRequest' :: SendUsersMessageRequest -> Maybe TemplateConfiguration
templateConfiguration} -> Maybe TemplateConfiguration
templateConfiguration) (\s :: SendUsersMessageRequest
s@SendUsersMessageRequest' {} Maybe TemplateConfiguration
a -> SendUsersMessageRequest
s {$sel:templateConfiguration:SendUsersMessageRequest' :: Maybe TemplateConfiguration
templateConfiguration = Maybe TemplateConfiguration
a} :: SendUsersMessageRequest)
sendUsersMessageRequest_messageConfiguration :: Lens.Lens' SendUsersMessageRequest DirectMessageConfiguration
sendUsersMessageRequest_messageConfiguration :: (DirectMessageConfiguration -> f DirectMessageConfiguration)
-> SendUsersMessageRequest -> f SendUsersMessageRequest
sendUsersMessageRequest_messageConfiguration = (SendUsersMessageRequest -> DirectMessageConfiguration)
-> (SendUsersMessageRequest
-> DirectMessageConfiguration -> SendUsersMessageRequest)
-> Lens
SendUsersMessageRequest
SendUsersMessageRequest
DirectMessageConfiguration
DirectMessageConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendUsersMessageRequest' {DirectMessageConfiguration
messageConfiguration :: DirectMessageConfiguration
$sel:messageConfiguration:SendUsersMessageRequest' :: SendUsersMessageRequest -> DirectMessageConfiguration
messageConfiguration} -> DirectMessageConfiguration
messageConfiguration) (\s :: SendUsersMessageRequest
s@SendUsersMessageRequest' {} DirectMessageConfiguration
a -> SendUsersMessageRequest
s {$sel:messageConfiguration:SendUsersMessageRequest' :: DirectMessageConfiguration
messageConfiguration = DirectMessageConfiguration
a} :: SendUsersMessageRequest)
sendUsersMessageRequest_users :: Lens.Lens' SendUsersMessageRequest (Prelude.HashMap Prelude.Text EndpointSendConfiguration)
sendUsersMessageRequest_users :: (HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration))
-> SendUsersMessageRequest -> f SendUsersMessageRequest
sendUsersMessageRequest_users = (SendUsersMessageRequest -> HashMap Text EndpointSendConfiguration)
-> (SendUsersMessageRequest
-> HashMap Text EndpointSendConfiguration
-> SendUsersMessageRequest)
-> Lens
SendUsersMessageRequest
SendUsersMessageRequest
(HashMap Text EndpointSendConfiguration)
(HashMap Text EndpointSendConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendUsersMessageRequest' {HashMap Text EndpointSendConfiguration
users :: HashMap Text EndpointSendConfiguration
$sel:users:SendUsersMessageRequest' :: SendUsersMessageRequest -> HashMap Text EndpointSendConfiguration
users} -> HashMap Text EndpointSendConfiguration
users) (\s :: SendUsersMessageRequest
s@SendUsersMessageRequest' {} HashMap Text EndpointSendConfiguration
a -> SendUsersMessageRequest
s {$sel:users:SendUsersMessageRequest' :: HashMap Text EndpointSendConfiguration
users = HashMap Text EndpointSendConfiguration
a} :: SendUsersMessageRequest) ((HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration))
-> SendUsersMessageRequest -> f SendUsersMessageRequest)
-> ((HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration))
-> HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration))
-> (HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration))
-> SendUsersMessageRequest
-> f SendUsersMessageRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration))
-> HashMap Text EndpointSendConfiguration
-> f (HashMap Text EndpointSendConfiguration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable SendUsersMessageRequest
instance Prelude.NFData SendUsersMessageRequest
instance Core.ToJSON SendUsersMessageRequest where
toJSON :: SendUsersMessageRequest -> Value
toJSON SendUsersMessageRequest' {Maybe Text
Maybe (HashMap Text Text)
Maybe TemplateConfiguration
HashMap Text EndpointSendConfiguration
DirectMessageConfiguration
users :: HashMap Text EndpointSendConfiguration
messageConfiguration :: DirectMessageConfiguration
templateConfiguration :: Maybe TemplateConfiguration
context :: Maybe (HashMap Text Text)
traceId :: Maybe Text
$sel:users:SendUsersMessageRequest' :: SendUsersMessageRequest -> HashMap Text EndpointSendConfiguration
$sel:messageConfiguration:SendUsersMessageRequest' :: SendUsersMessageRequest -> DirectMessageConfiguration
$sel:templateConfiguration:SendUsersMessageRequest' :: SendUsersMessageRequest -> Maybe TemplateConfiguration
$sel:context:SendUsersMessageRequest' :: SendUsersMessageRequest -> Maybe (HashMap Text Text)
$sel:traceId:SendUsersMessageRequest' :: SendUsersMessageRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TraceId" 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
traceId,
(Text
"Context" 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)
context,
(Text
"TemplateConfiguration" Text -> TemplateConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TemplateConfiguration -> Pair)
-> Maybe TemplateConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TemplateConfiguration
templateConfiguration,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"MessageConfiguration"
Text -> DirectMessageConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DirectMessageConfiguration
messageConfiguration
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Users" Text -> HashMap Text EndpointSendConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text EndpointSendConfiguration
users)
]
)