{-# 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 #-}
module Amazonka.SQS.Types.BatchResultErrorEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchResultErrorEntry = BatchResultErrorEntry'
{
BatchResultErrorEntry -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
BatchResultErrorEntry -> Text
id :: Prelude.Text,
BatchResultErrorEntry -> Bool
senderFault :: Prelude.Bool,
BatchResultErrorEntry -> Text
code :: Prelude.Text
}
deriving (BatchResultErrorEntry -> BatchResultErrorEntry -> Bool
(BatchResultErrorEntry -> BatchResultErrorEntry -> Bool)
-> (BatchResultErrorEntry -> BatchResultErrorEntry -> Bool)
-> Eq BatchResultErrorEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchResultErrorEntry -> BatchResultErrorEntry -> Bool
$c/= :: BatchResultErrorEntry -> BatchResultErrorEntry -> Bool
== :: BatchResultErrorEntry -> BatchResultErrorEntry -> Bool
$c== :: BatchResultErrorEntry -> BatchResultErrorEntry -> Bool
Prelude.Eq, ReadPrec [BatchResultErrorEntry]
ReadPrec BatchResultErrorEntry
Int -> ReadS BatchResultErrorEntry
ReadS [BatchResultErrorEntry]
(Int -> ReadS BatchResultErrorEntry)
-> ReadS [BatchResultErrorEntry]
-> ReadPrec BatchResultErrorEntry
-> ReadPrec [BatchResultErrorEntry]
-> Read BatchResultErrorEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchResultErrorEntry]
$creadListPrec :: ReadPrec [BatchResultErrorEntry]
readPrec :: ReadPrec BatchResultErrorEntry
$creadPrec :: ReadPrec BatchResultErrorEntry
readList :: ReadS [BatchResultErrorEntry]
$creadList :: ReadS [BatchResultErrorEntry]
readsPrec :: Int -> ReadS BatchResultErrorEntry
$creadsPrec :: Int -> ReadS BatchResultErrorEntry
Prelude.Read, Int -> BatchResultErrorEntry -> ShowS
[BatchResultErrorEntry] -> ShowS
BatchResultErrorEntry -> String
(Int -> BatchResultErrorEntry -> ShowS)
-> (BatchResultErrorEntry -> String)
-> ([BatchResultErrorEntry] -> ShowS)
-> Show BatchResultErrorEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchResultErrorEntry] -> ShowS
$cshowList :: [BatchResultErrorEntry] -> ShowS
show :: BatchResultErrorEntry -> String
$cshow :: BatchResultErrorEntry -> String
showsPrec :: Int -> BatchResultErrorEntry -> ShowS
$cshowsPrec :: Int -> BatchResultErrorEntry -> ShowS
Prelude.Show, (forall x. BatchResultErrorEntry -> Rep BatchResultErrorEntry x)
-> (forall x. Rep BatchResultErrorEntry x -> BatchResultErrorEntry)
-> Generic BatchResultErrorEntry
forall x. Rep BatchResultErrorEntry x -> BatchResultErrorEntry
forall x. BatchResultErrorEntry -> Rep BatchResultErrorEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchResultErrorEntry x -> BatchResultErrorEntry
$cfrom :: forall x. BatchResultErrorEntry -> Rep BatchResultErrorEntry x
Prelude.Generic)
newBatchResultErrorEntry ::
Prelude.Text ->
Prelude.Bool ->
Prelude.Text ->
BatchResultErrorEntry
newBatchResultErrorEntry :: Text -> Bool -> Text -> BatchResultErrorEntry
newBatchResultErrorEntry Text
pId_ Bool
pSenderFault_ Text
pCode_ =
BatchResultErrorEntry' :: Maybe Text -> Text -> Bool -> Text -> BatchResultErrorEntry
BatchResultErrorEntry'
{ $sel:message:BatchResultErrorEntry' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:BatchResultErrorEntry' :: Text
id = Text
pId_,
$sel:senderFault:BatchResultErrorEntry' :: Bool
senderFault = Bool
pSenderFault_,
$sel:code:BatchResultErrorEntry' :: Text
code = Text
pCode_
}
batchResultErrorEntry_message :: Lens.Lens' BatchResultErrorEntry (Prelude.Maybe Prelude.Text)
batchResultErrorEntry_message :: (Maybe Text -> f (Maybe Text))
-> BatchResultErrorEntry -> f BatchResultErrorEntry
batchResultErrorEntry_message = (BatchResultErrorEntry -> Maybe Text)
-> (BatchResultErrorEntry -> Maybe Text -> BatchResultErrorEntry)
-> Lens
BatchResultErrorEntry
BatchResultErrorEntry
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchResultErrorEntry' {Maybe Text
message :: Maybe Text
$sel:message:BatchResultErrorEntry' :: BatchResultErrorEntry -> Maybe Text
message} -> Maybe Text
message) (\s :: BatchResultErrorEntry
s@BatchResultErrorEntry' {} Maybe Text
a -> BatchResultErrorEntry
s {$sel:message:BatchResultErrorEntry' :: Maybe Text
message = Maybe Text
a} :: BatchResultErrorEntry)
batchResultErrorEntry_id :: Lens.Lens' BatchResultErrorEntry Prelude.Text
batchResultErrorEntry_id :: (Text -> f Text)
-> BatchResultErrorEntry -> f BatchResultErrorEntry
batchResultErrorEntry_id = (BatchResultErrorEntry -> Text)
-> (BatchResultErrorEntry -> Text -> BatchResultErrorEntry)
-> Lens BatchResultErrorEntry BatchResultErrorEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchResultErrorEntry' {Text
id :: Text
$sel:id:BatchResultErrorEntry' :: BatchResultErrorEntry -> Text
id} -> Text
id) (\s :: BatchResultErrorEntry
s@BatchResultErrorEntry' {} Text
a -> BatchResultErrorEntry
s {$sel:id:BatchResultErrorEntry' :: Text
id = Text
a} :: BatchResultErrorEntry)
batchResultErrorEntry_senderFault :: Lens.Lens' BatchResultErrorEntry Prelude.Bool
batchResultErrorEntry_senderFault :: (Bool -> f Bool)
-> BatchResultErrorEntry -> f BatchResultErrorEntry
batchResultErrorEntry_senderFault = (BatchResultErrorEntry -> Bool)
-> (BatchResultErrorEntry -> Bool -> BatchResultErrorEntry)
-> Lens BatchResultErrorEntry BatchResultErrorEntry Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchResultErrorEntry' {Bool
senderFault :: Bool
$sel:senderFault:BatchResultErrorEntry' :: BatchResultErrorEntry -> Bool
senderFault} -> Bool
senderFault) (\s :: BatchResultErrorEntry
s@BatchResultErrorEntry' {} Bool
a -> BatchResultErrorEntry
s {$sel:senderFault:BatchResultErrorEntry' :: Bool
senderFault = Bool
a} :: BatchResultErrorEntry)
batchResultErrorEntry_code :: Lens.Lens' BatchResultErrorEntry Prelude.Text
batchResultErrorEntry_code :: (Text -> f Text)
-> BatchResultErrorEntry -> f BatchResultErrorEntry
batchResultErrorEntry_code = (BatchResultErrorEntry -> Text)
-> (BatchResultErrorEntry -> Text -> BatchResultErrorEntry)
-> Lens BatchResultErrorEntry BatchResultErrorEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchResultErrorEntry' {Text
code :: Text
$sel:code:BatchResultErrorEntry' :: BatchResultErrorEntry -> Text
code} -> Text
code) (\s :: BatchResultErrorEntry
s@BatchResultErrorEntry' {} Text
a -> BatchResultErrorEntry
s {$sel:code:BatchResultErrorEntry' :: Text
code = Text
a} :: BatchResultErrorEntry)
instance Core.FromXML BatchResultErrorEntry where
parseXML :: [Node] -> Either String BatchResultErrorEntry
parseXML [Node]
x =
Maybe Text -> Text -> Bool -> Text -> BatchResultErrorEntry
BatchResultErrorEntry'
(Maybe Text -> Text -> Bool -> Text -> BatchResultErrorEntry)
-> Either String (Maybe Text)
-> Either String (Text -> Bool -> Text -> BatchResultErrorEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Message")
Either String (Text -> Bool -> Text -> BatchResultErrorEntry)
-> Either String Text
-> Either String (Bool -> Text -> BatchResultErrorEntry)
forall (f :: * -> *) a b. Applicative f => 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")
Either String (Bool -> Text -> BatchResultErrorEntry)
-> Either String Bool
-> Either String (Text -> BatchResultErrorEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Bool
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"SenderFault")
Either String (Text -> BatchResultErrorEntry)
-> Either String Text -> Either String BatchResultErrorEntry
forall (f :: * -> *) a b. Applicative f => 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
"Code")
instance Prelude.Hashable BatchResultErrorEntry
instance Prelude.NFData BatchResultErrorEntry