{-# 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.SES.Types.BulkEmailDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.Destination
import Amazonka.SES.Types.MessageTag
data BulkEmailDestination = BulkEmailDestination'
{
BulkEmailDestination -> Maybe Text
replacementTemplateData :: Prelude.Maybe Prelude.Text,
BulkEmailDestination -> Maybe [MessageTag]
replacementTags :: Prelude.Maybe [MessageTag],
BulkEmailDestination -> Destination
destination :: Destination
}
deriving (BulkEmailDestination -> BulkEmailDestination -> Bool
(BulkEmailDestination -> BulkEmailDestination -> Bool)
-> (BulkEmailDestination -> BulkEmailDestination -> Bool)
-> Eq BulkEmailDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BulkEmailDestination -> BulkEmailDestination -> Bool
$c/= :: BulkEmailDestination -> BulkEmailDestination -> Bool
== :: BulkEmailDestination -> BulkEmailDestination -> Bool
$c== :: BulkEmailDestination -> BulkEmailDestination -> Bool
Prelude.Eq, ReadPrec [BulkEmailDestination]
ReadPrec BulkEmailDestination
Int -> ReadS BulkEmailDestination
ReadS [BulkEmailDestination]
(Int -> ReadS BulkEmailDestination)
-> ReadS [BulkEmailDestination]
-> ReadPrec BulkEmailDestination
-> ReadPrec [BulkEmailDestination]
-> Read BulkEmailDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BulkEmailDestination]
$creadListPrec :: ReadPrec [BulkEmailDestination]
readPrec :: ReadPrec BulkEmailDestination
$creadPrec :: ReadPrec BulkEmailDestination
readList :: ReadS [BulkEmailDestination]
$creadList :: ReadS [BulkEmailDestination]
readsPrec :: Int -> ReadS BulkEmailDestination
$creadsPrec :: Int -> ReadS BulkEmailDestination
Prelude.Read, Int -> BulkEmailDestination -> ShowS
[BulkEmailDestination] -> ShowS
BulkEmailDestination -> String
(Int -> BulkEmailDestination -> ShowS)
-> (BulkEmailDestination -> String)
-> ([BulkEmailDestination] -> ShowS)
-> Show BulkEmailDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BulkEmailDestination] -> ShowS
$cshowList :: [BulkEmailDestination] -> ShowS
show :: BulkEmailDestination -> String
$cshow :: BulkEmailDestination -> String
showsPrec :: Int -> BulkEmailDestination -> ShowS
$cshowsPrec :: Int -> BulkEmailDestination -> ShowS
Prelude.Show, (forall x. BulkEmailDestination -> Rep BulkEmailDestination x)
-> (forall x. Rep BulkEmailDestination x -> BulkEmailDestination)
-> Generic BulkEmailDestination
forall x. Rep BulkEmailDestination x -> BulkEmailDestination
forall x. BulkEmailDestination -> Rep BulkEmailDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BulkEmailDestination x -> BulkEmailDestination
$cfrom :: forall x. BulkEmailDestination -> Rep BulkEmailDestination x
Prelude.Generic)
newBulkEmailDestination ::
Destination ->
BulkEmailDestination
newBulkEmailDestination :: Destination -> BulkEmailDestination
newBulkEmailDestination Destination
pDestination_ =
BulkEmailDestination' :: Maybe Text
-> Maybe [MessageTag] -> Destination -> BulkEmailDestination
BulkEmailDestination'
{ $sel:replacementTemplateData:BulkEmailDestination' :: Maybe Text
replacementTemplateData =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:replacementTags:BulkEmailDestination' :: Maybe [MessageTag]
replacementTags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
$sel:destination:BulkEmailDestination' :: Destination
destination = Destination
pDestination_
}
bulkEmailDestination_replacementTemplateData :: Lens.Lens' BulkEmailDestination (Prelude.Maybe Prelude.Text)
bulkEmailDestination_replacementTemplateData :: (Maybe Text -> f (Maybe Text))
-> BulkEmailDestination -> f BulkEmailDestination
bulkEmailDestination_replacementTemplateData = (BulkEmailDestination -> Maybe Text)
-> (BulkEmailDestination -> Maybe Text -> BulkEmailDestination)
-> Lens
BulkEmailDestination BulkEmailDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailDestination' {Maybe Text
replacementTemplateData :: Maybe Text
$sel:replacementTemplateData:BulkEmailDestination' :: BulkEmailDestination -> Maybe Text
replacementTemplateData} -> Maybe Text
replacementTemplateData) (\s :: BulkEmailDestination
s@BulkEmailDestination' {} Maybe Text
a -> BulkEmailDestination
s {$sel:replacementTemplateData:BulkEmailDestination' :: Maybe Text
replacementTemplateData = Maybe Text
a} :: BulkEmailDestination)
bulkEmailDestination_replacementTags :: Lens.Lens' BulkEmailDestination (Prelude.Maybe [MessageTag])
bulkEmailDestination_replacementTags :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> BulkEmailDestination -> f BulkEmailDestination
bulkEmailDestination_replacementTags = (BulkEmailDestination -> Maybe [MessageTag])
-> (BulkEmailDestination
-> Maybe [MessageTag] -> BulkEmailDestination)
-> Lens
BulkEmailDestination
BulkEmailDestination
(Maybe [MessageTag])
(Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailDestination' {Maybe [MessageTag]
replacementTags :: Maybe [MessageTag]
$sel:replacementTags:BulkEmailDestination' :: BulkEmailDestination -> Maybe [MessageTag]
replacementTags} -> Maybe [MessageTag]
replacementTags) (\s :: BulkEmailDestination
s@BulkEmailDestination' {} Maybe [MessageTag]
a -> BulkEmailDestination
s {$sel:replacementTags:BulkEmailDestination' :: Maybe [MessageTag]
replacementTags = Maybe [MessageTag]
a} :: BulkEmailDestination) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> BulkEmailDestination -> f BulkEmailDestination)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> BulkEmailDestination
-> f BulkEmailDestination
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MessageTag] [MessageTag] [MessageTag] [MessageTag]
-> Iso
(Maybe [MessageTag])
(Maybe [MessageTag])
(Maybe [MessageTag])
(Maybe [MessageTag])
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 [MessageTag] [MessageTag] [MessageTag] [MessageTag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
bulkEmailDestination_destination :: Lens.Lens' BulkEmailDestination Destination
bulkEmailDestination_destination :: (Destination -> f Destination)
-> BulkEmailDestination -> f BulkEmailDestination
bulkEmailDestination_destination = (BulkEmailDestination -> Destination)
-> (BulkEmailDestination -> Destination -> BulkEmailDestination)
-> Lens
BulkEmailDestination BulkEmailDestination Destination Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BulkEmailDestination' {Destination
destination :: Destination
$sel:destination:BulkEmailDestination' :: BulkEmailDestination -> Destination
destination} -> Destination
destination) (\s :: BulkEmailDestination
s@BulkEmailDestination' {} Destination
a -> BulkEmailDestination
s {$sel:destination:BulkEmailDestination' :: Destination
destination = Destination
a} :: BulkEmailDestination)
instance Prelude.Hashable BulkEmailDestination
instance Prelude.NFData BulkEmailDestination
instance Core.ToQuery BulkEmailDestination where
toQuery :: BulkEmailDestination -> QueryString
toQuery BulkEmailDestination' {Maybe [MessageTag]
Maybe Text
Destination
destination :: Destination
replacementTags :: Maybe [MessageTag]
replacementTemplateData :: Maybe Text
$sel:destination:BulkEmailDestination' :: BulkEmailDestination -> Destination
$sel:replacementTags:BulkEmailDestination' :: BulkEmailDestination -> Maybe [MessageTag]
$sel:replacementTemplateData:BulkEmailDestination' :: BulkEmailDestination -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ReplacementTemplateData"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
replacementTemplateData,
ByteString
"ReplacementTags"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [MessageTag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([MessageTag] -> QueryString)
-> Maybe [MessageTag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
replacementTags
),
ByteString
"Destination" ByteString -> Destination -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Destination
destination
]