{-# 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.ChangeMessageVisibilityBatch
-- 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)
--
-- Changes the visibility timeout of multiple messages. This is a batch
-- version of @ ChangeMessageVisibility.@ The result of the action on each
-- message is reported individually in the response. You can send up to 10
-- @ ChangeMessageVisibility @ requests with each
-- @ChangeMessageVisibilityBatch@ action.
--
-- 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@.
--
-- 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.ChangeMessageVisibilityBatch
  ( -- * Creating a Request
    ChangeMessageVisibilityBatch (..),
    newChangeMessageVisibilityBatch,

    -- * Request Lenses
    changeMessageVisibilityBatch_queueUrl,
    changeMessageVisibilityBatch_entries,

    -- * Destructuring the Response
    ChangeMessageVisibilityBatchResponse (..),
    newChangeMessageVisibilityBatchResponse,

    -- * Response Lenses
    changeMessageVisibilityBatchResponse_httpStatus,
    changeMessageVisibilityBatchResponse_successful,
    changeMessageVisibilityBatchResponse_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:/ 'newChangeMessageVisibilityBatch' smart constructor.
data ChangeMessageVisibilityBatch = ChangeMessageVisibilityBatch'
  { -- | The URL of the Amazon SQS queue whose messages\' visibility is changed.
    --
    -- Queue URLs and names are case-sensitive.
    ChangeMessageVisibilityBatch -> Text
queueUrl :: Prelude.Text,
    -- | A list of receipt handles of the messages for which the visibility
    -- timeout must be changed.
    ChangeMessageVisibilityBatch
-> [ChangeMessageVisibilityBatchRequestEntry]
entries :: [ChangeMessageVisibilityBatchRequestEntry]
  }
  deriving (ChangeMessageVisibilityBatch
-> ChangeMessageVisibilityBatch -> Bool
(ChangeMessageVisibilityBatch
 -> ChangeMessageVisibilityBatch -> Bool)
-> (ChangeMessageVisibilityBatch
    -> ChangeMessageVisibilityBatch -> Bool)
-> Eq ChangeMessageVisibilityBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangeMessageVisibilityBatch
-> ChangeMessageVisibilityBatch -> Bool
$c/= :: ChangeMessageVisibilityBatch
-> ChangeMessageVisibilityBatch -> Bool
== :: ChangeMessageVisibilityBatch
-> ChangeMessageVisibilityBatch -> Bool
$c== :: ChangeMessageVisibilityBatch
-> ChangeMessageVisibilityBatch -> Bool
Prelude.Eq, ReadPrec [ChangeMessageVisibilityBatch]
ReadPrec ChangeMessageVisibilityBatch
Int -> ReadS ChangeMessageVisibilityBatch
ReadS [ChangeMessageVisibilityBatch]
(Int -> ReadS ChangeMessageVisibilityBatch)
-> ReadS [ChangeMessageVisibilityBatch]
-> ReadPrec ChangeMessageVisibilityBatch
-> ReadPrec [ChangeMessageVisibilityBatch]
-> Read ChangeMessageVisibilityBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChangeMessageVisibilityBatch]
$creadListPrec :: ReadPrec [ChangeMessageVisibilityBatch]
readPrec :: ReadPrec ChangeMessageVisibilityBatch
$creadPrec :: ReadPrec ChangeMessageVisibilityBatch
readList :: ReadS [ChangeMessageVisibilityBatch]
$creadList :: ReadS [ChangeMessageVisibilityBatch]
readsPrec :: Int -> ReadS ChangeMessageVisibilityBatch
$creadsPrec :: Int -> ReadS ChangeMessageVisibilityBatch
Prelude.Read, Int -> ChangeMessageVisibilityBatch -> ShowS
[ChangeMessageVisibilityBatch] -> ShowS
ChangeMessageVisibilityBatch -> String
(Int -> ChangeMessageVisibilityBatch -> ShowS)
-> (ChangeMessageVisibilityBatch -> String)
-> ([ChangeMessageVisibilityBatch] -> ShowS)
-> Show ChangeMessageVisibilityBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangeMessageVisibilityBatch] -> ShowS
$cshowList :: [ChangeMessageVisibilityBatch] -> ShowS
show :: ChangeMessageVisibilityBatch -> String
$cshow :: ChangeMessageVisibilityBatch -> String
showsPrec :: Int -> ChangeMessageVisibilityBatch -> ShowS
$cshowsPrec :: Int -> ChangeMessageVisibilityBatch -> ShowS
Prelude.Show, (forall x.
 ChangeMessageVisibilityBatch -> Rep ChangeMessageVisibilityBatch x)
-> (forall x.
    Rep ChangeMessageVisibilityBatch x -> ChangeMessageVisibilityBatch)
-> Generic ChangeMessageVisibilityBatch
forall x.
Rep ChangeMessageVisibilityBatch x -> ChangeMessageVisibilityBatch
forall x.
ChangeMessageVisibilityBatch -> Rep ChangeMessageVisibilityBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChangeMessageVisibilityBatch x -> ChangeMessageVisibilityBatch
$cfrom :: forall x.
ChangeMessageVisibilityBatch -> Rep ChangeMessageVisibilityBatch x
Prelude.Generic)

-- |
-- Create a value of 'ChangeMessageVisibilityBatch' 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', 'changeMessageVisibilityBatch_queueUrl' - The URL of the Amazon SQS queue whose messages\' visibility is changed.
--
-- Queue URLs and names are case-sensitive.
--
-- 'entries', 'changeMessageVisibilityBatch_entries' - A list of receipt handles of the messages for which the visibility
-- timeout must be changed.
newChangeMessageVisibilityBatch ::
  -- | 'queueUrl'
  Prelude.Text ->
  ChangeMessageVisibilityBatch
newChangeMessageVisibilityBatch :: Text -> ChangeMessageVisibilityBatch
newChangeMessageVisibilityBatch Text
pQueueUrl_ =
  ChangeMessageVisibilityBatch' :: Text
-> [ChangeMessageVisibilityBatchRequestEntry]
-> ChangeMessageVisibilityBatch
ChangeMessageVisibilityBatch'
    { $sel:queueUrl:ChangeMessageVisibilityBatch' :: Text
queueUrl =
        Text
pQueueUrl_,
      $sel:entries:ChangeMessageVisibilityBatch' :: [ChangeMessageVisibilityBatchRequestEntry]
entries = [ChangeMessageVisibilityBatchRequestEntry]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The URL of the Amazon SQS queue whose messages\' visibility is changed.
--
-- Queue URLs and names are case-sensitive.
changeMessageVisibilityBatch_queueUrl :: Lens.Lens' ChangeMessageVisibilityBatch Prelude.Text
changeMessageVisibilityBatch_queueUrl :: (Text -> f Text)
-> ChangeMessageVisibilityBatch -> f ChangeMessageVisibilityBatch
changeMessageVisibilityBatch_queueUrl = (ChangeMessageVisibilityBatch -> Text)
-> (ChangeMessageVisibilityBatch
    -> Text -> ChangeMessageVisibilityBatch)
-> Lens
     ChangeMessageVisibilityBatch ChangeMessageVisibilityBatch Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeMessageVisibilityBatch' {Text
queueUrl :: Text
$sel:queueUrl:ChangeMessageVisibilityBatch' :: ChangeMessageVisibilityBatch -> Text
queueUrl} -> Text
queueUrl) (\s :: ChangeMessageVisibilityBatch
s@ChangeMessageVisibilityBatch' {} Text
a -> ChangeMessageVisibilityBatch
s {$sel:queueUrl:ChangeMessageVisibilityBatch' :: Text
queueUrl = Text
a} :: ChangeMessageVisibilityBatch)

-- | A list of receipt handles of the messages for which the visibility
-- timeout must be changed.
changeMessageVisibilityBatch_entries :: Lens.Lens' ChangeMessageVisibilityBatch [ChangeMessageVisibilityBatchRequestEntry]
changeMessageVisibilityBatch_entries :: ([ChangeMessageVisibilityBatchRequestEntry]
 -> f [ChangeMessageVisibilityBatchRequestEntry])
-> ChangeMessageVisibilityBatch -> f ChangeMessageVisibilityBatch
changeMessageVisibilityBatch_entries = (ChangeMessageVisibilityBatch
 -> [ChangeMessageVisibilityBatchRequestEntry])
-> (ChangeMessageVisibilityBatch
    -> [ChangeMessageVisibilityBatchRequestEntry]
    -> ChangeMessageVisibilityBatch)
-> Lens
     ChangeMessageVisibilityBatch
     ChangeMessageVisibilityBatch
     [ChangeMessageVisibilityBatchRequestEntry]
     [ChangeMessageVisibilityBatchRequestEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeMessageVisibilityBatch' {[ChangeMessageVisibilityBatchRequestEntry]
entries :: [ChangeMessageVisibilityBatchRequestEntry]
$sel:entries:ChangeMessageVisibilityBatch' :: ChangeMessageVisibilityBatch
-> [ChangeMessageVisibilityBatchRequestEntry]
entries} -> [ChangeMessageVisibilityBatchRequestEntry]
entries) (\s :: ChangeMessageVisibilityBatch
s@ChangeMessageVisibilityBatch' {} [ChangeMessageVisibilityBatchRequestEntry]
a -> ChangeMessageVisibilityBatch
s {$sel:entries:ChangeMessageVisibilityBatch' :: [ChangeMessageVisibilityBatchRequestEntry]
entries = [ChangeMessageVisibilityBatchRequestEntry]
a} :: ChangeMessageVisibilityBatch) (([ChangeMessageVisibilityBatchRequestEntry]
  -> f [ChangeMessageVisibilityBatchRequestEntry])
 -> ChangeMessageVisibilityBatch -> f ChangeMessageVisibilityBatch)
-> (([ChangeMessageVisibilityBatchRequestEntry]
     -> f [ChangeMessageVisibilityBatchRequestEntry])
    -> [ChangeMessageVisibilityBatchRequestEntry]
    -> f [ChangeMessageVisibilityBatchRequestEntry])
-> ([ChangeMessageVisibilityBatchRequestEntry]
    -> f [ChangeMessageVisibilityBatchRequestEntry])
-> ChangeMessageVisibilityBatch
-> f ChangeMessageVisibilityBatch
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ChangeMessageVisibilityBatchRequestEntry]
 -> f [ChangeMessageVisibilityBatchRequestEntry])
-> [ChangeMessageVisibilityBatchRequestEntry]
-> f [ChangeMessageVisibilityBatchRequestEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ChangeMessageVisibilityBatch

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

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

instance Core.ToQuery ChangeMessageVisibilityBatch where
  toQuery :: ChangeMessageVisibilityBatch -> QueryString
toQuery ChangeMessageVisibilityBatch' {[ChangeMessageVisibilityBatchRequestEntry]
Text
entries :: [ChangeMessageVisibilityBatchRequestEntry]
queueUrl :: Text
$sel:entries:ChangeMessageVisibilityBatch' :: ChangeMessageVisibilityBatch
-> [ChangeMessageVisibilityBatchRequestEntry]
$sel:queueUrl:ChangeMessageVisibilityBatch' :: ChangeMessageVisibilityBatch -> 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
"ChangeMessageVisibilityBatch" ::
                      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
-> [ChangeMessageVisibilityBatchRequestEntry] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList
          ByteString
"ChangeMessageVisibilityBatchRequestEntry"
          [ChangeMessageVisibilityBatchRequestEntry]
entries
      ]

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

-- |
-- Create a value of 'ChangeMessageVisibilityBatchResponse' 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', 'changeMessageVisibilityBatchResponse_httpStatus' - The response's http status code.
--
-- 'successful', 'changeMessageVisibilityBatchResponse_successful' - A list of @ ChangeMessageVisibilityBatchResultEntry @ items.
--
-- 'failed', 'changeMessageVisibilityBatchResponse_failed' - A list of @ BatchResultErrorEntry @ items.
newChangeMessageVisibilityBatchResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ChangeMessageVisibilityBatchResponse
newChangeMessageVisibilityBatchResponse :: Int -> ChangeMessageVisibilityBatchResponse
newChangeMessageVisibilityBatchResponse Int
pHttpStatus_ =
  ChangeMessageVisibilityBatchResponse' :: Int
-> [ChangeMessageVisibilityBatchResultEntry]
-> [BatchResultErrorEntry]
-> ChangeMessageVisibilityBatchResponse
ChangeMessageVisibilityBatchResponse'
    { $sel:httpStatus:ChangeMessageVisibilityBatchResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:successful:ChangeMessageVisibilityBatchResponse' :: [ChangeMessageVisibilityBatchResultEntry]
successful = [ChangeMessageVisibilityBatchResultEntry]
forall a. Monoid a => a
Prelude.mempty,
      $sel:failed:ChangeMessageVisibilityBatchResponse' :: [BatchResultErrorEntry]
failed = [BatchResultErrorEntry]
forall a. Monoid a => a
Prelude.mempty
    }

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

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

-- | A list of @ BatchResultErrorEntry @ items.
changeMessageVisibilityBatchResponse_failed :: Lens.Lens' ChangeMessageVisibilityBatchResponse [BatchResultErrorEntry]
changeMessageVisibilityBatchResponse_failed :: ([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> ChangeMessageVisibilityBatchResponse
-> f ChangeMessageVisibilityBatchResponse
changeMessageVisibilityBatchResponse_failed = (ChangeMessageVisibilityBatchResponse -> [BatchResultErrorEntry])
-> (ChangeMessageVisibilityBatchResponse
    -> [BatchResultErrorEntry] -> ChangeMessageVisibilityBatchResponse)
-> Lens
     ChangeMessageVisibilityBatchResponse
     ChangeMessageVisibilityBatchResponse
     [BatchResultErrorEntry]
     [BatchResultErrorEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangeMessageVisibilityBatchResponse' {[BatchResultErrorEntry]
failed :: [BatchResultErrorEntry]
$sel:failed:ChangeMessageVisibilityBatchResponse' :: ChangeMessageVisibilityBatchResponse -> [BatchResultErrorEntry]
failed} -> [BatchResultErrorEntry]
failed) (\s :: ChangeMessageVisibilityBatchResponse
s@ChangeMessageVisibilityBatchResponse' {} [BatchResultErrorEntry]
a -> ChangeMessageVisibilityBatchResponse
s {$sel:failed:ChangeMessageVisibilityBatchResponse' :: [BatchResultErrorEntry]
failed = [BatchResultErrorEntry]
a} :: ChangeMessageVisibilityBatchResponse) (([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
 -> ChangeMessageVisibilityBatchResponse
 -> f ChangeMessageVisibilityBatchResponse)
-> (([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
    -> [BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> ([BatchResultErrorEntry] -> f [BatchResultErrorEntry])
-> ChangeMessageVisibilityBatchResponse
-> f ChangeMessageVisibilityBatchResponse
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
    ChangeMessageVisibilityBatchResponse