{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SNS.Types.PublishBatchRequestEntry
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SNS.Types.PublishBatchRequestEntry 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
import Amazonka.SNS.Types.MessageAttributeValue

-- | Contains the details of a single Amazon SNS message along with an @Id@
-- that identifies a message within the batch.
--
-- /See:/ 'newPublishBatchRequestEntry' smart constructor.
data PublishBatchRequestEntry = PublishBatchRequestEntry'
  { -- | Each message attribute consists of a @Name@, @Type@, and @Value@. For
    -- more information, see
    -- <https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html Amazon SNS message attributes>
    -- in the Amazon SNS Developer Guide.
    PublishBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue),
    -- | This parameter applies only to FIFO (first-in-first-out) topics.
    --
    -- The token used for deduplication of messages within a 5-minute minimum
    -- deduplication interval. If a message with a particular
    -- @MessageDeduplicationId@ is sent successfully, subsequent messages with
    -- the same @MessageDeduplicationId@ are accepted successfully but aren\'t
    -- delivered.
    --
    -- -   Every message must have a unique @MessageDeduplicationId@.
    --
    --     -   You may provide a @MessageDeduplicationId@ explicitly.
    --
    --     -   If you aren\'t able to provide a @MessageDeduplicationId@ and
    --         you enable @ContentBasedDeduplication@ for your topic, Amazon
    --         SNS uses a SHA-256 hash to generate the @MessageDeduplicationId@
    --         using the body of the message (but not the attributes of the
    --         message).
    --
    --     -   If you don\'t provide a @MessageDeduplicationId@ and the topic
    --         doesn\'t have @ContentBasedDeduplication@ set, the action fails
    --         with an error.
    --
    --     -   If the topic has a @ContentBasedDeduplication@ set, your
    --         @MessageDeduplicationId@ overrides the generated one.
    --
    -- -   When @ContentBasedDeduplication@ is in effect, messages with
    --     identical content sent within the deduplication interval are treated
    --     as duplicates and only one copy of the message is delivered.
    --
    -- -   If you send one message with @ContentBasedDeduplication@ enabled,
    --     and then another message with a @MessageDeduplicationId@ that is the
    --     same as the one generated for the first @MessageDeduplicationId@,
    --     the two messages are treated as duplicates and only one copy of the
    --     message is delivered.
    --
    -- The @MessageDeduplicationId@ is available to the consumer of the message
    -- (this can be useful for troubleshooting delivery issues).
    --
    -- If a message is sent successfully but the acknowledgement is lost and
    -- the message is resent with the same @MessageDeduplicationId@ after the
    -- deduplication interval, Amazon SNS can\'t detect duplicate messages.
    --
    -- Amazon SNS continues to keep track of the message deduplication ID even
    -- after the message is received and deleted.
    --
    -- The length of @MessageDeduplicationId@ is 128 characters.
    --
    -- @MessageDeduplicationId@ can contain alphanumeric characters
    -- @(a-z, A-Z, 0-9)@ and punctuation
    -- @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
    PublishBatchRequestEntry -> Maybe Text
messageDeduplicationId :: Prelude.Maybe Prelude.Text,
    -- | This parameter applies only to FIFO (first-in-first-out) topics.
    --
    -- The tag that specifies that a message belongs to a specific message
    -- group. Messages that belong to the same message group are processed in a
    -- FIFO manner (however, messages in different message groups might be
    -- processed out of order). To interleave multiple ordered streams within a
    -- single topic, use @MessageGroupId@ values (for example, session data for
    -- multiple users). In this scenario, multiple consumers can process the
    -- topic, but the session data of each user is processed in a FIFO fashion.
    --
    -- You must associate a non-empty @MessageGroupId@ with a message. If you
    -- don\'t provide a @MessageGroupId@, the action fails.
    --
    -- The length of @MessageGroupId@ is 128 characters.
    --
    -- @MessageGroupId@ can contain alphanumeric characters @(a-z, A-Z, 0-9)@
    -- and punctuation @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
    --
    -- @MessageGroupId@ is required for FIFO topics. You can\'t use it for
    -- standard topics.
    PublishBatchRequestEntry -> Maybe Text
messageGroupId :: Prelude.Maybe Prelude.Text,
    -- | Set @MessageStructure@ to @json@ if you want to send a different message
    -- for each protocol. For example, using one publish action, you can send a
    -- short message to your SMS subscribers and a longer message to your email
    -- subscribers. If you set @MessageStructure@ to @json@, the value of the
    -- @Message@ parameter must:
    --
    -- -   be a syntactically valid JSON object; and
    --
    -- -   contain at least a top-level JSON key of \"default\" with a value
    --     that is a string.
    --
    -- You can define other top-level keys that define the message you want to
    -- send to a specific transport protocol (e.g. http).
    PublishBatchRequestEntry -> Maybe Text
messageStructure :: Prelude.Maybe Prelude.Text,
    -- | The subject of the batch message.
    PublishBatchRequestEntry -> Maybe Text
subject :: Prelude.Maybe Prelude.Text,
    -- | An identifier for the message in this batch.
    --
    -- The @Ids@ of a batch request must be unique within a request.
    --
    -- This identifier can have up to 80 characters. The following characters
    -- are accepted: alphanumeric characters, hyphens(-), and underscores (_).
    PublishBatchRequestEntry -> Text
id :: Prelude.Text,
    -- | The body of the message.
    PublishBatchRequestEntry -> Text
message :: Prelude.Text
  }
  deriving (PublishBatchRequestEntry -> PublishBatchRequestEntry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishBatchRequestEntry -> PublishBatchRequestEntry -> Bool
$c/= :: PublishBatchRequestEntry -> PublishBatchRequestEntry -> Bool
== :: PublishBatchRequestEntry -> PublishBatchRequestEntry -> Bool
$c== :: PublishBatchRequestEntry -> PublishBatchRequestEntry -> Bool
Prelude.Eq, ReadPrec [PublishBatchRequestEntry]
ReadPrec PublishBatchRequestEntry
Int -> ReadS PublishBatchRequestEntry
ReadS [PublishBatchRequestEntry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublishBatchRequestEntry]
$creadListPrec :: ReadPrec [PublishBatchRequestEntry]
readPrec :: ReadPrec PublishBatchRequestEntry
$creadPrec :: ReadPrec PublishBatchRequestEntry
readList :: ReadS [PublishBatchRequestEntry]
$creadList :: ReadS [PublishBatchRequestEntry]
readsPrec :: Int -> ReadS PublishBatchRequestEntry
$creadsPrec :: Int -> ReadS PublishBatchRequestEntry
Prelude.Read, Int -> PublishBatchRequestEntry -> ShowS
[PublishBatchRequestEntry] -> ShowS
PublishBatchRequestEntry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishBatchRequestEntry] -> ShowS
$cshowList :: [PublishBatchRequestEntry] -> ShowS
show :: PublishBatchRequestEntry -> String
$cshow :: PublishBatchRequestEntry -> String
showsPrec :: Int -> PublishBatchRequestEntry -> ShowS
$cshowsPrec :: Int -> PublishBatchRequestEntry -> ShowS
Prelude.Show, forall x.
Rep PublishBatchRequestEntry x -> PublishBatchRequestEntry
forall x.
PublishBatchRequestEntry -> Rep PublishBatchRequestEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublishBatchRequestEntry x -> PublishBatchRequestEntry
$cfrom :: forall x.
PublishBatchRequestEntry -> Rep PublishBatchRequestEntry x
Prelude.Generic)

-- |
-- Create a value of 'PublishBatchRequestEntry' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'messageAttributes', 'publishBatchRequestEntry_messageAttributes' - Each message attribute consists of a @Name@, @Type@, and @Value@. For
-- more information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html Amazon SNS message attributes>
-- in the Amazon SNS Developer Guide.
--
-- 'messageDeduplicationId', 'publishBatchRequestEntry_messageDeduplicationId' - This parameter applies only to FIFO (first-in-first-out) topics.
--
-- The token used for deduplication of messages within a 5-minute minimum
-- deduplication interval. If a message with a particular
-- @MessageDeduplicationId@ is sent successfully, subsequent messages with
-- the same @MessageDeduplicationId@ are accepted successfully but aren\'t
-- delivered.
--
-- -   Every message must have a unique @MessageDeduplicationId@.
--
--     -   You may provide a @MessageDeduplicationId@ explicitly.
--
--     -   If you aren\'t able to provide a @MessageDeduplicationId@ and
--         you enable @ContentBasedDeduplication@ for your topic, Amazon
--         SNS uses a SHA-256 hash to generate the @MessageDeduplicationId@
--         using the body of the message (but not the attributes of the
--         message).
--
--     -   If you don\'t provide a @MessageDeduplicationId@ and the topic
--         doesn\'t have @ContentBasedDeduplication@ set, the action fails
--         with an error.
--
--     -   If the topic has a @ContentBasedDeduplication@ set, your
--         @MessageDeduplicationId@ overrides the generated one.
--
-- -   When @ContentBasedDeduplication@ is in effect, messages with
--     identical content sent within the deduplication interval are treated
--     as duplicates and only one copy of the message is delivered.
--
-- -   If you send one message with @ContentBasedDeduplication@ enabled,
--     and then another message with a @MessageDeduplicationId@ that is the
--     same as the one generated for the first @MessageDeduplicationId@,
--     the two messages are treated as duplicates and only one copy of the
--     message is delivered.
--
-- The @MessageDeduplicationId@ is available to the consumer of the message
-- (this can be useful for troubleshooting delivery issues).
--
-- If a message is sent successfully but the acknowledgement is lost and
-- the message is resent with the same @MessageDeduplicationId@ after the
-- deduplication interval, Amazon SNS can\'t detect duplicate messages.
--
-- Amazon SNS continues to keep track of the message deduplication ID even
-- after the message is received and deleted.
--
-- The length of @MessageDeduplicationId@ is 128 characters.
--
-- @MessageDeduplicationId@ can contain alphanumeric characters
-- @(a-z, A-Z, 0-9)@ and punctuation
-- @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
--
-- 'messageGroupId', 'publishBatchRequestEntry_messageGroupId' - This parameter applies only to FIFO (first-in-first-out) topics.
--
-- The tag that specifies that a message belongs to a specific message
-- group. Messages that belong to the same message group are processed in a
-- FIFO manner (however, messages in different message groups might be
-- processed out of order). To interleave multiple ordered streams within a
-- single topic, use @MessageGroupId@ values (for example, session data for
-- multiple users). In this scenario, multiple consumers can process the
-- topic, but the session data of each user is processed in a FIFO fashion.
--
-- You must associate a non-empty @MessageGroupId@ with a message. If you
-- don\'t provide a @MessageGroupId@, the action fails.
--
-- The length of @MessageGroupId@ is 128 characters.
--
-- @MessageGroupId@ can contain alphanumeric characters @(a-z, A-Z, 0-9)@
-- and punctuation @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
--
-- @MessageGroupId@ is required for FIFO topics. You can\'t use it for
-- standard topics.
--
-- 'messageStructure', 'publishBatchRequestEntry_messageStructure' - Set @MessageStructure@ to @json@ if you want to send a different message
-- for each protocol. For example, using one publish action, you can send a
-- short message to your SMS subscribers and a longer message to your email
-- subscribers. If you set @MessageStructure@ to @json@, the value of the
-- @Message@ parameter must:
--
-- -   be a syntactically valid JSON object; and
--
-- -   contain at least a top-level JSON key of \"default\" with a value
--     that is a string.
--
-- You can define other top-level keys that define the message you want to
-- send to a specific transport protocol (e.g. http).
--
-- 'subject', 'publishBatchRequestEntry_subject' - The subject of the batch message.
--
-- 'id', 'publishBatchRequestEntry_id' - An identifier for the message in this batch.
--
-- The @Ids@ of a batch request must be unique within a request.
--
-- This identifier can have up to 80 characters. The following characters
-- are accepted: alphanumeric characters, hyphens(-), and underscores (_).
--
-- 'message', 'publishBatchRequestEntry_message' - The body of the message.
newPublishBatchRequestEntry ::
  -- | 'id'
  Prelude.Text ->
  -- | 'message'
  Prelude.Text ->
  PublishBatchRequestEntry
newPublishBatchRequestEntry :: Text -> Text -> PublishBatchRequestEntry
newPublishBatchRequestEntry Text
pId_ Text
pMessage_ =
  PublishBatchRequestEntry'
    { $sel:messageAttributes:PublishBatchRequestEntry' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:messageDeduplicationId:PublishBatchRequestEntry' :: Maybe Text
messageDeduplicationId = forall a. Maybe a
Prelude.Nothing,
      $sel:messageGroupId:PublishBatchRequestEntry' :: Maybe Text
messageGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:messageStructure:PublishBatchRequestEntry' :: Maybe Text
messageStructure = forall a. Maybe a
Prelude.Nothing,
      $sel:subject:PublishBatchRequestEntry' :: Maybe Text
subject = forall a. Maybe a
Prelude.Nothing,
      $sel:id:PublishBatchRequestEntry' :: Text
id = Text
pId_,
      $sel:message:PublishBatchRequestEntry' :: Text
message = Text
pMessage_
    }

-- | Each message attribute consists of a @Name@, @Type@, and @Value@. For
-- more information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html Amazon SNS message attributes>
-- in the Amazon SNS Developer Guide.
publishBatchRequestEntry_messageAttributes :: Lens.Lens' PublishBatchRequestEntry (Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue))
publishBatchRequestEntry_messageAttributes :: Lens'
  PublishBatchRequestEntry
  (Maybe (HashMap Text MessageAttributeValue))
publishBatchRequestEntry_messageAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:messageAttributes:PublishBatchRequestEntry' :: PublishBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
messageAttributes} -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Maybe (HashMap Text MessageAttributeValue)
a -> PublishBatchRequestEntry
s {$sel:messageAttributes:PublishBatchRequestEntry' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes = Maybe (HashMap Text MessageAttributeValue)
a} :: PublishBatchRequestEntry) 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

-- | This parameter applies only to FIFO (first-in-first-out) topics.
--
-- The token used for deduplication of messages within a 5-minute minimum
-- deduplication interval. If a message with a particular
-- @MessageDeduplicationId@ is sent successfully, subsequent messages with
-- the same @MessageDeduplicationId@ are accepted successfully but aren\'t
-- delivered.
--
-- -   Every message must have a unique @MessageDeduplicationId@.
--
--     -   You may provide a @MessageDeduplicationId@ explicitly.
--
--     -   If you aren\'t able to provide a @MessageDeduplicationId@ and
--         you enable @ContentBasedDeduplication@ for your topic, Amazon
--         SNS uses a SHA-256 hash to generate the @MessageDeduplicationId@
--         using the body of the message (but not the attributes of the
--         message).
--
--     -   If you don\'t provide a @MessageDeduplicationId@ and the topic
--         doesn\'t have @ContentBasedDeduplication@ set, the action fails
--         with an error.
--
--     -   If the topic has a @ContentBasedDeduplication@ set, your
--         @MessageDeduplicationId@ overrides the generated one.
--
-- -   When @ContentBasedDeduplication@ is in effect, messages with
--     identical content sent within the deduplication interval are treated
--     as duplicates and only one copy of the message is delivered.
--
-- -   If you send one message with @ContentBasedDeduplication@ enabled,
--     and then another message with a @MessageDeduplicationId@ that is the
--     same as the one generated for the first @MessageDeduplicationId@,
--     the two messages are treated as duplicates and only one copy of the
--     message is delivered.
--
-- The @MessageDeduplicationId@ is available to the consumer of the message
-- (this can be useful for troubleshooting delivery issues).
--
-- If a message is sent successfully but the acknowledgement is lost and
-- the message is resent with the same @MessageDeduplicationId@ after the
-- deduplication interval, Amazon SNS can\'t detect duplicate messages.
--
-- Amazon SNS continues to keep track of the message deduplication ID even
-- after the message is received and deleted.
--
-- The length of @MessageDeduplicationId@ is 128 characters.
--
-- @MessageDeduplicationId@ can contain alphanumeric characters
-- @(a-z, A-Z, 0-9)@ and punctuation
-- @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
publishBatchRequestEntry_messageDeduplicationId :: Lens.Lens' PublishBatchRequestEntry (Prelude.Maybe Prelude.Text)
publishBatchRequestEntry_messageDeduplicationId :: Lens' PublishBatchRequestEntry (Maybe Text)
publishBatchRequestEntry_messageDeduplicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Maybe Text
messageDeduplicationId :: Maybe Text
$sel:messageDeduplicationId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
messageDeduplicationId} -> Maybe Text
messageDeduplicationId) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Maybe Text
a -> PublishBatchRequestEntry
s {$sel:messageDeduplicationId:PublishBatchRequestEntry' :: Maybe Text
messageDeduplicationId = Maybe Text
a} :: PublishBatchRequestEntry)

-- | This parameter applies only to FIFO (first-in-first-out) topics.
--
-- The tag that specifies that a message belongs to a specific message
-- group. Messages that belong to the same message group are processed in a
-- FIFO manner (however, messages in different message groups might be
-- processed out of order). To interleave multiple ordered streams within a
-- single topic, use @MessageGroupId@ values (for example, session data for
-- multiple users). In this scenario, multiple consumers can process the
-- topic, but the session data of each user is processed in a FIFO fashion.
--
-- You must associate a non-empty @MessageGroupId@ with a message. If you
-- don\'t provide a @MessageGroupId@, the action fails.
--
-- The length of @MessageGroupId@ is 128 characters.
--
-- @MessageGroupId@ can contain alphanumeric characters @(a-z, A-Z, 0-9)@
-- and punctuation @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
--
-- @MessageGroupId@ is required for FIFO topics. You can\'t use it for
-- standard topics.
publishBatchRequestEntry_messageGroupId :: Lens.Lens' PublishBatchRequestEntry (Prelude.Maybe Prelude.Text)
publishBatchRequestEntry_messageGroupId :: Lens' PublishBatchRequestEntry (Maybe Text)
publishBatchRequestEntry_messageGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Maybe Text
messageGroupId :: Maybe Text
$sel:messageGroupId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
messageGroupId} -> Maybe Text
messageGroupId) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Maybe Text
a -> PublishBatchRequestEntry
s {$sel:messageGroupId:PublishBatchRequestEntry' :: Maybe Text
messageGroupId = Maybe Text
a} :: PublishBatchRequestEntry)

-- | Set @MessageStructure@ to @json@ if you want to send a different message
-- for each protocol. For example, using one publish action, you can send a
-- short message to your SMS subscribers and a longer message to your email
-- subscribers. If you set @MessageStructure@ to @json@, the value of the
-- @Message@ parameter must:
--
-- -   be a syntactically valid JSON object; and
--
-- -   contain at least a top-level JSON key of \"default\" with a value
--     that is a string.
--
-- You can define other top-level keys that define the message you want to
-- send to a specific transport protocol (e.g. http).
publishBatchRequestEntry_messageStructure :: Lens.Lens' PublishBatchRequestEntry (Prelude.Maybe Prelude.Text)
publishBatchRequestEntry_messageStructure :: Lens' PublishBatchRequestEntry (Maybe Text)
publishBatchRequestEntry_messageStructure = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Maybe Text
messageStructure :: Maybe Text
$sel:messageStructure:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
messageStructure} -> Maybe Text
messageStructure) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Maybe Text
a -> PublishBatchRequestEntry
s {$sel:messageStructure:PublishBatchRequestEntry' :: Maybe Text
messageStructure = Maybe Text
a} :: PublishBatchRequestEntry)

-- | The subject of the batch message.
publishBatchRequestEntry_subject :: Lens.Lens' PublishBatchRequestEntry (Prelude.Maybe Prelude.Text)
publishBatchRequestEntry_subject :: Lens' PublishBatchRequestEntry (Maybe Text)
publishBatchRequestEntry_subject = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Maybe Text
subject :: Maybe Text
$sel:subject:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
subject} -> Maybe Text
subject) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Maybe Text
a -> PublishBatchRequestEntry
s {$sel:subject:PublishBatchRequestEntry' :: Maybe Text
subject = Maybe Text
a} :: PublishBatchRequestEntry)

-- | An identifier for the message in this batch.
--
-- The @Ids@ of a batch request must be unique within a request.
--
-- This identifier can have up to 80 characters. The following characters
-- are accepted: alphanumeric characters, hyphens(-), and underscores (_).
publishBatchRequestEntry_id :: Lens.Lens' PublishBatchRequestEntry Prelude.Text
publishBatchRequestEntry_id :: Lens' PublishBatchRequestEntry Text
publishBatchRequestEntry_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Text
id :: Text
$sel:id:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
id} -> Text
id) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Text
a -> PublishBatchRequestEntry
s {$sel:id:PublishBatchRequestEntry' :: Text
id = Text
a} :: PublishBatchRequestEntry)

-- | The body of the message.
publishBatchRequestEntry_message :: Lens.Lens' PublishBatchRequestEntry Prelude.Text
publishBatchRequestEntry_message :: Lens' PublishBatchRequestEntry Text
publishBatchRequestEntry_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishBatchRequestEntry' {Text
message :: Text
$sel:message:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
message} -> Text
message) (\s :: PublishBatchRequestEntry
s@PublishBatchRequestEntry' {} Text
a -> PublishBatchRequestEntry
s {$sel:message:PublishBatchRequestEntry' :: Text
message = Text
a} :: PublishBatchRequestEntry)

instance Prelude.Hashable PublishBatchRequestEntry where
  hashWithSalt :: Int -> PublishBatchRequestEntry -> Int
hashWithSalt Int
_salt PublishBatchRequestEntry' {Maybe Text
Maybe (HashMap Text MessageAttributeValue)
Text
message :: Text
id :: Text
subject :: Maybe Text
messageStructure :: Maybe Text
messageGroupId :: Maybe Text
messageDeduplicationId :: Maybe Text
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:message:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
$sel:id:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
$sel:subject:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageStructure:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageGroupId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageDeduplicationId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageAttributes:PublishBatchRequestEntry' :: PublishBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text MessageAttributeValue)
messageAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
messageDeduplicationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
messageGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
messageStructure
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subject
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
message

instance Prelude.NFData PublishBatchRequestEntry where
  rnf :: PublishBatchRequestEntry -> ()
rnf PublishBatchRequestEntry' {Maybe Text
Maybe (HashMap Text MessageAttributeValue)
Text
message :: Text
id :: Text
subject :: Maybe Text
messageStructure :: Maybe Text
messageGroupId :: Maybe Text
messageDeduplicationId :: Maybe Text
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:message:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
$sel:id:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
$sel:subject:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageStructure:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageGroupId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageDeduplicationId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageAttributes:PublishBatchRequestEntry' :: PublishBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text MessageAttributeValue)
messageAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
messageDeduplicationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
messageGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
messageStructure
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subject
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
message

instance Data.ToQuery PublishBatchRequestEntry where
  toQuery :: PublishBatchRequestEntry -> QueryString
toQuery PublishBatchRequestEntry' {Maybe Text
Maybe (HashMap Text MessageAttributeValue)
Text
message :: Text
id :: Text
subject :: Maybe Text
messageStructure :: Maybe Text
messageGroupId :: Maybe Text
messageDeduplicationId :: Maybe Text
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:message:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
$sel:id:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Text
$sel:subject:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageStructure:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageGroupId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageDeduplicationId:PublishBatchRequestEntry' :: PublishBatchRequestEntry -> Maybe Text
$sel:messageAttributes:PublishBatchRequestEntry' :: PublishBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"MessageAttributes"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall k v.
(ToQuery k, ToQuery v) =>
ByteString
-> ByteString -> ByteString -> HashMap k v -> QueryString
Data.toQueryMap ByteString
"entry" ByteString
"Name" ByteString
"Value"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text MessageAttributeValue)
messageAttributes
            ),
        ByteString
"MessageDeduplicationId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
messageDeduplicationId,
        ByteString
"MessageGroupId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
messageGroupId,
        ByteString
"MessageStructure" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
messageStructure,
        ByteString
"Subject" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
subject,
        ByteString
"Id" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
id,
        ByteString
"Message" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
message
      ]