{-# 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 #-}
module Amazonka.SQS.ReceiveMessage
(
ReceiveMessage (..),
newReceiveMessage,
receiveMessage_attributeNames,
receiveMessage_maxNumberOfMessages,
receiveMessage_messageAttributeNames,
receiveMessage_receiveRequestAttemptId,
receiveMessage_visibilityTimeout,
receiveMessage_waitTimeSeconds,
receiveMessage_queueUrl,
ReceiveMessageResponse (..),
newReceiveMessageResponse,
receiveMessageResponse_messages,
receiveMessageResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SQS.Types
data ReceiveMessage = ReceiveMessage'
{
ReceiveMessage -> Maybe [MessageAttribute]
attributeNames :: Prelude.Maybe [MessageAttribute],
ReceiveMessage -> Maybe Int
maxNumberOfMessages :: Prelude.Maybe Prelude.Int,
ReceiveMessage -> Maybe [Text]
messageAttributeNames :: Prelude.Maybe [Prelude.Text],
ReceiveMessage -> Maybe Text
receiveRequestAttemptId :: Prelude.Maybe Prelude.Text,
ReceiveMessage -> Maybe Int
visibilityTimeout :: Prelude.Maybe Prelude.Int,
ReceiveMessage -> Maybe Int
waitTimeSeconds :: Prelude.Maybe Prelude.Int,
ReceiveMessage -> Text
queueUrl :: Prelude.Text
}
deriving (ReceiveMessage -> ReceiveMessage -> Bool
(ReceiveMessage -> ReceiveMessage -> Bool)
-> (ReceiveMessage -> ReceiveMessage -> Bool) -> Eq ReceiveMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReceiveMessage -> ReceiveMessage -> Bool
== :: ReceiveMessage -> ReceiveMessage -> Bool
$c/= :: ReceiveMessage -> ReceiveMessage -> Bool
/= :: ReceiveMessage -> ReceiveMessage -> Bool
Prelude.Eq, ReadPrec [ReceiveMessage]
ReadPrec ReceiveMessage
Int -> ReadS ReceiveMessage
ReadS [ReceiveMessage]
(Int -> ReadS ReceiveMessage)
-> ReadS [ReceiveMessage]
-> ReadPrec ReceiveMessage
-> ReadPrec [ReceiveMessage]
-> Read ReceiveMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ReceiveMessage
readsPrec :: Int -> ReadS ReceiveMessage
$creadList :: ReadS [ReceiveMessage]
readList :: ReadS [ReceiveMessage]
$creadPrec :: ReadPrec ReceiveMessage
readPrec :: ReadPrec ReceiveMessage
$creadListPrec :: ReadPrec [ReceiveMessage]
readListPrec :: ReadPrec [ReceiveMessage]
Prelude.Read, Int -> ReceiveMessage -> ShowS
[ReceiveMessage] -> ShowS
ReceiveMessage -> String
(Int -> ReceiveMessage -> ShowS)
-> (ReceiveMessage -> String)
-> ([ReceiveMessage] -> ShowS)
-> Show ReceiveMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReceiveMessage -> ShowS
showsPrec :: Int -> ReceiveMessage -> ShowS
$cshow :: ReceiveMessage -> String
show :: ReceiveMessage -> String
$cshowList :: [ReceiveMessage] -> ShowS
showList :: [ReceiveMessage] -> ShowS
Prelude.Show, (forall x. ReceiveMessage -> Rep ReceiveMessage x)
-> (forall x. Rep ReceiveMessage x -> ReceiveMessage)
-> Generic ReceiveMessage
forall x. Rep ReceiveMessage x -> ReceiveMessage
forall x. ReceiveMessage -> Rep ReceiveMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ReceiveMessage -> Rep ReceiveMessage x
from :: forall x. ReceiveMessage -> Rep ReceiveMessage x
$cto :: forall x. Rep ReceiveMessage x -> ReceiveMessage
to :: forall x. Rep ReceiveMessage x -> ReceiveMessage
Prelude.Generic)
newReceiveMessage ::
Prelude.Text ->
ReceiveMessage
newReceiveMessage :: Text -> ReceiveMessage
newReceiveMessage Text
pQueueUrl_ =
ReceiveMessage'
{ $sel:attributeNames:ReceiveMessage' :: Maybe [MessageAttribute]
attributeNames = Maybe [MessageAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:maxNumberOfMessages:ReceiveMessage' :: Maybe Int
maxNumberOfMessages = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:messageAttributeNames:ReceiveMessage' :: Maybe [Text]
messageAttributeNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:receiveRequestAttemptId:ReceiveMessage' :: Maybe Text
receiveRequestAttemptId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:visibilityTimeout:ReceiveMessage' :: Maybe Int
visibilityTimeout = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:waitTimeSeconds:ReceiveMessage' :: Maybe Int
waitTimeSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:queueUrl:ReceiveMessage' :: Text
queueUrl = Text
pQueueUrl_
}
receiveMessage_attributeNames :: Lens.Lens' ReceiveMessage (Prelude.Maybe [MessageAttribute])
receiveMessage_attributeNames :: Lens' ReceiveMessage (Maybe [MessageAttribute])
receiveMessage_attributeNames = (ReceiveMessage -> Maybe [MessageAttribute])
-> (ReceiveMessage -> Maybe [MessageAttribute] -> ReceiveMessage)
-> Lens' ReceiveMessage (Maybe [MessageAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Maybe [MessageAttribute]
$sel:attributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [MessageAttribute]
attributeNames :: Maybe [MessageAttribute]
attributeNames} -> Maybe [MessageAttribute]
attributeNames) (\s :: ReceiveMessage
s@ReceiveMessage' {} Maybe [MessageAttribute]
a -> ReceiveMessage
s {attributeNames = a} :: ReceiveMessage) ((Maybe [MessageAttribute] -> f (Maybe [MessageAttribute]))
-> ReceiveMessage -> f ReceiveMessage)
-> ((Maybe [MessageAttribute] -> f (Maybe [MessageAttribute]))
-> Maybe [MessageAttribute] -> f (Maybe [MessageAttribute]))
-> (Maybe [MessageAttribute] -> f (Maybe [MessageAttribute]))
-> ReceiveMessage
-> f ReceiveMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MessageAttribute]
[MessageAttribute]
[MessageAttribute]
[MessageAttribute]
-> Iso
(Maybe [MessageAttribute])
(Maybe [MessageAttribute])
(Maybe [MessageAttribute])
(Maybe [MessageAttribute])
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
[MessageAttribute]
[MessageAttribute]
[MessageAttribute]
[MessageAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Iso
[MessageAttribute]
[MessageAttribute]
[MessageAttribute]
[MessageAttribute]
Lens.coerced
receiveMessage_maxNumberOfMessages :: Lens.Lens' ReceiveMessage (Prelude.Maybe Prelude.Int)
receiveMessage_maxNumberOfMessages :: Lens' ReceiveMessage (Maybe Int)
receiveMessage_maxNumberOfMessages = (ReceiveMessage -> Maybe Int)
-> (ReceiveMessage -> Maybe Int -> ReceiveMessage)
-> Lens' ReceiveMessage (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Maybe Int
$sel:maxNumberOfMessages:ReceiveMessage' :: ReceiveMessage -> Maybe Int
maxNumberOfMessages :: Maybe Int
maxNumberOfMessages} -> Maybe Int
maxNumberOfMessages) (\s :: ReceiveMessage
s@ReceiveMessage' {} Maybe Int
a -> ReceiveMessage
s {maxNumberOfMessages = a} :: ReceiveMessage)
receiveMessage_messageAttributeNames :: Lens.Lens' ReceiveMessage (Prelude.Maybe [Prelude.Text])
receiveMessage_messageAttributeNames :: Lens' ReceiveMessage (Maybe [Text])
receiveMessage_messageAttributeNames = (ReceiveMessage -> Maybe [Text])
-> (ReceiveMessage -> Maybe [Text] -> ReceiveMessage)
-> Lens' ReceiveMessage (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Maybe [Text]
$sel:messageAttributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [Text]
messageAttributeNames :: Maybe [Text]
messageAttributeNames} -> Maybe [Text]
messageAttributeNames) (\s :: ReceiveMessage
s@ReceiveMessage' {} Maybe [Text]
a -> ReceiveMessage
s {messageAttributeNames = a} :: ReceiveMessage) ((Maybe [Text] -> f (Maybe [Text]))
-> ReceiveMessage -> f ReceiveMessage)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ReceiveMessage
-> f ReceiveMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Iso [Text] [Text] [Text] [Text]
Lens.coerced
receiveMessage_receiveRequestAttemptId :: Lens.Lens' ReceiveMessage (Prelude.Maybe Prelude.Text)
receiveMessage_receiveRequestAttemptId :: Lens' ReceiveMessage (Maybe Text)
receiveMessage_receiveRequestAttemptId = (ReceiveMessage -> Maybe Text)
-> (ReceiveMessage -> Maybe Text -> ReceiveMessage)
-> Lens' ReceiveMessage (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Maybe Text
$sel:receiveRequestAttemptId:ReceiveMessage' :: ReceiveMessage -> Maybe Text
receiveRequestAttemptId :: Maybe Text
receiveRequestAttemptId} -> Maybe Text
receiveRequestAttemptId) (\s :: ReceiveMessage
s@ReceiveMessage' {} Maybe Text
a -> ReceiveMessage
s {receiveRequestAttemptId = a} :: ReceiveMessage)
receiveMessage_visibilityTimeout :: Lens.Lens' ReceiveMessage (Prelude.Maybe Prelude.Int)
receiveMessage_visibilityTimeout :: Lens' ReceiveMessage (Maybe Int)
receiveMessage_visibilityTimeout = (ReceiveMessage -> Maybe Int)
-> (ReceiveMessage -> Maybe Int -> ReceiveMessage)
-> Lens' ReceiveMessage (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Maybe Int
$sel:visibilityTimeout:ReceiveMessage' :: ReceiveMessage -> Maybe Int
visibilityTimeout :: Maybe Int
visibilityTimeout} -> Maybe Int
visibilityTimeout) (\s :: ReceiveMessage
s@ReceiveMessage' {} Maybe Int
a -> ReceiveMessage
s {visibilityTimeout = a} :: ReceiveMessage)
receiveMessage_waitTimeSeconds :: Lens.Lens' ReceiveMessage (Prelude.Maybe Prelude.Int)
receiveMessage_waitTimeSeconds :: Lens' ReceiveMessage (Maybe Int)
receiveMessage_waitTimeSeconds = (ReceiveMessage -> Maybe Int)
-> (ReceiveMessage -> Maybe Int -> ReceiveMessage)
-> Lens' ReceiveMessage (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Maybe Int
$sel:waitTimeSeconds:ReceiveMessage' :: ReceiveMessage -> Maybe Int
waitTimeSeconds :: Maybe Int
waitTimeSeconds} -> Maybe Int
waitTimeSeconds) (\s :: ReceiveMessage
s@ReceiveMessage' {} Maybe Int
a -> ReceiveMessage
s {waitTimeSeconds = a} :: ReceiveMessage)
receiveMessage_queueUrl :: Lens.Lens' ReceiveMessage Prelude.Text
receiveMessage_queueUrl :: Lens' ReceiveMessage Text
receiveMessage_queueUrl = (ReceiveMessage -> Text)
-> (ReceiveMessage -> Text -> ReceiveMessage)
-> Lens' ReceiveMessage Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessage' {Text
$sel:queueUrl:ReceiveMessage' :: ReceiveMessage -> Text
queueUrl :: Text
queueUrl} -> Text
queueUrl) (\s :: ReceiveMessage
s@ReceiveMessage' {} Text
a -> ReceiveMessage
s {queueUrl = a} :: ReceiveMessage)
instance Core.AWSRequest ReceiveMessage where
type
AWSResponse ReceiveMessage =
ReceiveMessageResponse
request :: (Service -> Service) -> ReceiveMessage -> Request ReceiveMessage
request Service -> Service
overrides =
Service -> ReceiveMessage -> Request ReceiveMessage
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ReceiveMessage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ReceiveMessage)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ReceiveMessage))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ReceiveMessage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ReceiveMessage)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ReceiveMessageResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [Message] -> Int -> ReceiveMessageResponse
ReceiveMessageResponse'
(Maybe [Message] -> Int -> ReceiveMessageResponse)
-> Either String (Maybe [Message])
-> Either String (Int -> ReceiveMessageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (([Node] -> Either String [Message])
-> [Node] -> Either String (Maybe [Message])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Message]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"Message") [Node]
x)
Either String (Int -> ReceiveMessageResponse)
-> Either String Int -> Either String ReceiveMessageResponse
forall a b.
Either String (a -> b) -> Either String a -> Either String b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ReceiveMessage where
hashWithSalt :: Int -> ReceiveMessage -> Int
hashWithSalt Int
_salt ReceiveMessage' {Maybe Int
Maybe [Text]
Maybe [MessageAttribute]
Maybe Text
Text
$sel:attributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [MessageAttribute]
$sel:maxNumberOfMessages:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:messageAttributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [Text]
$sel:receiveRequestAttemptId:ReceiveMessage' :: ReceiveMessage -> Maybe Text
$sel:visibilityTimeout:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:waitTimeSeconds:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:queueUrl:ReceiveMessage' :: ReceiveMessage -> Text
attributeNames :: Maybe [MessageAttribute]
maxNumberOfMessages :: Maybe Int
messageAttributeNames :: Maybe [Text]
receiveRequestAttemptId :: Maybe Text
visibilityTimeout :: Maybe Int
waitTimeSeconds :: Maybe Int
queueUrl :: Text
..} =
Int
_salt
Int -> Maybe [MessageAttribute] -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MessageAttribute]
attributeNames
Int -> Maybe Int -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxNumberOfMessages
Int -> Maybe [Text] -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
messageAttributeNames
Int -> Maybe Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
receiveRequestAttemptId
Int -> Maybe Int -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
visibilityTimeout
Int -> Maybe Int -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
waitTimeSeconds
Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
queueUrl
instance Prelude.NFData ReceiveMessage where
rnf :: ReceiveMessage -> ()
rnf ReceiveMessage' {Maybe Int
Maybe [Text]
Maybe [MessageAttribute]
Maybe Text
Text
$sel:attributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [MessageAttribute]
$sel:maxNumberOfMessages:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:messageAttributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [Text]
$sel:receiveRequestAttemptId:ReceiveMessage' :: ReceiveMessage -> Maybe Text
$sel:visibilityTimeout:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:waitTimeSeconds:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:queueUrl:ReceiveMessage' :: ReceiveMessage -> Text
attributeNames :: Maybe [MessageAttribute]
maxNumberOfMessages :: Maybe Int
messageAttributeNames :: Maybe [Text]
receiveRequestAttemptId :: Maybe Text
visibilityTimeout :: Maybe Int
waitTimeSeconds :: Maybe Int
queueUrl :: Text
..} =
Maybe [MessageAttribute] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [MessageAttribute]
attributeNames
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxNumberOfMessages
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe [Text] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
messageAttributeNames
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
receiveRequestAttemptId
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
visibilityTimeout
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Maybe Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
waitTimeSeconds
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
queueUrl
instance Data.ToHeaders ReceiveMessage where
toHeaders :: ReceiveMessage -> ResponseHeaders
toHeaders = ResponseHeaders -> ReceiveMessage -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ReceiveMessage where
toPath :: ReceiveMessage -> ByteString
toPath = ByteString -> ReceiveMessage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ReceiveMessage where
toQuery :: ReceiveMessage -> QueryString
toQuery ReceiveMessage' {Maybe Int
Maybe [Text]
Maybe [MessageAttribute]
Maybe Text
Text
$sel:attributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [MessageAttribute]
$sel:maxNumberOfMessages:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:messageAttributeNames:ReceiveMessage' :: ReceiveMessage -> Maybe [Text]
$sel:receiveRequestAttemptId:ReceiveMessage' :: ReceiveMessage -> Maybe Text
$sel:visibilityTimeout:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:waitTimeSeconds:ReceiveMessage' :: ReceiveMessage -> Maybe Int
$sel:queueUrl:ReceiveMessage' :: ReceiveMessage -> Text
attributeNames :: Maybe [MessageAttribute]
maxNumberOfMessages :: Maybe Int
messageAttributeNames :: Maybe [Text]
receiveRequestAttemptId :: Maybe Text
visibilityTimeout :: Maybe Int
waitTimeSeconds :: Maybe Int
queueUrl :: Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ReceiveMessage" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-11-05" :: Prelude.ByteString),
Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Data.toQuery
( ByteString -> [MessageAttribute] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AttributeName"
([MessageAttribute] -> QueryString)
-> Maybe [MessageAttribute] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MessageAttribute]
attributeNames
),
ByteString
"MaxNumberOfMessages" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxNumberOfMessages,
Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Data.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"MessageAttributeName"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
messageAttributeNames
),
ByteString
"ReceiveRequestAttemptId"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
receiveRequestAttemptId,
ByteString
"VisibilityTimeout" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
visibilityTimeout,
ByteString
"WaitTimeSeconds" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
waitTimeSeconds,
ByteString
"QueueUrl" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
queueUrl
]
data ReceiveMessageResponse = ReceiveMessageResponse'
{
ReceiveMessageResponse -> Maybe [Message]
messages :: Prelude.Maybe [Message],
ReceiveMessageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ReceiveMessageResponse -> ReceiveMessageResponse -> Bool
(ReceiveMessageResponse -> ReceiveMessageResponse -> Bool)
-> (ReceiveMessageResponse -> ReceiveMessageResponse -> Bool)
-> Eq ReceiveMessageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReceiveMessageResponse -> ReceiveMessageResponse -> Bool
== :: ReceiveMessageResponse -> ReceiveMessageResponse -> Bool
$c/= :: ReceiveMessageResponse -> ReceiveMessageResponse -> Bool
/= :: ReceiveMessageResponse -> ReceiveMessageResponse -> Bool
Prelude.Eq, ReadPrec [ReceiveMessageResponse]
ReadPrec ReceiveMessageResponse
Int -> ReadS ReceiveMessageResponse
ReadS [ReceiveMessageResponse]
(Int -> ReadS ReceiveMessageResponse)
-> ReadS [ReceiveMessageResponse]
-> ReadPrec ReceiveMessageResponse
-> ReadPrec [ReceiveMessageResponse]
-> Read ReceiveMessageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS ReceiveMessageResponse
readsPrec :: Int -> ReadS ReceiveMessageResponse
$creadList :: ReadS [ReceiveMessageResponse]
readList :: ReadS [ReceiveMessageResponse]
$creadPrec :: ReadPrec ReceiveMessageResponse
readPrec :: ReadPrec ReceiveMessageResponse
$creadListPrec :: ReadPrec [ReceiveMessageResponse]
readListPrec :: ReadPrec [ReceiveMessageResponse]
Prelude.Read, Int -> ReceiveMessageResponse -> ShowS
[ReceiveMessageResponse] -> ShowS
ReceiveMessageResponse -> String
(Int -> ReceiveMessageResponse -> ShowS)
-> (ReceiveMessageResponse -> String)
-> ([ReceiveMessageResponse] -> ShowS)
-> Show ReceiveMessageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReceiveMessageResponse -> ShowS
showsPrec :: Int -> ReceiveMessageResponse -> ShowS
$cshow :: ReceiveMessageResponse -> String
show :: ReceiveMessageResponse -> String
$cshowList :: [ReceiveMessageResponse] -> ShowS
showList :: [ReceiveMessageResponse] -> ShowS
Prelude.Show, (forall x. ReceiveMessageResponse -> Rep ReceiveMessageResponse x)
-> (forall x.
Rep ReceiveMessageResponse x -> ReceiveMessageResponse)
-> Generic ReceiveMessageResponse
forall x. Rep ReceiveMessageResponse x -> ReceiveMessageResponse
forall x. ReceiveMessageResponse -> Rep ReceiveMessageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ReceiveMessageResponse -> Rep ReceiveMessageResponse x
from :: forall x. ReceiveMessageResponse -> Rep ReceiveMessageResponse x
$cto :: forall x. Rep ReceiveMessageResponse x -> ReceiveMessageResponse
to :: forall x. Rep ReceiveMessageResponse x -> ReceiveMessageResponse
Prelude.Generic)
newReceiveMessageResponse ::
Prelude.Int ->
ReceiveMessageResponse
newReceiveMessageResponse :: Int -> ReceiveMessageResponse
newReceiveMessageResponse Int
pHttpStatus_ =
ReceiveMessageResponse'
{ $sel:messages:ReceiveMessageResponse' :: Maybe [Message]
messages = Maybe [Message]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ReceiveMessageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
receiveMessageResponse_messages :: Lens.Lens' ReceiveMessageResponse (Prelude.Maybe [Message])
receiveMessageResponse_messages :: Lens' ReceiveMessageResponse (Maybe [Message])
receiveMessageResponse_messages = (ReceiveMessageResponse -> Maybe [Message])
-> (ReceiveMessageResponse
-> Maybe [Message] -> ReceiveMessageResponse)
-> Lens' ReceiveMessageResponse (Maybe [Message])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessageResponse' {Maybe [Message]
$sel:messages:ReceiveMessageResponse' :: ReceiveMessageResponse -> Maybe [Message]
messages :: Maybe [Message]
messages} -> Maybe [Message]
messages) (\s :: ReceiveMessageResponse
s@ReceiveMessageResponse' {} Maybe [Message]
a -> ReceiveMessageResponse
s {messages = a} :: ReceiveMessageResponse) ((Maybe [Message] -> f (Maybe [Message]))
-> ReceiveMessageResponse -> f ReceiveMessageResponse)
-> ((Maybe [Message] -> f (Maybe [Message]))
-> Maybe [Message] -> f (Maybe [Message]))
-> (Maybe [Message] -> f (Maybe [Message]))
-> ReceiveMessageResponse
-> f ReceiveMessageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Message] [Message] [Message] [Message]
-> Iso
(Maybe [Message])
(Maybe [Message])
(Maybe [Message])
(Maybe [Message])
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 [Message] [Message] [Message] [Message]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Iso [Message] [Message] [Message] [Message]
Lens.coerced
receiveMessageResponse_httpStatus :: Lens.Lens' ReceiveMessageResponse Prelude.Int
receiveMessageResponse_httpStatus :: Lens' ReceiveMessageResponse Int
receiveMessageResponse_httpStatus = (ReceiveMessageResponse -> Int)
-> (ReceiveMessageResponse -> Int -> ReceiveMessageResponse)
-> Lens' ReceiveMessageResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReceiveMessageResponse' {Int
$sel:httpStatus:ReceiveMessageResponse' :: ReceiveMessageResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: ReceiveMessageResponse
s@ReceiveMessageResponse' {} Int
a -> ReceiveMessageResponse
s {httpStatus = a} :: ReceiveMessageResponse)
instance Prelude.NFData ReceiveMessageResponse where
rnf :: ReceiveMessageResponse -> ()
rnf ReceiveMessageResponse' {Int
Maybe [Message]
$sel:messages:ReceiveMessageResponse' :: ReceiveMessageResponse -> Maybe [Message]
$sel:httpStatus:ReceiveMessageResponse' :: ReceiveMessageResponse -> Int
messages :: Maybe [Message]
httpStatus :: Int
..} =
Maybe [Message] -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Message]
messages
() -> () -> ()
forall a b. a -> b -> b
`Prelude.seq` Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus