{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.SESV2.SendBulkEmail
(
SendBulkEmail (..),
newSendBulkEmail,
sendBulkEmail_fromEmailAddress,
sendBulkEmail_fromEmailAddressIdentityArn,
sendBulkEmail_configurationSetName,
sendBulkEmail_feedbackForwardingEmailAddress,
sendBulkEmail_feedbackForwardingEmailAddressIdentityArn,
sendBulkEmail_defaultEmailTags,
sendBulkEmail_replyToAddresses,
sendBulkEmail_defaultContent,
sendBulkEmail_bulkEmailEntries,
SendBulkEmailResponse (..),
newSendBulkEmailResponse,
sendBulkEmailResponse_httpStatus,
sendBulkEmailResponse_bulkEmailEntryResults,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types
data SendBulkEmail = SendBulkEmail'
{
SendBulkEmail -> Maybe Text
fromEmailAddress :: Prelude.Maybe Prelude.Text,
SendBulkEmail -> Maybe Text
fromEmailAddressIdentityArn :: Prelude.Maybe Prelude.Text,
SendBulkEmail -> Maybe Text
configurationSetName :: Prelude.Maybe Prelude.Text,
SendBulkEmail -> Maybe Text
feedbackForwardingEmailAddress :: Prelude.Maybe Prelude.Text,
SendBulkEmail -> Maybe Text
feedbackForwardingEmailAddressIdentityArn :: Prelude.Maybe Prelude.Text,
SendBulkEmail -> Maybe [MessageTag]
defaultEmailTags :: Prelude.Maybe [MessageTag],
SendBulkEmail -> Maybe [Text]
replyToAddresses :: Prelude.Maybe [Prelude.Text],
SendBulkEmail -> BulkEmailContent
defaultContent :: BulkEmailContent,
SendBulkEmail -> [BulkEmailEntry]
bulkEmailEntries :: [BulkEmailEntry]
}
deriving (SendBulkEmail -> SendBulkEmail -> Bool
(SendBulkEmail -> SendBulkEmail -> Bool)
-> (SendBulkEmail -> SendBulkEmail -> Bool) -> Eq SendBulkEmail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendBulkEmail -> SendBulkEmail -> Bool
$c/= :: SendBulkEmail -> SendBulkEmail -> Bool
== :: SendBulkEmail -> SendBulkEmail -> Bool
$c== :: SendBulkEmail -> SendBulkEmail -> Bool
Prelude.Eq, ReadPrec [SendBulkEmail]
ReadPrec SendBulkEmail
Int -> ReadS SendBulkEmail
ReadS [SendBulkEmail]
(Int -> ReadS SendBulkEmail)
-> ReadS [SendBulkEmail]
-> ReadPrec SendBulkEmail
-> ReadPrec [SendBulkEmail]
-> Read SendBulkEmail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendBulkEmail]
$creadListPrec :: ReadPrec [SendBulkEmail]
readPrec :: ReadPrec SendBulkEmail
$creadPrec :: ReadPrec SendBulkEmail
readList :: ReadS [SendBulkEmail]
$creadList :: ReadS [SendBulkEmail]
readsPrec :: Int -> ReadS SendBulkEmail
$creadsPrec :: Int -> ReadS SendBulkEmail
Prelude.Read, Int -> SendBulkEmail -> ShowS
[SendBulkEmail] -> ShowS
SendBulkEmail -> String
(Int -> SendBulkEmail -> ShowS)
-> (SendBulkEmail -> String)
-> ([SendBulkEmail] -> ShowS)
-> Show SendBulkEmail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendBulkEmail] -> ShowS
$cshowList :: [SendBulkEmail] -> ShowS
show :: SendBulkEmail -> String
$cshow :: SendBulkEmail -> String
showsPrec :: Int -> SendBulkEmail -> ShowS
$cshowsPrec :: Int -> SendBulkEmail -> ShowS
Prelude.Show, (forall x. SendBulkEmail -> Rep SendBulkEmail x)
-> (forall x. Rep SendBulkEmail x -> SendBulkEmail)
-> Generic SendBulkEmail
forall x. Rep SendBulkEmail x -> SendBulkEmail
forall x. SendBulkEmail -> Rep SendBulkEmail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendBulkEmail x -> SendBulkEmail
$cfrom :: forall x. SendBulkEmail -> Rep SendBulkEmail x
Prelude.Generic)
newSendBulkEmail ::
BulkEmailContent ->
SendBulkEmail
newSendBulkEmail :: BulkEmailContent -> SendBulkEmail
newSendBulkEmail BulkEmailContent
pDefaultContent_ =
SendBulkEmail' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [MessageTag]
-> Maybe [Text]
-> BulkEmailContent
-> [BulkEmailEntry]
-> SendBulkEmail
SendBulkEmail'
{ $sel:fromEmailAddress:SendBulkEmail' :: Maybe Text
fromEmailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fromEmailAddressIdentityArn:SendBulkEmail' :: Maybe Text
fromEmailAddressIdentityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:configurationSetName:SendBulkEmail' :: Maybe Text
configurationSetName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:feedbackForwardingEmailAddress:SendBulkEmail' :: Maybe Text
feedbackForwardingEmailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:feedbackForwardingEmailAddressIdentityArn:SendBulkEmail' :: Maybe Text
feedbackForwardingEmailAddressIdentityArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultEmailTags:SendBulkEmail' :: Maybe [MessageTag]
defaultEmailTags = Maybe [MessageTag]
forall a. Maybe a
Prelude.Nothing,
$sel:replyToAddresses:SendBulkEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:defaultContent:SendBulkEmail' :: BulkEmailContent
defaultContent = BulkEmailContent
pDefaultContent_,
$sel:bulkEmailEntries:SendBulkEmail' :: [BulkEmailEntry]
bulkEmailEntries = [BulkEmailEntry]
forall a. Monoid a => a
Prelude.mempty
}
sendBulkEmail_fromEmailAddress :: Lens.Lens' SendBulkEmail (Prelude.Maybe Prelude.Text)
sendBulkEmail_fromEmailAddress :: (Maybe Text -> f (Maybe Text)) -> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_fromEmailAddress = (SendBulkEmail -> Maybe Text)
-> (SendBulkEmail -> Maybe Text -> SendBulkEmail)
-> Lens SendBulkEmail SendBulkEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe Text
fromEmailAddress :: Maybe Text
$sel:fromEmailAddress:SendBulkEmail' :: SendBulkEmail -> Maybe Text
fromEmailAddress} -> Maybe Text
fromEmailAddress) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe Text
a -> SendBulkEmail
s {$sel:fromEmailAddress:SendBulkEmail' :: Maybe Text
fromEmailAddress = Maybe Text
a} :: SendBulkEmail)
sendBulkEmail_fromEmailAddressIdentityArn :: Lens.Lens' SendBulkEmail (Prelude.Maybe Prelude.Text)
sendBulkEmail_fromEmailAddressIdentityArn :: (Maybe Text -> f (Maybe Text)) -> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_fromEmailAddressIdentityArn = (SendBulkEmail -> Maybe Text)
-> (SendBulkEmail -> Maybe Text -> SendBulkEmail)
-> Lens SendBulkEmail SendBulkEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe Text
fromEmailAddressIdentityArn :: Maybe Text
$sel:fromEmailAddressIdentityArn:SendBulkEmail' :: SendBulkEmail -> Maybe Text
fromEmailAddressIdentityArn} -> Maybe Text
fromEmailAddressIdentityArn) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe Text
a -> SendBulkEmail
s {$sel:fromEmailAddressIdentityArn:SendBulkEmail' :: Maybe Text
fromEmailAddressIdentityArn = Maybe Text
a} :: SendBulkEmail)
sendBulkEmail_configurationSetName :: Lens.Lens' SendBulkEmail (Prelude.Maybe Prelude.Text)
sendBulkEmail_configurationSetName :: (Maybe Text -> f (Maybe Text)) -> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_configurationSetName = (SendBulkEmail -> Maybe Text)
-> (SendBulkEmail -> Maybe Text -> SendBulkEmail)
-> Lens SendBulkEmail SendBulkEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe Text
configurationSetName :: Maybe Text
$sel:configurationSetName:SendBulkEmail' :: SendBulkEmail -> Maybe Text
configurationSetName} -> Maybe Text
configurationSetName) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe Text
a -> SendBulkEmail
s {$sel:configurationSetName:SendBulkEmail' :: Maybe Text
configurationSetName = Maybe Text
a} :: SendBulkEmail)
sendBulkEmail_feedbackForwardingEmailAddress :: Lens.Lens' SendBulkEmail (Prelude.Maybe Prelude.Text)
sendBulkEmail_feedbackForwardingEmailAddress :: (Maybe Text -> f (Maybe Text)) -> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_feedbackForwardingEmailAddress = (SendBulkEmail -> Maybe Text)
-> (SendBulkEmail -> Maybe Text -> SendBulkEmail)
-> Lens SendBulkEmail SendBulkEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe Text
feedbackForwardingEmailAddress :: Maybe Text
$sel:feedbackForwardingEmailAddress:SendBulkEmail' :: SendBulkEmail -> Maybe Text
feedbackForwardingEmailAddress} -> Maybe Text
feedbackForwardingEmailAddress) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe Text
a -> SendBulkEmail
s {$sel:feedbackForwardingEmailAddress:SendBulkEmail' :: Maybe Text
feedbackForwardingEmailAddress = Maybe Text
a} :: SendBulkEmail)
sendBulkEmail_feedbackForwardingEmailAddressIdentityArn :: Lens.Lens' SendBulkEmail (Prelude.Maybe Prelude.Text)
sendBulkEmail_feedbackForwardingEmailAddressIdentityArn :: (Maybe Text -> f (Maybe Text)) -> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_feedbackForwardingEmailAddressIdentityArn = (SendBulkEmail -> Maybe Text)
-> (SendBulkEmail -> Maybe Text -> SendBulkEmail)
-> Lens SendBulkEmail SendBulkEmail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe Text
feedbackForwardingEmailAddressIdentityArn :: Maybe Text
$sel:feedbackForwardingEmailAddressIdentityArn:SendBulkEmail' :: SendBulkEmail -> Maybe Text
feedbackForwardingEmailAddressIdentityArn} -> Maybe Text
feedbackForwardingEmailAddressIdentityArn) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe Text
a -> SendBulkEmail
s {$sel:feedbackForwardingEmailAddressIdentityArn:SendBulkEmail' :: Maybe Text
feedbackForwardingEmailAddressIdentityArn = Maybe Text
a} :: SendBulkEmail)
sendBulkEmail_defaultEmailTags :: Lens.Lens' SendBulkEmail (Prelude.Maybe [MessageTag])
sendBulkEmail_defaultEmailTags :: (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_defaultEmailTags = (SendBulkEmail -> Maybe [MessageTag])
-> (SendBulkEmail -> Maybe [MessageTag] -> SendBulkEmail)
-> Lens
SendBulkEmail
SendBulkEmail
(Maybe [MessageTag])
(Maybe [MessageTag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe [MessageTag]
defaultEmailTags :: Maybe [MessageTag]
$sel:defaultEmailTags:SendBulkEmail' :: SendBulkEmail -> Maybe [MessageTag]
defaultEmailTags} -> Maybe [MessageTag]
defaultEmailTags) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe [MessageTag]
a -> SendBulkEmail
s {$sel:defaultEmailTags:SendBulkEmail' :: Maybe [MessageTag]
defaultEmailTags = Maybe [MessageTag]
a} :: SendBulkEmail) ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendBulkEmail -> f SendBulkEmail)
-> ((Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> (Maybe [MessageTag] -> f (Maybe [MessageTag]))
-> SendBulkEmail
-> f SendBulkEmail
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
sendBulkEmail_replyToAddresses :: Lens.Lens' SendBulkEmail (Prelude.Maybe [Prelude.Text])
sendBulkEmail_replyToAddresses :: (Maybe [Text] -> f (Maybe [Text]))
-> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_replyToAddresses = (SendBulkEmail -> Maybe [Text])
-> (SendBulkEmail -> Maybe [Text] -> SendBulkEmail)
-> Lens SendBulkEmail SendBulkEmail (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {Maybe [Text]
replyToAddresses :: Maybe [Text]
$sel:replyToAddresses:SendBulkEmail' :: SendBulkEmail -> Maybe [Text]
replyToAddresses} -> Maybe [Text]
replyToAddresses) (\s :: SendBulkEmail
s@SendBulkEmail' {} Maybe [Text]
a -> SendBulkEmail
s {$sel:replyToAddresses:SendBulkEmail' :: Maybe [Text]
replyToAddresses = Maybe [Text]
a} :: SendBulkEmail) ((Maybe [Text] -> f (Maybe [Text]))
-> SendBulkEmail -> f SendBulkEmail)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SendBulkEmail
-> f SendBulkEmail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sendBulkEmail_defaultContent :: Lens.Lens' SendBulkEmail BulkEmailContent
sendBulkEmail_defaultContent :: (BulkEmailContent -> f BulkEmailContent)
-> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_defaultContent = (SendBulkEmail -> BulkEmailContent)
-> (SendBulkEmail -> BulkEmailContent -> SendBulkEmail)
-> Lens
SendBulkEmail SendBulkEmail BulkEmailContent BulkEmailContent
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {BulkEmailContent
defaultContent :: BulkEmailContent
$sel:defaultContent:SendBulkEmail' :: SendBulkEmail -> BulkEmailContent
defaultContent} -> BulkEmailContent
defaultContent) (\s :: SendBulkEmail
s@SendBulkEmail' {} BulkEmailContent
a -> SendBulkEmail
s {$sel:defaultContent:SendBulkEmail' :: BulkEmailContent
defaultContent = BulkEmailContent
a} :: SendBulkEmail)
sendBulkEmail_bulkEmailEntries :: Lens.Lens' SendBulkEmail [BulkEmailEntry]
sendBulkEmail_bulkEmailEntries :: ([BulkEmailEntry] -> f [BulkEmailEntry])
-> SendBulkEmail -> f SendBulkEmail
sendBulkEmail_bulkEmailEntries = (SendBulkEmail -> [BulkEmailEntry])
-> (SendBulkEmail -> [BulkEmailEntry] -> SendBulkEmail)
-> Lens
SendBulkEmail SendBulkEmail [BulkEmailEntry] [BulkEmailEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmail' {[BulkEmailEntry]
bulkEmailEntries :: [BulkEmailEntry]
$sel:bulkEmailEntries:SendBulkEmail' :: SendBulkEmail -> [BulkEmailEntry]
bulkEmailEntries} -> [BulkEmailEntry]
bulkEmailEntries) (\s :: SendBulkEmail
s@SendBulkEmail' {} [BulkEmailEntry]
a -> SendBulkEmail
s {$sel:bulkEmailEntries:SendBulkEmail' :: [BulkEmailEntry]
bulkEmailEntries = [BulkEmailEntry]
a} :: SendBulkEmail) (([BulkEmailEntry] -> f [BulkEmailEntry])
-> SendBulkEmail -> f SendBulkEmail)
-> (([BulkEmailEntry] -> f [BulkEmailEntry])
-> [BulkEmailEntry] -> f [BulkEmailEntry])
-> ([BulkEmailEntry] -> f [BulkEmailEntry])
-> SendBulkEmail
-> f SendBulkEmail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BulkEmailEntry] -> f [BulkEmailEntry])
-> [BulkEmailEntry] -> f [BulkEmailEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest SendBulkEmail where
type
AWSResponse SendBulkEmail =
SendBulkEmailResponse
request :: SendBulkEmail -> Request SendBulkEmail
request = Service -> SendBulkEmail -> Request SendBulkEmail
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendBulkEmail
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendBulkEmail)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SendBulkEmail))
-> Logger
-> Service
-> Proxy SendBulkEmail
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendBulkEmail)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> [BulkEmailEntryResult] -> SendBulkEmailResponse
SendBulkEmailResponse'
(Int -> [BulkEmailEntryResult] -> SendBulkEmailResponse)
-> Either String Int
-> Either String ([BulkEmailEntryResult] -> SendBulkEmailResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String ([BulkEmailEntryResult] -> SendBulkEmailResponse)
-> Either String [BulkEmailEntryResult]
-> Either String SendBulkEmailResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [BulkEmailEntryResult])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"BulkEmailEntryResults"
Either String (Maybe [BulkEmailEntryResult])
-> [BulkEmailEntryResult] -> Either String [BulkEmailEntryResult]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [BulkEmailEntryResult]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable SendBulkEmail
instance Prelude.NFData SendBulkEmail
instance Core.ToHeaders SendBulkEmail where
toHeaders :: SendBulkEmail -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendBulkEmail -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendBulkEmail where
toJSON :: SendBulkEmail -> Value
toJSON SendBulkEmail' {[BulkEmailEntry]
Maybe [Text]
Maybe [MessageTag]
Maybe Text
BulkEmailContent
bulkEmailEntries :: [BulkEmailEntry]
defaultContent :: BulkEmailContent
replyToAddresses :: Maybe [Text]
defaultEmailTags :: Maybe [MessageTag]
feedbackForwardingEmailAddressIdentityArn :: Maybe Text
feedbackForwardingEmailAddress :: Maybe Text
configurationSetName :: Maybe Text
fromEmailAddressIdentityArn :: Maybe Text
fromEmailAddress :: Maybe Text
$sel:bulkEmailEntries:SendBulkEmail' :: SendBulkEmail -> [BulkEmailEntry]
$sel:defaultContent:SendBulkEmail' :: SendBulkEmail -> BulkEmailContent
$sel:replyToAddresses:SendBulkEmail' :: SendBulkEmail -> Maybe [Text]
$sel:defaultEmailTags:SendBulkEmail' :: SendBulkEmail -> Maybe [MessageTag]
$sel:feedbackForwardingEmailAddressIdentityArn:SendBulkEmail' :: SendBulkEmail -> Maybe Text
$sel:feedbackForwardingEmailAddress:SendBulkEmail' :: SendBulkEmail -> Maybe Text
$sel:configurationSetName:SendBulkEmail' :: SendBulkEmail -> Maybe Text
$sel:fromEmailAddressIdentityArn:SendBulkEmail' :: SendBulkEmail -> Maybe Text
$sel:fromEmailAddress:SendBulkEmail' :: SendBulkEmail -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FromEmailAddress" 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
fromEmailAddress,
(Text
"FromEmailAddressIdentityArn" 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
fromEmailAddressIdentityArn,
(Text
"ConfigurationSetName" 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
configurationSetName,
(Text
"FeedbackForwardingEmailAddress" 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
feedbackForwardingEmailAddress,
(Text
"FeedbackForwardingEmailAddressIdentityArn" 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
feedbackForwardingEmailAddressIdentityArn,
(Text
"DefaultEmailTags" Text -> [MessageTag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([MessageTag] -> Pair) -> Maybe [MessageTag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageTag]
defaultEmailTags,
(Text
"ReplyToAddresses" 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]
replyToAddresses,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DefaultContent" Text -> BulkEmailContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= BulkEmailContent
defaultContent),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"BulkEmailEntries" Text -> [BulkEmailEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [BulkEmailEntry]
bulkEmailEntries)
]
)
instance Core.ToPath SendBulkEmail where
toPath :: SendBulkEmail -> ByteString
toPath =
ByteString -> SendBulkEmail -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v2/email/outbound-bulk-emails"
instance Core.ToQuery SendBulkEmail where
toQuery :: SendBulkEmail -> QueryString
toQuery = QueryString -> SendBulkEmail -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendBulkEmailResponse = SendBulkEmailResponse'
{
SendBulkEmailResponse -> Int
httpStatus :: Prelude.Int,
SendBulkEmailResponse -> [BulkEmailEntryResult]
bulkEmailEntryResults :: [BulkEmailEntryResult]
}
deriving (SendBulkEmailResponse -> SendBulkEmailResponse -> Bool
(SendBulkEmailResponse -> SendBulkEmailResponse -> Bool)
-> (SendBulkEmailResponse -> SendBulkEmailResponse -> Bool)
-> Eq SendBulkEmailResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendBulkEmailResponse -> SendBulkEmailResponse -> Bool
$c/= :: SendBulkEmailResponse -> SendBulkEmailResponse -> Bool
== :: SendBulkEmailResponse -> SendBulkEmailResponse -> Bool
$c== :: SendBulkEmailResponse -> SendBulkEmailResponse -> Bool
Prelude.Eq, ReadPrec [SendBulkEmailResponse]
ReadPrec SendBulkEmailResponse
Int -> ReadS SendBulkEmailResponse
ReadS [SendBulkEmailResponse]
(Int -> ReadS SendBulkEmailResponse)
-> ReadS [SendBulkEmailResponse]
-> ReadPrec SendBulkEmailResponse
-> ReadPrec [SendBulkEmailResponse]
-> Read SendBulkEmailResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendBulkEmailResponse]
$creadListPrec :: ReadPrec [SendBulkEmailResponse]
readPrec :: ReadPrec SendBulkEmailResponse
$creadPrec :: ReadPrec SendBulkEmailResponse
readList :: ReadS [SendBulkEmailResponse]
$creadList :: ReadS [SendBulkEmailResponse]
readsPrec :: Int -> ReadS SendBulkEmailResponse
$creadsPrec :: Int -> ReadS SendBulkEmailResponse
Prelude.Read, Int -> SendBulkEmailResponse -> ShowS
[SendBulkEmailResponse] -> ShowS
SendBulkEmailResponse -> String
(Int -> SendBulkEmailResponse -> ShowS)
-> (SendBulkEmailResponse -> String)
-> ([SendBulkEmailResponse] -> ShowS)
-> Show SendBulkEmailResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendBulkEmailResponse] -> ShowS
$cshowList :: [SendBulkEmailResponse] -> ShowS
show :: SendBulkEmailResponse -> String
$cshow :: SendBulkEmailResponse -> String
showsPrec :: Int -> SendBulkEmailResponse -> ShowS
$cshowsPrec :: Int -> SendBulkEmailResponse -> ShowS
Prelude.Show, (forall x. SendBulkEmailResponse -> Rep SendBulkEmailResponse x)
-> (forall x. Rep SendBulkEmailResponse x -> SendBulkEmailResponse)
-> Generic SendBulkEmailResponse
forall x. Rep SendBulkEmailResponse x -> SendBulkEmailResponse
forall x. SendBulkEmailResponse -> Rep SendBulkEmailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendBulkEmailResponse x -> SendBulkEmailResponse
$cfrom :: forall x. SendBulkEmailResponse -> Rep SendBulkEmailResponse x
Prelude.Generic)
newSendBulkEmailResponse ::
Prelude.Int ->
SendBulkEmailResponse
newSendBulkEmailResponse :: Int -> SendBulkEmailResponse
newSendBulkEmailResponse Int
pHttpStatus_ =
SendBulkEmailResponse' :: Int -> [BulkEmailEntryResult] -> SendBulkEmailResponse
SendBulkEmailResponse'
{ $sel:httpStatus:SendBulkEmailResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:bulkEmailEntryResults:SendBulkEmailResponse' :: [BulkEmailEntryResult]
bulkEmailEntryResults = [BulkEmailEntryResult]
forall a. Monoid a => a
Prelude.mempty
}
sendBulkEmailResponse_httpStatus :: Lens.Lens' SendBulkEmailResponse Prelude.Int
sendBulkEmailResponse_httpStatus :: (Int -> f Int) -> SendBulkEmailResponse -> f SendBulkEmailResponse
sendBulkEmailResponse_httpStatus = (SendBulkEmailResponse -> Int)
-> (SendBulkEmailResponse -> Int -> SendBulkEmailResponse)
-> Lens SendBulkEmailResponse SendBulkEmailResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmailResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendBulkEmailResponse' :: SendBulkEmailResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendBulkEmailResponse
s@SendBulkEmailResponse' {} Int
a -> SendBulkEmailResponse
s {$sel:httpStatus:SendBulkEmailResponse' :: Int
httpStatus = Int
a} :: SendBulkEmailResponse)
sendBulkEmailResponse_bulkEmailEntryResults :: Lens.Lens' SendBulkEmailResponse [BulkEmailEntryResult]
sendBulkEmailResponse_bulkEmailEntryResults :: ([BulkEmailEntryResult] -> f [BulkEmailEntryResult])
-> SendBulkEmailResponse -> f SendBulkEmailResponse
sendBulkEmailResponse_bulkEmailEntryResults = (SendBulkEmailResponse -> [BulkEmailEntryResult])
-> (SendBulkEmailResponse
-> [BulkEmailEntryResult] -> SendBulkEmailResponse)
-> Lens
SendBulkEmailResponse
SendBulkEmailResponse
[BulkEmailEntryResult]
[BulkEmailEntryResult]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendBulkEmailResponse' {[BulkEmailEntryResult]
bulkEmailEntryResults :: [BulkEmailEntryResult]
$sel:bulkEmailEntryResults:SendBulkEmailResponse' :: SendBulkEmailResponse -> [BulkEmailEntryResult]
bulkEmailEntryResults} -> [BulkEmailEntryResult]
bulkEmailEntryResults) (\s :: SendBulkEmailResponse
s@SendBulkEmailResponse' {} [BulkEmailEntryResult]
a -> SendBulkEmailResponse
s {$sel:bulkEmailEntryResults:SendBulkEmailResponse' :: [BulkEmailEntryResult]
bulkEmailEntryResults = [BulkEmailEntryResult]
a} :: SendBulkEmailResponse) (([BulkEmailEntryResult] -> f [BulkEmailEntryResult])
-> SendBulkEmailResponse -> f SendBulkEmailResponse)
-> (([BulkEmailEntryResult] -> f [BulkEmailEntryResult])
-> [BulkEmailEntryResult] -> f [BulkEmailEntryResult])
-> ([BulkEmailEntryResult] -> f [BulkEmailEntryResult])
-> SendBulkEmailResponse
-> f SendBulkEmailResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BulkEmailEntryResult] -> f [BulkEmailEntryResult])
-> [BulkEmailEntryResult] -> f [BulkEmailEntryResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData SendBulkEmailResponse