{-# 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.SQS.Types.SendMessageBatchRequestEntry
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SQS.Types.SendMessageBatchRequestEntry where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SQS.Types.MessageAttributeValue
import Amazonka.SQS.Types.MessageSystemAttributeNameForSends
import Amazonka.SQS.Types.MessageSystemAttributeValue

-- | Contains the details of a single Amazon SQS message along with an @Id@.
--
-- /See:/ 'newSendMessageBatchRequestEntry' smart constructor.
data SendMessageBatchRequestEntry = SendMessageBatchRequestEntry'
  { -- | Each message attribute consists of a @Name@, @Type@, and @Value@. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes Amazon SQS message attributes>
    -- in the /Amazon SQS Developer Guide/.
    SendMessageBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue),
    -- | The length of time, in seconds, for which a specific message is delayed.
    -- Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive
    -- @DelaySeconds@ value become available for processing after the delay
    -- period is finished. If you don\'t specify a value, the default value for
    -- the queue is applied.
    --
    -- When you set @FifoQueue@, you can\'t set @DelaySeconds@ per message. You
    -- can set this parameter only on a queue level.
    SendMessageBatchRequestEntry -> Maybe Int
delaySeconds :: Prelude.Maybe Prelude.Int,
    -- | The message system attribute to send Each message system attribute
    -- consists of a @Name@, @Type@, and @Value@.
    --
    -- -   Currently, the only supported message system attribute is
    --     @AWSTraceHeader@. Its type must be @String@ and its value must be a
    --     correctly formatted X-Ray trace header string.
    --
    -- -   The size of a message system attribute doesn\'t count towards the
    --     total size of a message.
    SendMessageBatchRequestEntry
-> Maybe
     (HashMap
        MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes :: Prelude.Maybe (Prelude.HashMap MessageSystemAttributeNameForSends MessageSystemAttributeValue),
    -- | This parameter applies only to FIFO (first-in-first-out) queues.
    --
    -- 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. For more information, see
    -- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html Exactly-once processing>
    -- in the /Amazon SQS Developer Guide/.
    --
    -- -   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 queue, Amazon
    --         SQS 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 queue
    --         doesn\'t have @ContentBasedDeduplication@ set, the action fails
    --         with an error.
    --
    --     -   If the queue has @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 SQS can\'t detect duplicate messages.
    --
    -- Amazon SQS 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
    -- (@!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~@).
    --
    -- For best practices of using @MessageDeduplicationId@, see
    -- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html Using the MessageDeduplicationId Property>
    -- in the /Amazon SQS Developer Guide/.
    SendMessageBatchRequestEntry -> Maybe Text
messageDeduplicationId :: Prelude.Maybe Prelude.Text,
    -- | This parameter applies only to FIFO (first-in-first-out) queues.
    --
    -- 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 queue, use @MessageGroupId@ values (for example, session data for
    -- multiple users). In this scenario, multiple consumers can process the
    -- queue, 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.
    --
    -- -   @ReceiveMessage@ might return messages with multiple
    --     @MessageGroupId@ values. For each @MessageGroupId@, the messages are
    --     sorted by time sent. The caller can\'t specify a @MessageGroupId@.
    --
    -- The length of @MessageGroupId@ is 128 characters. Valid values:
    -- alphanumeric characters and punctuation
    -- @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
    --
    -- For best practices of using @MessageGroupId@, see
    -- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html Using the MessageGroupId Property>
    -- in the /Amazon SQS Developer Guide/.
    --
    -- @MessageGroupId@ is required for FIFO queues. You can\'t use it for
    -- Standard queues.
    SendMessageBatchRequestEntry -> Maybe Text
messageGroupId :: Prelude.Maybe Prelude.Text,
    -- | An identifier for a message in this batch used to communicate the
    -- result.
    --
    -- The @Id@s of a batch request need to be unique within a request.
    --
    -- This identifier can have up to 80 characters. The following characters
    -- are accepted: alphanumeric characters, hyphens(-), and underscores (_).
    SendMessageBatchRequestEntry -> Text
id :: Prelude.Text,
    -- | The body of the message.
    SendMessageBatchRequestEntry -> Text
messageBody :: Prelude.Text
  }
  deriving (SendMessageBatchRequestEntry
-> SendMessageBatchRequestEntry -> Bool
(SendMessageBatchRequestEntry
 -> SendMessageBatchRequestEntry -> Bool)
-> (SendMessageBatchRequestEntry
    -> SendMessageBatchRequestEntry -> Bool)
-> Eq SendMessageBatchRequestEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendMessageBatchRequestEntry
-> SendMessageBatchRequestEntry -> Bool
$c/= :: SendMessageBatchRequestEntry
-> SendMessageBatchRequestEntry -> Bool
== :: SendMessageBatchRequestEntry
-> SendMessageBatchRequestEntry -> Bool
$c== :: SendMessageBatchRequestEntry
-> SendMessageBatchRequestEntry -> Bool
Prelude.Eq, ReadPrec [SendMessageBatchRequestEntry]
ReadPrec SendMessageBatchRequestEntry
Int -> ReadS SendMessageBatchRequestEntry
ReadS [SendMessageBatchRequestEntry]
(Int -> ReadS SendMessageBatchRequestEntry)
-> ReadS [SendMessageBatchRequestEntry]
-> ReadPrec SendMessageBatchRequestEntry
-> ReadPrec [SendMessageBatchRequestEntry]
-> Read SendMessageBatchRequestEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendMessageBatchRequestEntry]
$creadListPrec :: ReadPrec [SendMessageBatchRequestEntry]
readPrec :: ReadPrec SendMessageBatchRequestEntry
$creadPrec :: ReadPrec SendMessageBatchRequestEntry
readList :: ReadS [SendMessageBatchRequestEntry]
$creadList :: ReadS [SendMessageBatchRequestEntry]
readsPrec :: Int -> ReadS SendMessageBatchRequestEntry
$creadsPrec :: Int -> ReadS SendMessageBatchRequestEntry
Prelude.Read, Int -> SendMessageBatchRequestEntry -> ShowS
[SendMessageBatchRequestEntry] -> ShowS
SendMessageBatchRequestEntry -> String
(Int -> SendMessageBatchRequestEntry -> ShowS)
-> (SendMessageBatchRequestEntry -> String)
-> ([SendMessageBatchRequestEntry] -> ShowS)
-> Show SendMessageBatchRequestEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendMessageBatchRequestEntry] -> ShowS
$cshowList :: [SendMessageBatchRequestEntry] -> ShowS
show :: SendMessageBatchRequestEntry -> String
$cshow :: SendMessageBatchRequestEntry -> String
showsPrec :: Int -> SendMessageBatchRequestEntry -> ShowS
$cshowsPrec :: Int -> SendMessageBatchRequestEntry -> ShowS
Prelude.Show, (forall x.
 SendMessageBatchRequestEntry -> Rep SendMessageBatchRequestEntry x)
-> (forall x.
    Rep SendMessageBatchRequestEntry x -> SendMessageBatchRequestEntry)
-> Generic SendMessageBatchRequestEntry
forall x.
Rep SendMessageBatchRequestEntry x -> SendMessageBatchRequestEntry
forall x.
SendMessageBatchRequestEntry -> Rep SendMessageBatchRequestEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendMessageBatchRequestEntry x -> SendMessageBatchRequestEntry
$cfrom :: forall x.
SendMessageBatchRequestEntry -> Rep SendMessageBatchRequestEntry x
Prelude.Generic)

-- |
-- Create a value of 'SendMessageBatchRequestEntry' 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', 'sendMessageBatchRequestEntry_messageAttributes' - Each message attribute consists of a @Name@, @Type@, and @Value@. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes Amazon SQS message attributes>
-- in the /Amazon SQS Developer Guide/.
--
-- 'delaySeconds', 'sendMessageBatchRequestEntry_delaySeconds' - The length of time, in seconds, for which a specific message is delayed.
-- Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive
-- @DelaySeconds@ value become available for processing after the delay
-- period is finished. If you don\'t specify a value, the default value for
-- the queue is applied.
--
-- When you set @FifoQueue@, you can\'t set @DelaySeconds@ per message. You
-- can set this parameter only on a queue level.
--
-- 'messageSystemAttributes', 'sendMessageBatchRequestEntry_messageSystemAttributes' - The message system attribute to send Each message system attribute
-- consists of a @Name@, @Type@, and @Value@.
--
-- -   Currently, the only supported message system attribute is
--     @AWSTraceHeader@. Its type must be @String@ and its value must be a
--     correctly formatted X-Ray trace header string.
--
-- -   The size of a message system attribute doesn\'t count towards the
--     total size of a message.
--
-- 'messageDeduplicationId', 'sendMessageBatchRequestEntry_messageDeduplicationId' - This parameter applies only to FIFO (first-in-first-out) queues.
--
-- 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. For more information, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html Exactly-once processing>
-- in the /Amazon SQS Developer Guide/.
--
-- -   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 queue, Amazon
--         SQS 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 queue
--         doesn\'t have @ContentBasedDeduplication@ set, the action fails
--         with an error.
--
--     -   If the queue has @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 SQS can\'t detect duplicate messages.
--
-- Amazon SQS 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
-- (@!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~@).
--
-- For best practices of using @MessageDeduplicationId@, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html Using the MessageDeduplicationId Property>
-- in the /Amazon SQS Developer Guide/.
--
-- 'messageGroupId', 'sendMessageBatchRequestEntry_messageGroupId' - This parameter applies only to FIFO (first-in-first-out) queues.
--
-- 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 queue, use @MessageGroupId@ values (for example, session data for
-- multiple users). In this scenario, multiple consumers can process the
-- queue, 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.
--
-- -   @ReceiveMessage@ might return messages with multiple
--     @MessageGroupId@ values. For each @MessageGroupId@, the messages are
--     sorted by time sent. The caller can\'t specify a @MessageGroupId@.
--
-- The length of @MessageGroupId@ is 128 characters. Valid values:
-- alphanumeric characters and punctuation
-- @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
--
-- For best practices of using @MessageGroupId@, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html Using the MessageGroupId Property>
-- in the /Amazon SQS Developer Guide/.
--
-- @MessageGroupId@ is required for FIFO queues. You can\'t use it for
-- Standard queues.
--
-- 'id', 'sendMessageBatchRequestEntry_id' - An identifier for a message in this batch used to communicate the
-- result.
--
-- The @Id@s of a batch request need to be unique within a request.
--
-- This identifier can have up to 80 characters. The following characters
-- are accepted: alphanumeric characters, hyphens(-), and underscores (_).
--
-- 'messageBody', 'sendMessageBatchRequestEntry_messageBody' - The body of the message.
newSendMessageBatchRequestEntry ::
  -- | 'id'
  Prelude.Text ->
  -- | 'messageBody'
  Prelude.Text ->
  SendMessageBatchRequestEntry
newSendMessageBatchRequestEntry :: Text -> Text -> SendMessageBatchRequestEntry
newSendMessageBatchRequestEntry Text
pId_ Text
pMessageBody_ =
  SendMessageBatchRequestEntry' :: Maybe (HashMap Text MessageAttributeValue)
-> Maybe Int
-> Maybe
     (HashMap
        MessageSystemAttributeNameForSends MessageSystemAttributeValue)
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> SendMessageBatchRequestEntry
SendMessageBatchRequestEntry'
    { $sel:messageAttributes:SendMessageBatchRequestEntry' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes =
        Maybe (HashMap Text MessageAttributeValue)
forall a. Maybe a
Prelude.Nothing,
      $sel:delaySeconds:SendMessageBatchRequestEntry' :: Maybe Int
delaySeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:messageSystemAttributes:SendMessageBatchRequestEntry' :: Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes = Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
forall a. Maybe a
Prelude.Nothing,
      $sel:messageDeduplicationId:SendMessageBatchRequestEntry' :: Maybe Text
messageDeduplicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageGroupId:SendMessageBatchRequestEntry' :: Maybe Text
messageGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:SendMessageBatchRequestEntry' :: Text
id = Text
pId_,
      $sel:messageBody:SendMessageBatchRequestEntry' :: Text
messageBody = Text
pMessageBody_
    }

-- | Each message attribute consists of a @Name@, @Type@, and @Value@. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes Amazon SQS message attributes>
-- in the /Amazon SQS Developer Guide/.
sendMessageBatchRequestEntry_messageAttributes :: Lens.Lens' SendMessageBatchRequestEntry (Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue))
sendMessageBatchRequestEntry_messageAttributes :: (Maybe (HashMap Text MessageAttributeValue)
 -> f (Maybe (HashMap Text MessageAttributeValue)))
-> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry
sendMessageBatchRequestEntry_messageAttributes = (SendMessageBatchRequestEntry
 -> Maybe (HashMap Text MessageAttributeValue))
-> (SendMessageBatchRequestEntry
    -> Maybe (HashMap Text MessageAttributeValue)
    -> SendMessageBatchRequestEntry)
-> Lens
     SendMessageBatchRequestEntry
     SendMessageBatchRequestEntry
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchRequestEntry' {Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:messageAttributes:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
messageAttributes} -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes) (\s :: SendMessageBatchRequestEntry
s@SendMessageBatchRequestEntry' {} Maybe (HashMap Text MessageAttributeValue)
a -> SendMessageBatchRequestEntry
s {$sel:messageAttributes:SendMessageBatchRequestEntry' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes = Maybe (HashMap Text MessageAttributeValue)
a} :: SendMessageBatchRequestEntry) ((Maybe (HashMap Text MessageAttributeValue)
  -> f (Maybe (HashMap Text MessageAttributeValue)))
 -> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry)
-> ((Maybe (HashMap Text MessageAttributeValue)
     -> f (Maybe (HashMap Text MessageAttributeValue)))
    -> Maybe (HashMap Text MessageAttributeValue)
    -> f (Maybe (HashMap Text MessageAttributeValue)))
-> (Maybe (HashMap Text MessageAttributeValue)
    -> f (Maybe (HashMap Text MessageAttributeValue)))
-> SendMessageBatchRequestEntry
-> f SendMessageBatchRequestEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
-> Iso
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
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 MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The length of time, in seconds, for which a specific message is delayed.
-- Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive
-- @DelaySeconds@ value become available for processing after the delay
-- period is finished. If you don\'t specify a value, the default value for
-- the queue is applied.
--
-- When you set @FifoQueue@, you can\'t set @DelaySeconds@ per message. You
-- can set this parameter only on a queue level.
sendMessageBatchRequestEntry_delaySeconds :: Lens.Lens' SendMessageBatchRequestEntry (Prelude.Maybe Prelude.Int)
sendMessageBatchRequestEntry_delaySeconds :: (Maybe Int -> f (Maybe Int))
-> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry
sendMessageBatchRequestEntry_delaySeconds = (SendMessageBatchRequestEntry -> Maybe Int)
-> (SendMessageBatchRequestEntry
    -> Maybe Int -> SendMessageBatchRequestEntry)
-> Lens
     SendMessageBatchRequestEntry
     SendMessageBatchRequestEntry
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchRequestEntry' {Maybe Int
delaySeconds :: Maybe Int
$sel:delaySeconds:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Maybe Int
delaySeconds} -> Maybe Int
delaySeconds) (\s :: SendMessageBatchRequestEntry
s@SendMessageBatchRequestEntry' {} Maybe Int
a -> SendMessageBatchRequestEntry
s {$sel:delaySeconds:SendMessageBatchRequestEntry' :: Maybe Int
delaySeconds = Maybe Int
a} :: SendMessageBatchRequestEntry)

-- | The message system attribute to send Each message system attribute
-- consists of a @Name@, @Type@, and @Value@.
--
-- -   Currently, the only supported message system attribute is
--     @AWSTraceHeader@. Its type must be @String@ and its value must be a
--     correctly formatted X-Ray trace header string.
--
-- -   The size of a message system attribute doesn\'t count towards the
--     total size of a message.
sendMessageBatchRequestEntry_messageSystemAttributes :: Lens.Lens' SendMessageBatchRequestEntry (Prelude.Maybe (Prelude.HashMap MessageSystemAttributeNameForSends MessageSystemAttributeValue))
sendMessageBatchRequestEntry_messageSystemAttributes :: (Maybe
   (HashMap
      MessageSystemAttributeNameForSends MessageSystemAttributeValue)
 -> f (Maybe
         (HashMap
            MessageSystemAttributeNameForSends MessageSystemAttributeValue)))
-> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry
sendMessageBatchRequestEntry_messageSystemAttributes = (SendMessageBatchRequestEntry
 -> Maybe
      (HashMap
         MessageSystemAttributeNameForSends MessageSystemAttributeValue))
-> (SendMessageBatchRequestEntry
    -> Maybe
         (HashMap
            MessageSystemAttributeNameForSends MessageSystemAttributeValue)
    -> SendMessageBatchRequestEntry)
-> Lens
     SendMessageBatchRequestEntry
     SendMessageBatchRequestEntry
     (Maybe
        (HashMap
           MessageSystemAttributeNameForSends MessageSystemAttributeValue))
     (Maybe
        (HashMap
           MessageSystemAttributeNameForSends MessageSystemAttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchRequestEntry' {Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes :: Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
$sel:messageSystemAttributes:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry
-> Maybe
     (HashMap
        MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes} -> Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes) (\s :: SendMessageBatchRequestEntry
s@SendMessageBatchRequestEntry' {} Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
a -> SendMessageBatchRequestEntry
s {$sel:messageSystemAttributes:SendMessageBatchRequestEntry' :: Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes = Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
a} :: SendMessageBatchRequestEntry) ((Maybe
    (HashMap
       MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  -> f (Maybe
          (HashMap
             MessageSystemAttributeNameForSends MessageSystemAttributeValue)))
 -> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry)
-> ((Maybe
       (HashMap
          MessageSystemAttributeNameForSends MessageSystemAttributeValue)
     -> f (Maybe
             (HashMap
                MessageSystemAttributeNameForSends MessageSystemAttributeValue)))
    -> Maybe
         (HashMap
            MessageSystemAttributeNameForSends MessageSystemAttributeValue)
    -> f (Maybe
            (HashMap
               MessageSystemAttributeNameForSends MessageSystemAttributeValue)))
-> (Maybe
      (HashMap
         MessageSystemAttributeNameForSends MessageSystemAttributeValue)
    -> f (Maybe
            (HashMap
               MessageSystemAttributeNameForSends MessageSystemAttributeValue)))
-> SendMessageBatchRequestEntry
-> f SendMessageBatchRequestEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
-> Iso
     (Maybe
        (HashMap
           MessageSystemAttributeNameForSends MessageSystemAttributeValue))
     (Maybe
        (HashMap
           MessageSystemAttributeNameForSends MessageSystemAttributeValue))
     (Maybe
        (HashMap
           MessageSystemAttributeNameForSends MessageSystemAttributeValue))
     (Maybe
        (HashMap
           MessageSystemAttributeNameForSends MessageSystemAttributeValue))
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
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
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) queues.
--
-- 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. For more information, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html Exactly-once processing>
-- in the /Amazon SQS Developer Guide/.
--
-- -   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 queue, Amazon
--         SQS 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 queue
--         doesn\'t have @ContentBasedDeduplication@ set, the action fails
--         with an error.
--
--     -   If the queue has @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 SQS can\'t detect duplicate messages.
--
-- Amazon SQS 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
-- (@!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~@).
--
-- For best practices of using @MessageDeduplicationId@, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html Using the MessageDeduplicationId Property>
-- in the /Amazon SQS Developer Guide/.
sendMessageBatchRequestEntry_messageDeduplicationId :: Lens.Lens' SendMessageBatchRequestEntry (Prelude.Maybe Prelude.Text)
sendMessageBatchRequestEntry_messageDeduplicationId :: (Maybe Text -> f (Maybe Text))
-> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry
sendMessageBatchRequestEntry_messageDeduplicationId = (SendMessageBatchRequestEntry -> Maybe Text)
-> (SendMessageBatchRequestEntry
    -> Maybe Text -> SendMessageBatchRequestEntry)
-> Lens
     SendMessageBatchRequestEntry
     SendMessageBatchRequestEntry
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchRequestEntry' {Maybe Text
messageDeduplicationId :: Maybe Text
$sel:messageDeduplicationId:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Maybe Text
messageDeduplicationId} -> Maybe Text
messageDeduplicationId) (\s :: SendMessageBatchRequestEntry
s@SendMessageBatchRequestEntry' {} Maybe Text
a -> SendMessageBatchRequestEntry
s {$sel:messageDeduplicationId:SendMessageBatchRequestEntry' :: Maybe Text
messageDeduplicationId = Maybe Text
a} :: SendMessageBatchRequestEntry)

-- | This parameter applies only to FIFO (first-in-first-out) queues.
--
-- 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 queue, use @MessageGroupId@ values (for example, session data for
-- multiple users). In this scenario, multiple consumers can process the
-- queue, 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.
--
-- -   @ReceiveMessage@ might return messages with multiple
--     @MessageGroupId@ values. For each @MessageGroupId@, the messages are
--     sorted by time sent. The caller can\'t specify a @MessageGroupId@.
--
-- The length of @MessageGroupId@ is 128 characters. Valid values:
-- alphanumeric characters and punctuation
-- @(!\"#$%&\'()*+,-.\/:;\<=>?\@[\\]^_\`{|}~)@.
--
-- For best practices of using @MessageGroupId@, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html Using the MessageGroupId Property>
-- in the /Amazon SQS Developer Guide/.
--
-- @MessageGroupId@ is required for FIFO queues. You can\'t use it for
-- Standard queues.
sendMessageBatchRequestEntry_messageGroupId :: Lens.Lens' SendMessageBatchRequestEntry (Prelude.Maybe Prelude.Text)
sendMessageBatchRequestEntry_messageGroupId :: (Maybe Text -> f (Maybe Text))
-> SendMessageBatchRequestEntry -> f SendMessageBatchRequestEntry
sendMessageBatchRequestEntry_messageGroupId = (SendMessageBatchRequestEntry -> Maybe Text)
-> (SendMessageBatchRequestEntry
    -> Maybe Text -> SendMessageBatchRequestEntry)
-> Lens
     SendMessageBatchRequestEntry
     SendMessageBatchRequestEntry
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchRequestEntry' {Maybe Text
messageGroupId :: Maybe Text
$sel:messageGroupId:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Maybe Text
messageGroupId} -> Maybe Text
messageGroupId) (\s :: SendMessageBatchRequestEntry
s@SendMessageBatchRequestEntry' {} Maybe Text
a -> SendMessageBatchRequestEntry
s {$sel:messageGroupId:SendMessageBatchRequestEntry' :: Maybe Text
messageGroupId = Maybe Text
a} :: SendMessageBatchRequestEntry)

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

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

instance
  Prelude.Hashable
    SendMessageBatchRequestEntry

instance Prelude.NFData SendMessageBatchRequestEntry

instance Core.ToQuery SendMessageBatchRequestEntry where
  toQuery :: SendMessageBatchRequestEntry -> QueryString
toQuery SendMessageBatchRequestEntry' {Maybe Int
Maybe Text
Maybe (HashMap Text MessageAttributeValue)
Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
Text
messageBody :: Text
id :: Text
messageGroupId :: Maybe Text
messageDeduplicationId :: Maybe Text
messageSystemAttributes :: Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
delaySeconds :: Maybe Int
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:messageBody:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Text
$sel:id:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Text
$sel:messageGroupId:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Maybe Text
$sel:messageDeduplicationId:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Maybe Text
$sel:messageSystemAttributes:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry
-> Maybe
     (HashMap
        MessageSystemAttributeNameForSends MessageSystemAttributeValue)
$sel:delaySeconds:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry -> Maybe Int
$sel:messageAttributes:SendMessageBatchRequestEntry' :: SendMessageBatchRequestEntry
-> Maybe (HashMap Text MessageAttributeValue)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
          ( ByteString
-> ByteString
-> ByteString
-> HashMap Text MessageAttributeValue
-> QueryString
forall k v.
(ToQuery k, ToQuery v) =>
ByteString
-> ByteString -> ByteString -> HashMap k v -> QueryString
Core.toQueryMap ByteString
"MessageAttribute" ByteString
"Name" ByteString
"Value"
              (HashMap Text MessageAttributeValue -> QueryString)
-> Maybe (HashMap Text MessageAttributeValue) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text MessageAttributeValue)
messageAttributes
          ),
        ByteString
"DelaySeconds" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
delaySeconds,
        Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
          ( ByteString
-> ByteString
-> ByteString
-> HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue
-> QueryString
forall k v.
(ToQuery k, ToQuery v) =>
ByteString
-> ByteString -> ByteString -> HashMap k v -> QueryString
Core.toQueryMap
              ByteString
"MessageSystemAttribute"
              ByteString
"Name"
              ByteString
"Value"
              (HashMap
   MessageSystemAttributeNameForSends MessageSystemAttributeValue
 -> QueryString)
-> Maybe
     (HashMap
        MessageSystemAttributeNameForSends MessageSystemAttributeValue)
-> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe
  (HashMap
     MessageSystemAttributeNameForSends MessageSystemAttributeValue)
messageSystemAttributes
          ),
        ByteString
"MessageDeduplicationId"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
messageDeduplicationId,
        ByteString
"MessageGroupId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
messageGroupId,
        ByteString
"Id" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
id,
        ByteString
"MessageBody" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
messageBody
      ]