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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SQS.Types.MessageAttribute
import Amazonka.SQS.Types.MessageAttributeValue

-- | An Amazon SQS message.
--
-- /See:/ 'newMessage' smart constructor.
data Message = Message'
  { -- | Each message attribute consists of a @Name@, @Type@, and @Value@. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes Amazon SQS message attributes>
    -- in the /Amazon SQS Developer Guide/.
    Message -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue),
    -- | An MD5 digest of the non-URL-encoded message body string.
    Message -> Maybe Text
mD5OfBody :: Prelude.Maybe Prelude.Text,
    -- | The message\'s contents (not URL-encoded).
    Message -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
    -- | A map of the attributes requested in @ ReceiveMessage @ to their
    -- respective values. Supported attributes:
    --
    -- -   @ApproximateReceiveCount@
    --
    -- -   @ApproximateFirstReceiveTimestamp@
    --
    -- -   @MessageDeduplicationId@
    --
    -- -   @MessageGroupId@
    --
    -- -   @SenderId@
    --
    -- -   @SentTimestamp@
    --
    -- -   @SequenceNumber@
    --
    -- @ApproximateFirstReceiveTimestamp@ and @SentTimestamp@ are each returned
    -- as an integer representing the
    -- <http://en.wikipedia.org/wiki/Unix_time epoch time> in milliseconds.
    Message -> Maybe (HashMap MessageAttribute Text)
attributes :: Prelude.Maybe (Prelude.HashMap MessageAttribute Prelude.Text),
    -- | An identifier associated with the act of receiving the message. A new
    -- receipt handle is returned every time you receive a message. When
    -- deleting a message, you provide the last received receipt handle to
    -- delete the message.
    Message -> Maybe Text
receiptHandle :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the message. A @MessageId@is considered unique
    -- across all accounts for an extended period of time.
    Message -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
    -- | An MD5 digest of the non-URL-encoded message attribute string. You can
    -- use this attribute to verify that Amazon SQS received the message
    -- correctly. Amazon SQS URL-decodes the message before creating the MD5
    -- digest. For information about MD5, see
    -- <https://www.ietf.org/rfc/rfc1321.txt RFC1321>.
    Message -> Maybe Text
mD5OfMessageAttributes :: Prelude.Maybe Prelude.Text
  }
  deriving (Message -> Message -> Bool
(Message -> Message -> Bool)
-> (Message -> Message -> Bool) -> Eq Message
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Message -> Message -> Bool
$c/= :: Message -> Message -> Bool
== :: Message -> Message -> Bool
$c== :: Message -> Message -> Bool
Prelude.Eq, ReadPrec [Message]
ReadPrec Message
Int -> ReadS Message
ReadS [Message]
(Int -> ReadS Message)
-> ReadS [Message]
-> ReadPrec Message
-> ReadPrec [Message]
-> Read Message
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Message]
$creadListPrec :: ReadPrec [Message]
readPrec :: ReadPrec Message
$creadPrec :: ReadPrec Message
readList :: ReadS [Message]
$creadList :: ReadS [Message]
readsPrec :: Int -> ReadS Message
$creadsPrec :: Int -> ReadS Message
Prelude.Read, Int -> Message -> ShowS
[Message] -> ShowS
Message -> String
(Int -> Message -> ShowS)
-> (Message -> String) -> ([Message] -> ShowS) -> Show Message
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Message] -> ShowS
$cshowList :: [Message] -> ShowS
show :: Message -> String
$cshow :: Message -> String
showsPrec :: Int -> Message -> ShowS
$cshowsPrec :: Int -> Message -> ShowS
Prelude.Show, (forall x. Message -> Rep Message x)
-> (forall x. Rep Message x -> Message) -> Generic Message
forall x. Rep Message x -> Message
forall x. Message -> Rep Message x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Message x -> Message
$cfrom :: forall x. Message -> Rep Message x
Prelude.Generic)

-- |
-- Create a value of 'Message' 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:
--
-- 'messageAttributes', 'message_messageAttributes' - Each message attribute consists of a @Name@, @Type@, and @Value@. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes Amazon SQS message attributes>
-- in the /Amazon SQS Developer Guide/.
--
-- 'mD5OfBody', 'message_mD5OfBody' - An MD5 digest of the non-URL-encoded message body string.
--
-- 'body', 'message_body' - The message\'s contents (not URL-encoded).
--
-- 'attributes', 'message_attributes' - A map of the attributes requested in @ ReceiveMessage @ to their
-- respective values. Supported attributes:
--
-- -   @ApproximateReceiveCount@
--
-- -   @ApproximateFirstReceiveTimestamp@
--
-- -   @MessageDeduplicationId@
--
-- -   @MessageGroupId@
--
-- -   @SenderId@
--
-- -   @SentTimestamp@
--
-- -   @SequenceNumber@
--
-- @ApproximateFirstReceiveTimestamp@ and @SentTimestamp@ are each returned
-- as an integer representing the
-- <http://en.wikipedia.org/wiki/Unix_time epoch time> in milliseconds.
--
-- 'receiptHandle', 'message_receiptHandle' - An identifier associated with the act of receiving the message. A new
-- receipt handle is returned every time you receive a message. When
-- deleting a message, you provide the last received receipt handle to
-- delete the message.
--
-- 'messageId', 'message_messageId' - A unique identifier for the message. A @MessageId@is considered unique
-- across all accounts for an extended period of time.
--
-- 'mD5OfMessageAttributes', 'message_mD5OfMessageAttributes' - An MD5 digest of the non-URL-encoded message attribute string. You can
-- use this attribute to verify that Amazon SQS received the message
-- correctly. Amazon SQS URL-decodes the message before creating the MD5
-- digest. For information about MD5, see
-- <https://www.ietf.org/rfc/rfc1321.txt RFC1321>.
newMessage ::
  Message
newMessage :: Message
newMessage =
  Message' :: Maybe (HashMap Text MessageAttributeValue)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap MessageAttribute Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Message
Message'
    { $sel:messageAttributes:Message' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes = Maybe (HashMap Text MessageAttributeValue)
forall a. Maybe a
Prelude.Nothing,
      $sel:mD5OfBody:Message' :: Maybe Text
mD5OfBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:body:Message' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:Message' :: Maybe (HashMap MessageAttribute Text)
attributes = Maybe (HashMap MessageAttribute Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:receiptHandle:Message' :: Maybe Text
receiptHandle = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:messageId:Message' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mD5OfMessageAttributes:Message' :: Maybe Text
mD5OfMessageAttributes = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Each message attribute consists of a @Name@, @Type@, and @Value@. For
-- more information, see
-- <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes Amazon SQS message attributes>
-- in the /Amazon SQS Developer Guide/.
message_messageAttributes :: Lens.Lens' Message (Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue))
message_messageAttributes :: (Maybe (HashMap Text MessageAttributeValue)
 -> f (Maybe (HashMap Text MessageAttributeValue)))
-> Message -> f Message
message_messageAttributes = (Message -> Maybe (HashMap Text MessageAttributeValue))
-> (Message
    -> Maybe (HashMap Text MessageAttributeValue) -> Message)
-> Lens
     Message
     Message
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:messageAttributes:Message' :: Message -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes} -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes) (\s :: Message
s@Message' {} Maybe (HashMap Text MessageAttributeValue)
a -> Message
s {$sel:messageAttributes:Message' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes = Maybe (HashMap Text MessageAttributeValue)
a} :: Message) ((Maybe (HashMap Text MessageAttributeValue)
  -> f (Maybe (HashMap Text MessageAttributeValue)))
 -> Message -> f Message)
-> ((Maybe (HashMap Text MessageAttributeValue)
     -> f (Maybe (HashMap Text MessageAttributeValue)))
    -> Maybe (HashMap Text MessageAttributeValue)
    -> f (Maybe (HashMap Text MessageAttributeValue)))
-> (Maybe (HashMap Text MessageAttributeValue)
    -> f (Maybe (HashMap Text MessageAttributeValue)))
-> Message
-> f Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
-> Iso
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
     (Maybe (HashMap Text MessageAttributeValue))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
  (HashMap Text MessageAttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An MD5 digest of the non-URL-encoded message body string.
message_mD5OfBody :: Lens.Lens' Message (Prelude.Maybe Prelude.Text)
message_mD5OfBody :: (Maybe Text -> f (Maybe Text)) -> Message -> f Message
message_mD5OfBody = (Message -> Maybe Text)
-> (Message -> Maybe Text -> Message)
-> Lens Message Message (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe Text
mD5OfBody :: Maybe Text
$sel:mD5OfBody:Message' :: Message -> Maybe Text
mD5OfBody} -> Maybe Text
mD5OfBody) (\s :: Message
s@Message' {} Maybe Text
a -> Message
s {$sel:mD5OfBody:Message' :: Maybe Text
mD5OfBody = Maybe Text
a} :: Message)

-- | The message\'s contents (not URL-encoded).
message_body :: Lens.Lens' Message (Prelude.Maybe Prelude.Text)
message_body :: (Maybe Text -> f (Maybe Text)) -> Message -> f Message
message_body = (Message -> Maybe Text)
-> (Message -> Maybe Text -> Message)
-> Lens Message Message (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe Text
body :: Maybe Text
$sel:body:Message' :: Message -> Maybe Text
body} -> Maybe Text
body) (\s :: Message
s@Message' {} Maybe Text
a -> Message
s {$sel:body:Message' :: Maybe Text
body = Maybe Text
a} :: Message)

-- | A map of the attributes requested in @ ReceiveMessage @ to their
-- respective values. Supported attributes:
--
-- -   @ApproximateReceiveCount@
--
-- -   @ApproximateFirstReceiveTimestamp@
--
-- -   @MessageDeduplicationId@
--
-- -   @MessageGroupId@
--
-- -   @SenderId@
--
-- -   @SentTimestamp@
--
-- -   @SequenceNumber@
--
-- @ApproximateFirstReceiveTimestamp@ and @SentTimestamp@ are each returned
-- as an integer representing the
-- <http://en.wikipedia.org/wiki/Unix_time epoch time> in milliseconds.
message_attributes :: Lens.Lens' Message (Prelude.Maybe (Prelude.HashMap MessageAttribute Prelude.Text))
message_attributes :: (Maybe (HashMap MessageAttribute Text)
 -> f (Maybe (HashMap MessageAttribute Text)))
-> Message -> f Message
message_attributes = (Message -> Maybe (HashMap MessageAttribute Text))
-> (Message -> Maybe (HashMap MessageAttribute Text) -> Message)
-> Lens
     Message
     Message
     (Maybe (HashMap MessageAttribute Text))
     (Maybe (HashMap MessageAttribute Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe (HashMap MessageAttribute Text)
attributes :: Maybe (HashMap MessageAttribute Text)
$sel:attributes:Message' :: Message -> Maybe (HashMap MessageAttribute Text)
attributes} -> Maybe (HashMap MessageAttribute Text)
attributes) (\s :: Message
s@Message' {} Maybe (HashMap MessageAttribute Text)
a -> Message
s {$sel:attributes:Message' :: Maybe (HashMap MessageAttribute Text)
attributes = Maybe (HashMap MessageAttribute Text)
a} :: Message) ((Maybe (HashMap MessageAttribute Text)
  -> f (Maybe (HashMap MessageAttribute Text)))
 -> Message -> f Message)
-> ((Maybe (HashMap MessageAttribute Text)
     -> f (Maybe (HashMap MessageAttribute Text)))
    -> Maybe (HashMap MessageAttribute Text)
    -> f (Maybe (HashMap MessageAttribute Text)))
-> (Maybe (HashMap MessageAttribute Text)
    -> f (Maybe (HashMap MessageAttribute Text)))
-> Message
-> f Message
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap MessageAttribute Text)
  (HashMap MessageAttribute Text)
  (HashMap MessageAttribute Text)
  (HashMap MessageAttribute Text)
-> Iso
     (Maybe (HashMap MessageAttribute Text))
     (Maybe (HashMap MessageAttribute Text))
     (Maybe (HashMap MessageAttribute Text))
     (Maybe (HashMap MessageAttribute Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap MessageAttribute Text)
  (HashMap MessageAttribute Text)
  (HashMap MessageAttribute Text)
  (HashMap MessageAttribute Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identifier associated with the act of receiving the message. A new
-- receipt handle is returned every time you receive a message. When
-- deleting a message, you provide the last received receipt handle to
-- delete the message.
message_receiptHandle :: Lens.Lens' Message (Prelude.Maybe Prelude.Text)
message_receiptHandle :: (Maybe Text -> f (Maybe Text)) -> Message -> f Message
message_receiptHandle = (Message -> Maybe Text)
-> (Message -> Maybe Text -> Message)
-> Lens Message Message (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe Text
receiptHandle :: Maybe Text
$sel:receiptHandle:Message' :: Message -> Maybe Text
receiptHandle} -> Maybe Text
receiptHandle) (\s :: Message
s@Message' {} Maybe Text
a -> Message
s {$sel:receiptHandle:Message' :: Maybe Text
receiptHandle = Maybe Text
a} :: Message)

-- | A unique identifier for the message. A @MessageId@is considered unique
-- across all accounts for an extended period of time.
message_messageId :: Lens.Lens' Message (Prelude.Maybe Prelude.Text)
message_messageId :: (Maybe Text -> f (Maybe Text)) -> Message -> f Message
message_messageId = (Message -> Maybe Text)
-> (Message -> Maybe Text -> Message)
-> Lens Message Message (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe Text
messageId :: Maybe Text
$sel:messageId:Message' :: Message -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: Message
s@Message' {} Maybe Text
a -> Message
s {$sel:messageId:Message' :: Maybe Text
messageId = Maybe Text
a} :: Message)

-- | An MD5 digest of the non-URL-encoded message attribute string. You can
-- use this attribute to verify that Amazon SQS received the message
-- correctly. Amazon SQS URL-decodes the message before creating the MD5
-- digest. For information about MD5, see
-- <https://www.ietf.org/rfc/rfc1321.txt RFC1321>.
message_mD5OfMessageAttributes :: Lens.Lens' Message (Prelude.Maybe Prelude.Text)
message_mD5OfMessageAttributes :: (Maybe Text -> f (Maybe Text)) -> Message -> f Message
message_mD5OfMessageAttributes = (Message -> Maybe Text)
-> (Message -> Maybe Text -> Message)
-> Lens Message Message (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Message' {Maybe Text
mD5OfMessageAttributes :: Maybe Text
$sel:mD5OfMessageAttributes:Message' :: Message -> Maybe Text
mD5OfMessageAttributes} -> Maybe Text
mD5OfMessageAttributes) (\s :: Message
s@Message' {} Maybe Text
a -> Message
s {$sel:mD5OfMessageAttributes:Message' :: Maybe Text
mD5OfMessageAttributes = Maybe Text
a} :: Message)

instance Core.FromXML Message where
  parseXML :: [Node] -> Either String Message
parseXML [Node]
x =
    Maybe (HashMap Text MessageAttributeValue)
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap MessageAttribute Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Message
Message'
      (Maybe (HashMap Text MessageAttributeValue)
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap MessageAttribute Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Message)
-> Either String (Maybe (HashMap Text MessageAttributeValue))
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap MessageAttribute Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Message)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( ([Node] -> Either String (HashMap Text MessageAttributeValue))
-> [Node]
-> Either String (Maybe (HashMap Text MessageAttributeValue))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                      (Text
-> Text
-> Text
-> [Node]
-> Either String (HashMap Text MessageAttributeValue)
forall k v.
(Eq k, Hashable k, FromText k, FromXML v) =>
Text -> Text -> Text -> [Node] -> Either String (HashMap k v)
Core.parseXMLMap Text
"MessageAttribute" Text
"Name" Text
"Value")
                      [Node]
x
                  )
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap MessageAttribute Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Message)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap MessageAttribute Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Message)
forall (f :: * -> *) a b. Applicative f => 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
"MD5OfBody")
      Either
  String
  (Maybe Text
   -> Maybe (HashMap MessageAttribute Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Message)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap MessageAttribute Text)
      -> Maybe Text -> Maybe Text -> Maybe Text -> Message)
forall (f :: * -> *) a b. Applicative f => 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
"Body")
      Either
  String
  (Maybe (HashMap MessageAttribute Text)
   -> Maybe Text -> Maybe Text -> Maybe Text -> Message)
-> Either String (Maybe (HashMap MessageAttribute Text))
-> Either
     String (Maybe Text -> Maybe Text -> Maybe Text -> Message)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( ([Node] -> Either String (HashMap MessageAttribute Text))
-> [Node] -> Either String (Maybe (HashMap MessageAttribute Text))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                      (Text
-> Text
-> Text
-> [Node]
-> Either String (HashMap MessageAttribute Text)
forall k v.
(Eq k, Hashable k, FromText k, FromXML v) =>
Text -> Text -> Text -> [Node] -> Either String (HashMap k v)
Core.parseXMLMap Text
"Attribute" Text
"Name" Text
"Value")
                      [Node]
x
                  )
      Either String (Maybe Text -> Maybe Text -> Maybe Text -> Message)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> Message)
forall (f :: * -> *) a b. Applicative f => 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
"ReceiptHandle")
      Either String (Maybe Text -> Maybe Text -> Message)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Message)
forall (f :: * -> *) a b. Applicative f => 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
"MessageId")
      Either String (Maybe Text -> Message)
-> Either String (Maybe Text) -> Either String Message
forall (f :: * -> *) a b. Applicative f => 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
"MD5OfMessageAttributes")

instance Prelude.Hashable Message

instance Prelude.NFData Message