{-# 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.DeleteMessageBatchRequestEntry
-- 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.DeleteMessageBatchRequestEntry where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Encloses a receipt handle and an identifier for it.
--
-- /See:/ 'newDeleteMessageBatchRequestEntry' smart constructor.
data DeleteMessageBatchRequestEntry = DeleteMessageBatchRequestEntry'
  { -- | An identifier for this particular receipt handle. This is 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 (_).
    DeleteMessageBatchRequestEntry -> Text
id :: Prelude.Text,
    -- | A receipt handle.
    DeleteMessageBatchRequestEntry -> Text
receiptHandle :: Prelude.Text
  }
  deriving (DeleteMessageBatchRequestEntry
-> DeleteMessageBatchRequestEntry -> Bool
(DeleteMessageBatchRequestEntry
 -> DeleteMessageBatchRequestEntry -> Bool)
-> (DeleteMessageBatchRequestEntry
    -> DeleteMessageBatchRequestEntry -> Bool)
-> Eq DeleteMessageBatchRequestEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMessageBatchRequestEntry
-> DeleteMessageBatchRequestEntry -> Bool
$c/= :: DeleteMessageBatchRequestEntry
-> DeleteMessageBatchRequestEntry -> Bool
== :: DeleteMessageBatchRequestEntry
-> DeleteMessageBatchRequestEntry -> Bool
$c== :: DeleteMessageBatchRequestEntry
-> DeleteMessageBatchRequestEntry -> Bool
Prelude.Eq, ReadPrec [DeleteMessageBatchRequestEntry]
ReadPrec DeleteMessageBatchRequestEntry
Int -> ReadS DeleteMessageBatchRequestEntry
ReadS [DeleteMessageBatchRequestEntry]
(Int -> ReadS DeleteMessageBatchRequestEntry)
-> ReadS [DeleteMessageBatchRequestEntry]
-> ReadPrec DeleteMessageBatchRequestEntry
-> ReadPrec [DeleteMessageBatchRequestEntry]
-> Read DeleteMessageBatchRequestEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMessageBatchRequestEntry]
$creadListPrec :: ReadPrec [DeleteMessageBatchRequestEntry]
readPrec :: ReadPrec DeleteMessageBatchRequestEntry
$creadPrec :: ReadPrec DeleteMessageBatchRequestEntry
readList :: ReadS [DeleteMessageBatchRequestEntry]
$creadList :: ReadS [DeleteMessageBatchRequestEntry]
readsPrec :: Int -> ReadS DeleteMessageBatchRequestEntry
$creadsPrec :: Int -> ReadS DeleteMessageBatchRequestEntry
Prelude.Read, Int -> DeleteMessageBatchRequestEntry -> ShowS
[DeleteMessageBatchRequestEntry] -> ShowS
DeleteMessageBatchRequestEntry -> String
(Int -> DeleteMessageBatchRequestEntry -> ShowS)
-> (DeleteMessageBatchRequestEntry -> String)
-> ([DeleteMessageBatchRequestEntry] -> ShowS)
-> Show DeleteMessageBatchRequestEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMessageBatchRequestEntry] -> ShowS
$cshowList :: [DeleteMessageBatchRequestEntry] -> ShowS
show :: DeleteMessageBatchRequestEntry -> String
$cshow :: DeleteMessageBatchRequestEntry -> String
showsPrec :: Int -> DeleteMessageBatchRequestEntry -> ShowS
$cshowsPrec :: Int -> DeleteMessageBatchRequestEntry -> ShowS
Prelude.Show, (forall x.
 DeleteMessageBatchRequestEntry
 -> Rep DeleteMessageBatchRequestEntry x)
-> (forall x.
    Rep DeleteMessageBatchRequestEntry x
    -> DeleteMessageBatchRequestEntry)
-> Generic DeleteMessageBatchRequestEntry
forall x.
Rep DeleteMessageBatchRequestEntry x
-> DeleteMessageBatchRequestEntry
forall x.
DeleteMessageBatchRequestEntry
-> Rep DeleteMessageBatchRequestEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteMessageBatchRequestEntry x
-> DeleteMessageBatchRequestEntry
$cfrom :: forall x.
DeleteMessageBatchRequestEntry
-> Rep DeleteMessageBatchRequestEntry x
Prelude.Generic)

-- |
-- Create a value of 'DeleteMessageBatchRequestEntry' 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:
--
-- 'id', 'deleteMessageBatchRequestEntry_id' - An identifier for this particular receipt handle. This is 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 (_).
--
-- 'receiptHandle', 'deleteMessageBatchRequestEntry_receiptHandle' - A receipt handle.
newDeleteMessageBatchRequestEntry ::
  -- | 'id'
  Prelude.Text ->
  -- | 'receiptHandle'
  Prelude.Text ->
  DeleteMessageBatchRequestEntry
newDeleteMessageBatchRequestEntry :: Text -> Text -> DeleteMessageBatchRequestEntry
newDeleteMessageBatchRequestEntry
  Text
pId_
  Text
pReceiptHandle_ =
    DeleteMessageBatchRequestEntry' :: Text -> Text -> DeleteMessageBatchRequestEntry
DeleteMessageBatchRequestEntry'
      { $sel:id:DeleteMessageBatchRequestEntry' :: Text
id = Text
pId_,
        $sel:receiptHandle:DeleteMessageBatchRequestEntry' :: Text
receiptHandle = Text
pReceiptHandle_
      }

-- | An identifier for this particular receipt handle. This is 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 (_).
deleteMessageBatchRequestEntry_id :: Lens.Lens' DeleteMessageBatchRequestEntry Prelude.Text
deleteMessageBatchRequestEntry_id :: (Text -> f Text)
-> DeleteMessageBatchRequestEntry
-> f DeleteMessageBatchRequestEntry
deleteMessageBatchRequestEntry_id = (DeleteMessageBatchRequestEntry -> Text)
-> (DeleteMessageBatchRequestEntry
    -> Text -> DeleteMessageBatchRequestEntry)
-> Lens
     DeleteMessageBatchRequestEntry
     DeleteMessageBatchRequestEntry
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMessageBatchRequestEntry' {Text
id :: Text
$sel:id:DeleteMessageBatchRequestEntry' :: DeleteMessageBatchRequestEntry -> Text
id} -> Text
id) (\s :: DeleteMessageBatchRequestEntry
s@DeleteMessageBatchRequestEntry' {} Text
a -> DeleteMessageBatchRequestEntry
s {$sel:id:DeleteMessageBatchRequestEntry' :: Text
id = Text
a} :: DeleteMessageBatchRequestEntry)

-- | A receipt handle.
deleteMessageBatchRequestEntry_receiptHandle :: Lens.Lens' DeleteMessageBatchRequestEntry Prelude.Text
deleteMessageBatchRequestEntry_receiptHandle :: (Text -> f Text)
-> DeleteMessageBatchRequestEntry
-> f DeleteMessageBatchRequestEntry
deleteMessageBatchRequestEntry_receiptHandle = (DeleteMessageBatchRequestEntry -> Text)
-> (DeleteMessageBatchRequestEntry
    -> Text -> DeleteMessageBatchRequestEntry)
-> Lens
     DeleteMessageBatchRequestEntry
     DeleteMessageBatchRequestEntry
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMessageBatchRequestEntry' {Text
receiptHandle :: Text
$sel:receiptHandle:DeleteMessageBatchRequestEntry' :: DeleteMessageBatchRequestEntry -> Text
receiptHandle} -> Text
receiptHandle) (\s :: DeleteMessageBatchRequestEntry
s@DeleteMessageBatchRequestEntry' {} Text
a -> DeleteMessageBatchRequestEntry
s {$sel:receiptHandle:DeleteMessageBatchRequestEntry' :: Text
receiptHandle = Text
a} :: DeleteMessageBatchRequestEntry)

instance
  Prelude.Hashable
    DeleteMessageBatchRequestEntry

instance
  Prelude.NFData
    DeleteMessageBatchRequestEntry

instance Core.ToQuery DeleteMessageBatchRequestEntry where
  toQuery :: DeleteMessageBatchRequestEntry -> QueryString
toQuery DeleteMessageBatchRequestEntry' {Text
receiptHandle :: Text
id :: Text
$sel:receiptHandle:DeleteMessageBatchRequestEntry' :: DeleteMessageBatchRequestEntry -> Text
$sel:id:DeleteMessageBatchRequestEntry' :: DeleteMessageBatchRequestEntry -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Id" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
id,
        ByteString
"ReceiptHandle" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
receiptHandle
      ]