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

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

-- | Encloses the @Id@ of an entry in @ DeleteMessageBatch.@
--
-- /See:/ 'newDeleteMessageBatchResultEntry' smart constructor.
data DeleteMessageBatchResultEntry = DeleteMessageBatchResultEntry'
  { -- | Represents a successfully deleted message.
    DeleteMessageBatchResultEntry -> Text
id :: Prelude.Text
  }
  deriving (DeleteMessageBatchResultEntry
-> DeleteMessageBatchResultEntry -> Bool
(DeleteMessageBatchResultEntry
 -> DeleteMessageBatchResultEntry -> Bool)
-> (DeleteMessageBatchResultEntry
    -> DeleteMessageBatchResultEntry -> Bool)
-> Eq DeleteMessageBatchResultEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMessageBatchResultEntry
-> DeleteMessageBatchResultEntry -> Bool
$c/= :: DeleteMessageBatchResultEntry
-> DeleteMessageBatchResultEntry -> Bool
== :: DeleteMessageBatchResultEntry
-> DeleteMessageBatchResultEntry -> Bool
$c== :: DeleteMessageBatchResultEntry
-> DeleteMessageBatchResultEntry -> Bool
Prelude.Eq, ReadPrec [DeleteMessageBatchResultEntry]
ReadPrec DeleteMessageBatchResultEntry
Int -> ReadS DeleteMessageBatchResultEntry
ReadS [DeleteMessageBatchResultEntry]
(Int -> ReadS DeleteMessageBatchResultEntry)
-> ReadS [DeleteMessageBatchResultEntry]
-> ReadPrec DeleteMessageBatchResultEntry
-> ReadPrec [DeleteMessageBatchResultEntry]
-> Read DeleteMessageBatchResultEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMessageBatchResultEntry]
$creadListPrec :: ReadPrec [DeleteMessageBatchResultEntry]
readPrec :: ReadPrec DeleteMessageBatchResultEntry
$creadPrec :: ReadPrec DeleteMessageBatchResultEntry
readList :: ReadS [DeleteMessageBatchResultEntry]
$creadList :: ReadS [DeleteMessageBatchResultEntry]
readsPrec :: Int -> ReadS DeleteMessageBatchResultEntry
$creadsPrec :: Int -> ReadS DeleteMessageBatchResultEntry
Prelude.Read, Int -> DeleteMessageBatchResultEntry -> ShowS
[DeleteMessageBatchResultEntry] -> ShowS
DeleteMessageBatchResultEntry -> String
(Int -> DeleteMessageBatchResultEntry -> ShowS)
-> (DeleteMessageBatchResultEntry -> String)
-> ([DeleteMessageBatchResultEntry] -> ShowS)
-> Show DeleteMessageBatchResultEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMessageBatchResultEntry] -> ShowS
$cshowList :: [DeleteMessageBatchResultEntry] -> ShowS
show :: DeleteMessageBatchResultEntry -> String
$cshow :: DeleteMessageBatchResultEntry -> String
showsPrec :: Int -> DeleteMessageBatchResultEntry -> ShowS
$cshowsPrec :: Int -> DeleteMessageBatchResultEntry -> ShowS
Prelude.Show, (forall x.
 DeleteMessageBatchResultEntry
 -> Rep DeleteMessageBatchResultEntry x)
-> (forall x.
    Rep DeleteMessageBatchResultEntry x
    -> DeleteMessageBatchResultEntry)
-> Generic DeleteMessageBatchResultEntry
forall x.
Rep DeleteMessageBatchResultEntry x
-> DeleteMessageBatchResultEntry
forall x.
DeleteMessageBatchResultEntry
-> Rep DeleteMessageBatchResultEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteMessageBatchResultEntry x
-> DeleteMessageBatchResultEntry
$cfrom :: forall x.
DeleteMessageBatchResultEntry
-> Rep DeleteMessageBatchResultEntry x
Prelude.Generic)

-- |
-- Create a value of 'DeleteMessageBatchResultEntry' 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', 'deleteMessageBatchResultEntry_id' - Represents a successfully deleted message.
newDeleteMessageBatchResultEntry ::
  -- | 'id'
  Prelude.Text ->
  DeleteMessageBatchResultEntry
newDeleteMessageBatchResultEntry :: Text -> DeleteMessageBatchResultEntry
newDeleteMessageBatchResultEntry Text
pId_ =
  DeleteMessageBatchResultEntry' :: Text -> DeleteMessageBatchResultEntry
DeleteMessageBatchResultEntry' {$sel:id:DeleteMessageBatchResultEntry' :: Text
id = Text
pId_}

-- | Represents a successfully deleted message.
deleteMessageBatchResultEntry_id :: Lens.Lens' DeleteMessageBatchResultEntry Prelude.Text
deleteMessageBatchResultEntry_id :: (Text -> f Text)
-> DeleteMessageBatchResultEntry -> f DeleteMessageBatchResultEntry
deleteMessageBatchResultEntry_id = (DeleteMessageBatchResultEntry -> Text)
-> (DeleteMessageBatchResultEntry
    -> Text -> DeleteMessageBatchResultEntry)
-> Lens
     DeleteMessageBatchResultEntry
     DeleteMessageBatchResultEntry
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMessageBatchResultEntry' {Text
id :: Text
$sel:id:DeleteMessageBatchResultEntry' :: DeleteMessageBatchResultEntry -> Text
id} -> Text
id) (\s :: DeleteMessageBatchResultEntry
s@DeleteMessageBatchResultEntry' {} Text
a -> DeleteMessageBatchResultEntry
s {$sel:id:DeleteMessageBatchResultEntry' :: Text
id = Text
a} :: DeleteMessageBatchResultEntry)

instance Core.FromXML DeleteMessageBatchResultEntry where
  parseXML :: [Node] -> Either String DeleteMessageBatchResultEntry
parseXML [Node]
x =
    Text -> DeleteMessageBatchResultEntry
DeleteMessageBatchResultEntry'
      (Text -> DeleteMessageBatchResultEntry)
-> Either String Text
-> Either String DeleteMessageBatchResultEntry
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Id")

instance
  Prelude.Hashable
    DeleteMessageBatchResultEntry

instance Prelude.NFData DeleteMessageBatchResultEntry