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

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

-- |
-- Module      : Amazonka.SQS.SendMessageBatch
-- 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)
--
-- Delivers up to ten messages to the specified queue. This is a batch
-- version of @ SendMessage.@ For a FIFO queue, multiple messages within a
-- single batch are enqueued in the order they are sent.
--
-- The result of sending each message is reported individually in the
-- response. Because the batch request can result in a combination of
-- successful and unsuccessful actions, you should check for batch errors
-- even when the call returns an HTTP status code of @200@.
--
-- The maximum allowed individual message size and the maximum total
-- payload size (the sum of the individual lengths of all of the batched
-- messages) are both 256 KB (262,144 bytes).
--
-- A message can include only XML, JSON, and unformatted text. The
-- following Unicode characters are allowed:
--
-- @#x9@ | @#xA@ | @#xD@ | @#x20@ to @#xD7FF@ | @#xE000@ to @#xFFFD@ |
-- @#x10000@ to @#x10FFFF@
--
-- Any characters not included in this list will be rejected. For more
-- information, see the
-- <http://www.w3.org/TR/REC-xml/#charsets W3C specification for characters>.
--
-- If you don\'t specify the @DelaySeconds@ parameter for an entry, Amazon
-- SQS uses the default value for the queue.
--
-- Some actions take lists of parameters. These lists are specified using
-- the @param.n@ notation. Values of @n@ are integers starting from 1. For
-- example, a parameter list with two elements looks like this:
--
-- @&AttributeName.1=first@
--
-- @&AttributeName.2=second@
module Amazonka.SQS.SendMessageBatch
  ( -- * Creating a Request
    SendMessageBatch (..),
    newSendMessageBatch,

    -- * Request Lenses
    sendMessageBatch_queueUrl,
    sendMessageBatch_entries,

    -- * Destructuring the Response
    SendMessageBatchResponse (..),
    newSendMessageBatchResponse,

    -- * Response Lenses
    sendMessageBatchResponse_httpStatus,
    sendMessageBatchResponse_successful,
    sendMessageBatchResponse_failed,
  )
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.SQS.Types

-- |
--
-- /See:/ 'newSendMessageBatch' smart constructor.
data SendMessageBatch = SendMessageBatch'
  { -- | The URL of the Amazon SQS queue to which batched messages are sent.
    --
    -- Queue URLs and names are case-sensitive.
    SendMessageBatch -> Text
queueUrl :: Prelude.Text,
    -- | A list of @ SendMessageBatchRequestEntry @ items.
    SendMessageBatch -> [SendMessageBatchRequestEntry]
entries :: [SendMessageBatchRequestEntry]
  }
  deriving (SendMessageBatch -> SendMessageBatch -> Bool
(SendMessageBatch -> SendMessageBatch -> Bool)
-> (SendMessageBatch -> SendMessageBatch -> Bool)
-> Eq SendMessageBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendMessageBatch -> SendMessageBatch -> Bool
$c/= :: SendMessageBatch -> SendMessageBatch -> Bool
== :: SendMessageBatch -> SendMessageBatch -> Bool
$c== :: SendMessageBatch -> SendMessageBatch -> Bool
Prelude.Eq, ReadPrec [SendMessageBatch]
ReadPrec SendMessageBatch
Int -> ReadS SendMessageBatch
ReadS [SendMessageBatch]
(Int -> ReadS SendMessageBatch)
-> ReadS [SendMessageBatch]
-> ReadPrec SendMessageBatch
-> ReadPrec [SendMessageBatch]
-> Read SendMessageBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendMessageBatch]
$creadListPrec :: ReadPrec [SendMessageBatch]
readPrec :: ReadPrec SendMessageBatch
$creadPrec :: ReadPrec SendMessageBatch
readList :: ReadS [SendMessageBatch]
$creadList :: ReadS [SendMessageBatch]
readsPrec :: Int -> ReadS SendMessageBatch
$creadsPrec :: Int -> ReadS SendMessageBatch
Prelude.Read, Int -> SendMessageBatch -> ShowS
[SendMessageBatch] -> ShowS
SendMessageBatch -> String
(Int -> SendMessageBatch -> ShowS)
-> (SendMessageBatch -> String)
-> ([SendMessageBatch] -> ShowS)
-> Show SendMessageBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendMessageBatch] -> ShowS
$cshowList :: [SendMessageBatch] -> ShowS
show :: SendMessageBatch -> String
$cshow :: SendMessageBatch -> String
showsPrec :: Int -> SendMessageBatch -> ShowS
$cshowsPrec :: Int -> SendMessageBatch -> ShowS
Prelude.Show, (forall x. SendMessageBatch -> Rep SendMessageBatch x)
-> (forall x. Rep SendMessageBatch x -> SendMessageBatch)
-> Generic SendMessageBatch
forall x. Rep SendMessageBatch x -> SendMessageBatch
forall x. SendMessageBatch -> Rep SendMessageBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendMessageBatch x -> SendMessageBatch
$cfrom :: forall x. SendMessageBatch -> Rep SendMessageBatch x
Prelude.Generic)

-- |
-- Create a value of 'SendMessageBatch' 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:
--
-- 'queueUrl', 'sendMessageBatch_queueUrl' - The URL of the Amazon SQS queue to which batched messages are sent.
--
-- Queue URLs and names are case-sensitive.
--
-- 'entries', 'sendMessageBatch_entries' - A list of @ SendMessageBatchRequestEntry @ items.
newSendMessageBatch ::
  -- | 'queueUrl'
  Prelude.Text ->
  SendMessageBatch
newSendMessageBatch :: Text -> SendMessageBatch
newSendMessageBatch Text
pQueueUrl_ =
  SendMessageBatch' :: Text -> [SendMessageBatchRequestEntry] -> SendMessageBatch
SendMessageBatch'
    { $sel:queueUrl:SendMessageBatch' :: Text
queueUrl = Text
pQueueUrl_,
      $sel:entries:SendMessageBatch' :: [SendMessageBatchRequestEntry]
entries = [SendMessageBatchRequestEntry]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The URL of the Amazon SQS queue to which batched messages are sent.
--
-- Queue URLs and names are case-sensitive.
sendMessageBatch_queueUrl :: Lens.Lens' SendMessageBatch Prelude.Text
sendMessageBatch_queueUrl :: (Text -> f Text) -> SendMessageBatch -> f SendMessageBatch
sendMessageBatch_queueUrl = (SendMessageBatch -> Text)
-> (SendMessageBatch -> Text -> SendMessageBatch)
-> Lens SendMessageBatch SendMessageBatch Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatch' {Text
queueUrl :: Text
$sel:queueUrl:SendMessageBatch' :: SendMessageBatch -> Text
queueUrl} -> Text
queueUrl) (\s :: SendMessageBatch
s@SendMessageBatch' {} Text
a -> SendMessageBatch
s {$sel:queueUrl:SendMessageBatch' :: Text
queueUrl = Text
a} :: SendMessageBatch)

-- | A list of @ SendMessageBatchRequestEntry @ items.
sendMessageBatch_entries :: Lens.Lens' SendMessageBatch [SendMessageBatchRequestEntry]
sendMessageBatch_entries :: ([SendMessageBatchRequestEntry]
 -> f [SendMessageBatchRequestEntry])
-> SendMessageBatch -> f SendMessageBatch
sendMessageBatch_entries = (SendMessageBatch -> [SendMessageBatchRequestEntry])
-> (SendMessageBatch
    -> [SendMessageBatchRequestEntry] -> SendMessageBatch)
-> Lens
     SendMessageBatch
     SendMessageBatch
     [SendMessageBatchRequestEntry]
     [SendMessageBatchRequestEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatch' {[SendMessageBatchRequestEntry]
entries :: [SendMessageBatchRequestEntry]
$sel:entries:SendMessageBatch' :: SendMessageBatch -> [SendMessageBatchRequestEntry]
entries} -> [SendMessageBatchRequestEntry]
entries) (\s :: SendMessageBatch
s@SendMessageBatch' {} [SendMessageBatchRequestEntry]
a -> SendMessageBatch
s {$sel:entries:SendMessageBatch' :: [SendMessageBatchRequestEntry]
entries = [SendMessageBatchRequestEntry]
a} :: SendMessageBatch) (([SendMessageBatchRequestEntry]
  -> f [SendMessageBatchRequestEntry])
 -> SendMessageBatch -> f SendMessageBatch)
-> (([SendMessageBatchRequestEntry]
     -> f [SendMessageBatchRequestEntry])
    -> [SendMessageBatchRequestEntry]
    -> f [SendMessageBatchRequestEntry])
-> ([SendMessageBatchRequestEntry]
    -> f [SendMessageBatchRequestEntry])
-> SendMessageBatch
-> f SendMessageBatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SendMessageBatchRequestEntry]
 -> f [SendMessageBatchRequestEntry])
-> [SendMessageBatchRequestEntry]
-> f [SendMessageBatchRequestEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SendMessageBatch where
  type
    AWSResponse SendMessageBatch =
      SendMessageBatchResponse
  request :: SendMessageBatch -> Request SendMessageBatch
request = Service -> SendMessageBatch -> Request SendMessageBatch
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy SendMessageBatch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendMessageBatch)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse SendMessageBatch))
-> Logger
-> Service
-> Proxy SendMessageBatch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendMessageBatch)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"SendMessageBatchResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int
-> [SendMessageBatchResultEntry]
-> [BatchResultErrorEntry]
-> SendMessageBatchResponse
SendMessageBatchResponse'
            (Int
 -> [SendMessageBatchResultEntry]
 -> [BatchResultErrorEntry]
 -> SendMessageBatchResponse)
-> Either String Int
-> Either
     String
     ([SendMessageBatchResultEntry]
      -> [BatchResultErrorEntry] -> SendMessageBatchResponse)
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
  ([SendMessageBatchResultEntry]
   -> [BatchResultErrorEntry] -> SendMessageBatchResponse)
-> Either String [SendMessageBatchResultEntry]
-> Either
     String ([BatchResultErrorEntry] -> SendMessageBatchResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Text -> [Node] -> Either String [SendMessageBatchResultEntry]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"SendMessageBatchResultEntry" [Node]
x)
            Either String ([BatchResultErrorEntry] -> SendMessageBatchResponse)
-> Either String [BatchResultErrorEntry]
-> Either String SendMessageBatchResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Text -> [Node] -> Either String [BatchResultErrorEntry]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"BatchResultErrorEntry" [Node]
x)
      )

instance Prelude.Hashable SendMessageBatch

instance Prelude.NFData SendMessageBatch

instance Core.ToHeaders SendMessageBatch where
  toHeaders :: SendMessageBatch -> ResponseHeaders
toHeaders = ResponseHeaders -> SendMessageBatch -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath SendMessageBatch where
  toPath :: SendMessageBatch -> ByteString
toPath = ByteString -> SendMessageBatch -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery SendMessageBatch where
  toQuery :: SendMessageBatch -> QueryString
toQuery SendMessageBatch' {[SendMessageBatchRequestEntry]
Text
entries :: [SendMessageBatchRequestEntry]
queueUrl :: Text
$sel:entries:SendMessageBatch' :: SendMessageBatch -> [SendMessageBatchRequestEntry]
$sel:queueUrl:SendMessageBatch' :: SendMessageBatch -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SendMessageBatch" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-11-05" :: Prelude.ByteString),
        ByteString
"QueueUrl" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
queueUrl,
        ByteString -> [SendMessageBatchRequestEntry] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList
          ByteString
"SendMessageBatchRequestEntry"
          [SendMessageBatchRequestEntry]
entries
      ]

-- | For each message in the batch, the response contains a
-- @ SendMessageBatchResultEntry @ tag if the message succeeds or a
-- @ BatchResultErrorEntry @ tag if the message fails.
--
-- /See:/ 'newSendMessageBatchResponse' smart constructor.
data SendMessageBatchResponse = SendMessageBatchResponse'
  { -- | The response's http status code.
    SendMessageBatchResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of @ SendMessageBatchResultEntry @ items.
    SendMessageBatchResponse -> [SendMessageBatchResultEntry]
successful :: [SendMessageBatchResultEntry],
    -- | A list of @ BatchResultErrorEntry @ items with error details about each
    -- message that can\'t be enqueued.
    SendMessageBatchResponse -> [BatchResultErrorEntry]
failed :: [BatchResultErrorEntry]
  }
  deriving (SendMessageBatchResponse -> SendMessageBatchResponse -> Bool
(SendMessageBatchResponse -> SendMessageBatchResponse -> Bool)
-> (SendMessageBatchResponse -> SendMessageBatchResponse -> Bool)
-> Eq SendMessageBatchResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendMessageBatchResponse -> SendMessageBatchResponse -> Bool
$c/= :: SendMessageBatchResponse -> SendMessageBatchResponse -> Bool
== :: SendMessageBatchResponse -> SendMessageBatchResponse -> Bool
$c== :: SendMessageBatchResponse -> SendMessageBatchResponse -> Bool
Prelude.Eq, ReadPrec [SendMessageBatchResponse]
ReadPrec SendMessageBatchResponse
Int -> ReadS SendMessageBatchResponse
ReadS [SendMessageBatchResponse]
(Int -> ReadS SendMessageBatchResponse)
-> ReadS [SendMessageBatchResponse]
-> ReadPrec SendMessageBatchResponse
-> ReadPrec [SendMessageBatchResponse]
-> Read SendMessageBatchResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendMessageBatchResponse]
$creadListPrec :: ReadPrec [SendMessageBatchResponse]
readPrec :: ReadPrec SendMessageBatchResponse
$creadPrec :: ReadPrec SendMessageBatchResponse
readList :: ReadS [SendMessageBatchResponse]
$creadList :: ReadS [SendMessageBatchResponse]
readsPrec :: Int -> ReadS SendMessageBatchResponse
$creadsPrec :: Int -> ReadS SendMessageBatchResponse
Prelude.Read, Int -> SendMessageBatchResponse -> ShowS
[SendMessageBatchResponse] -> ShowS
SendMessageBatchResponse -> String
(Int -> SendMessageBatchResponse -> ShowS)
-> (SendMessageBatchResponse -> String)
-> ([SendMessageBatchResponse] -> ShowS)
-> Show SendMessageBatchResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendMessageBatchResponse] -> ShowS
$cshowList :: [SendMessageBatchResponse] -> ShowS
show :: SendMessageBatchResponse -> String
$cshow :: SendMessageBatchResponse -> String
showsPrec :: Int -> SendMessageBatchResponse -> ShowS
$cshowsPrec :: Int -> SendMessageBatchResponse -> ShowS
Prelude.Show, (forall x.
 SendMessageBatchResponse -> Rep SendMessageBatchResponse x)
-> (forall x.
    Rep SendMessageBatchResponse x -> SendMessageBatchResponse)
-> Generic SendMessageBatchResponse
forall x.
Rep SendMessageBatchResponse x -> SendMessageBatchResponse
forall x.
SendMessageBatchResponse -> Rep SendMessageBatchResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendMessageBatchResponse x -> SendMessageBatchResponse
$cfrom :: forall x.
SendMessageBatchResponse -> Rep SendMessageBatchResponse x
Prelude.Generic)

-- |
-- Create a value of 'SendMessageBatchResponse' 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:
--
-- 'httpStatus', 'sendMessageBatchResponse_httpStatus' - The response's http status code.
--
-- 'successful', 'sendMessageBatchResponse_successful' - A list of @ SendMessageBatchResultEntry @ items.
--
-- 'failed', 'sendMessageBatchResponse_failed' - A list of @ BatchResultErrorEntry @ items with error details about each
-- message that can\'t be enqueued.
newSendMessageBatchResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SendMessageBatchResponse
newSendMessageBatchResponse :: Int -> SendMessageBatchResponse
newSendMessageBatchResponse Int
pHttpStatus_ =
  SendMessageBatchResponse' :: Int
-> [SendMessageBatchResultEntry]
-> [BatchResultErrorEntry]
-> SendMessageBatchResponse
SendMessageBatchResponse'
    { $sel:httpStatus:SendMessageBatchResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:successful:SendMessageBatchResponse' :: [SendMessageBatchResultEntry]
successful = [SendMessageBatchResultEntry]
forall a. Monoid a => a
Prelude.mempty,
      $sel:failed:SendMessageBatchResponse' :: [BatchResultErrorEntry]
failed = [BatchResultErrorEntry]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The response's http status code.
sendMessageBatchResponse_httpStatus :: Lens.Lens' SendMessageBatchResponse Prelude.Int
sendMessageBatchResponse_httpStatus :: (Int -> f Int)
-> SendMessageBatchResponse -> f SendMessageBatchResponse
sendMessageBatchResponse_httpStatus = (SendMessageBatchResponse -> Int)
-> (SendMessageBatchResponse -> Int -> SendMessageBatchResponse)
-> Lens SendMessageBatchResponse SendMessageBatchResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendMessageBatchResponse' :: SendMessageBatchResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendMessageBatchResponse
s@SendMessageBatchResponse' {} Int
a -> SendMessageBatchResponse
s {$sel:httpStatus:SendMessageBatchResponse' :: Int
httpStatus = Int
a} :: SendMessageBatchResponse)

-- | A list of @ SendMessageBatchResultEntry @ items.
sendMessageBatchResponse_successful :: Lens.Lens' SendMessageBatchResponse [SendMessageBatchResultEntry]
sendMessageBatchResponse_successful :: ([SendMessageBatchResultEntry] -> f [SendMessageBatchResultEntry])
-> SendMessageBatchResponse -> f SendMessageBatchResponse
sendMessageBatchResponse_successful = (SendMessageBatchResponse -> [SendMessageBatchResultEntry])
-> (SendMessageBatchResponse
    -> [SendMessageBatchResultEntry] -> SendMessageBatchResponse)
-> Lens
     SendMessageBatchResponse
     SendMessageBatchResponse
     [SendMessageBatchResultEntry]
     [SendMessageBatchResultEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchResponse' {[SendMessageBatchResultEntry]
successful :: [SendMessageBatchResultEntry]
$sel:successful:SendMessageBatchResponse' :: SendMessageBatchResponse -> [SendMessageBatchResultEntry]
successful} -> [SendMessageBatchResultEntry]
successful) (\s :: SendMessageBatchResponse
s@SendMessageBatchResponse' {} [SendMessageBatchResultEntry]
a -> SendMessageBatchResponse
s {$sel:successful:SendMessageBatchResponse' :: [SendMessageBatchResultEntry]
successful = [SendMessageBatchResultEntry]
a} :: SendMessageBatchResponse) (([SendMessageBatchResultEntry] -> f [SendMessageBatchResultEntry])
 -> SendMessageBatchResponse -> f SendMessageBatchResponse)
-> (([SendMessageBatchResultEntry]
     -> f [SendMessageBatchResultEntry])
    -> [SendMessageBatchResultEntry]
    -> f [SendMessageBatchResultEntry])
-> ([SendMessageBatchResultEntry]
    -> f [SendMessageBatchResultEntry])
-> SendMessageBatchResponse
-> f SendMessageBatchResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SendMessageBatchResultEntry] -> f [SendMessageBatchResultEntry])
-> [SendMessageBatchResultEntry] -> f [SendMessageBatchResultEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of @ BatchResultErrorEntry @ items with error details about each
-- message that can\'t be enqueued.
sendMessageBatchResponse_failed :: Lens.Lens' SendMessageBatchResponse [BatchResultErrorEntry]
sendMessageBatchResponse_failed :: ([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> SendMessageBatchResponse -> f SendMessageBatchResponse
sendMessageBatchResponse_failed = (SendMessageBatchResponse -> [BatchResultErrorEntry])
-> (SendMessageBatchResponse
    -> [BatchResultErrorEntry] -> SendMessageBatchResponse)
-> Lens
     SendMessageBatchResponse
     SendMessageBatchResponse
     [BatchResultErrorEntry]
     [BatchResultErrorEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendMessageBatchResponse' {[BatchResultErrorEntry]
failed :: [BatchResultErrorEntry]
$sel:failed:SendMessageBatchResponse' :: SendMessageBatchResponse -> [BatchResultErrorEntry]
failed} -> [BatchResultErrorEntry]
failed) (\s :: SendMessageBatchResponse
s@SendMessageBatchResponse' {} [BatchResultErrorEntry]
a -> SendMessageBatchResponse
s {$sel:failed:SendMessageBatchResponse' :: [BatchResultErrorEntry]
failed = [BatchResultErrorEntry]
a} :: SendMessageBatchResponse) (([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
 -> SendMessageBatchResponse -> f SendMessageBatchResponse)
-> (([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
    -> [BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> ([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> SendMessageBatchResponse
-> f SendMessageBatchResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> [BatchResultErrorEntry] -> f [BatchResultErrorEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData SendMessageBatchResponse