{-# 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.SNS.Publish
(
Publish (..),
newPublish,
publish_subject,
publish_targetArn,
publish_messageAttributes,
publish_topicArn,
publish_phoneNumber,
publish_messageDeduplicationId,
publish_messageStructure,
publish_messageGroupId,
publish_message,
PublishResponse (..),
newPublishResponse,
publishResponse_sequenceNumber,
publishResponse_messageId,
publishResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SNS.Types
data Publish = Publish'
{
Publish -> Maybe Text
subject :: Prelude.Maybe Prelude.Text,
Publish -> Maybe Text
targetArn :: Prelude.Maybe Prelude.Text,
Publish -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue),
Publish -> Maybe Text
topicArn :: Prelude.Maybe Prelude.Text,
Publish -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text,
Publish -> Maybe Text
messageDeduplicationId :: Prelude.Maybe Prelude.Text,
Publish -> Maybe Text
messageStructure :: Prelude.Maybe Prelude.Text,
Publish -> Maybe Text
messageGroupId :: Prelude.Maybe Prelude.Text,
Publish -> Text
message :: Prelude.Text
}
deriving (Publish -> Publish -> Bool
(Publish -> Publish -> Bool)
-> (Publish -> Publish -> Bool) -> Eq Publish
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Publish -> Publish -> Bool
$c/= :: Publish -> Publish -> Bool
== :: Publish -> Publish -> Bool
$c== :: Publish -> Publish -> Bool
Prelude.Eq, ReadPrec [Publish]
ReadPrec Publish
Int -> ReadS Publish
ReadS [Publish]
(Int -> ReadS Publish)
-> ReadS [Publish]
-> ReadPrec Publish
-> ReadPrec [Publish]
-> Read Publish
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Publish]
$creadListPrec :: ReadPrec [Publish]
readPrec :: ReadPrec Publish
$creadPrec :: ReadPrec Publish
readList :: ReadS [Publish]
$creadList :: ReadS [Publish]
readsPrec :: Int -> ReadS Publish
$creadsPrec :: Int -> ReadS Publish
Prelude.Read, Int -> Publish -> ShowS
[Publish] -> ShowS
Publish -> String
(Int -> Publish -> ShowS)
-> (Publish -> String) -> ([Publish] -> ShowS) -> Show Publish
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Publish] -> ShowS
$cshowList :: [Publish] -> ShowS
show :: Publish -> String
$cshow :: Publish -> String
showsPrec :: Int -> Publish -> ShowS
$cshowsPrec :: Int -> Publish -> ShowS
Prelude.Show, (forall x. Publish -> Rep Publish x)
-> (forall x. Rep Publish x -> Publish) -> Generic Publish
forall x. Rep Publish x -> Publish
forall x. Publish -> Rep Publish x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Publish x -> Publish
$cfrom :: forall x. Publish -> Rep Publish x
Prelude.Generic)
newPublish ::
Prelude.Text ->
Publish
newPublish :: Text -> Publish
newPublish Text
pMessage_ =
Publish' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text MessageAttributeValue)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Publish
Publish'
{ $sel:subject:Publish' :: Maybe Text
subject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetArn:Publish' :: Maybe Text
targetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageAttributes:Publish' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes = Maybe (HashMap Text MessageAttributeValue)
forall a. Maybe a
Prelude.Nothing,
$sel:topicArn:Publish' :: Maybe Text
topicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:Publish' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageDeduplicationId:Publish' :: Maybe Text
messageDeduplicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageStructure:Publish' :: Maybe Text
messageStructure = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageGroupId:Publish' :: Maybe Text
messageGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:Publish' :: Text
message = Text
pMessage_
}
publish_subject :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_subject :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_subject = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
subject :: Maybe Text
$sel:subject:Publish' :: Publish -> Maybe Text
subject} -> Maybe Text
subject) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:subject:Publish' :: Maybe Text
subject = Maybe Text
a} :: Publish)
publish_targetArn :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_targetArn :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_targetArn = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
targetArn :: Maybe Text
$sel:targetArn:Publish' :: Publish -> Maybe Text
targetArn} -> Maybe Text
targetArn) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:targetArn:Publish' :: Maybe Text
targetArn = Maybe Text
a} :: Publish)
publish_messageAttributes :: Lens.Lens' Publish (Prelude.Maybe (Prelude.HashMap Prelude.Text MessageAttributeValue))
publish_messageAttributes :: (Maybe (HashMap Text MessageAttributeValue)
-> f (Maybe (HashMap Text MessageAttributeValue)))
-> Publish -> f Publish
publish_messageAttributes = (Publish -> Maybe (HashMap Text MessageAttributeValue))
-> (Publish
-> Maybe (HashMap Text MessageAttributeValue) -> Publish)
-> Lens
Publish
Publish
(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 (\Publish' {Maybe (HashMap Text MessageAttributeValue)
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
$sel:messageAttributes:Publish' :: Publish -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes} -> Maybe (HashMap Text MessageAttributeValue)
messageAttributes) (\s :: Publish
s@Publish' {} Maybe (HashMap Text MessageAttributeValue)
a -> Publish
s {$sel:messageAttributes:Publish' :: Maybe (HashMap Text MessageAttributeValue)
messageAttributes = Maybe (HashMap Text MessageAttributeValue)
a} :: Publish) ((Maybe (HashMap Text MessageAttributeValue)
-> f (Maybe (HashMap Text MessageAttributeValue)))
-> Publish -> f Publish)
-> ((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)))
-> Publish
-> f Publish
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
publish_topicArn :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_topicArn :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_topicArn = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
topicArn :: Maybe Text
$sel:topicArn:Publish' :: Publish -> Maybe Text
topicArn} -> Maybe Text
topicArn) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:topicArn:Publish' :: Maybe Text
topicArn = Maybe Text
a} :: Publish)
publish_phoneNumber :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_phoneNumber :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_phoneNumber = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:Publish' :: Publish -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:phoneNumber:Publish' :: Maybe Text
phoneNumber = Maybe Text
a} :: Publish)
publish_messageDeduplicationId :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_messageDeduplicationId :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_messageDeduplicationId = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
messageDeduplicationId :: Maybe Text
$sel:messageDeduplicationId:Publish' :: Publish -> Maybe Text
messageDeduplicationId} -> Maybe Text
messageDeduplicationId) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:messageDeduplicationId:Publish' :: Maybe Text
messageDeduplicationId = Maybe Text
a} :: Publish)
publish_messageStructure :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_messageStructure :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_messageStructure = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
messageStructure :: Maybe Text
$sel:messageStructure:Publish' :: Publish -> Maybe Text
messageStructure} -> Maybe Text
messageStructure) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:messageStructure:Publish' :: Maybe Text
messageStructure = Maybe Text
a} :: Publish)
publish_messageGroupId :: Lens.Lens' Publish (Prelude.Maybe Prelude.Text)
publish_messageGroupId :: (Maybe Text -> f (Maybe Text)) -> Publish -> f Publish
publish_messageGroupId = (Publish -> Maybe Text)
-> (Publish -> Maybe Text -> Publish)
-> Lens Publish Publish (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Maybe Text
messageGroupId :: Maybe Text
$sel:messageGroupId:Publish' :: Publish -> Maybe Text
messageGroupId} -> Maybe Text
messageGroupId) (\s :: Publish
s@Publish' {} Maybe Text
a -> Publish
s {$sel:messageGroupId:Publish' :: Maybe Text
messageGroupId = Maybe Text
a} :: Publish)
publish_message :: Lens.Lens' Publish Prelude.Text
publish_message :: (Text -> f Text) -> Publish -> f Publish
publish_message = (Publish -> Text)
-> (Publish -> Text -> Publish) -> Lens Publish Publish Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Publish' {Text
message :: Text
$sel:message:Publish' :: Publish -> Text
message} -> Text
message) (\s :: Publish
s@Publish' {} Text
a -> Publish
s {$sel:message:Publish' :: Text
message = Text
a} :: Publish)
instance Core.AWSRequest Publish where
type AWSResponse Publish = PublishResponse
request :: Publish -> Request Publish
request = Service -> Publish -> Request Publish
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy Publish
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse Publish)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse Publish))
-> Logger
-> Service
-> Proxy Publish
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse Publish)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"PublishResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Maybe Text -> Int -> PublishResponse
PublishResponse'
(Maybe Text -> Maybe Text -> Int -> PublishResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> PublishResponse)
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
"SequenceNumber")
Either String (Maybe Text -> Int -> PublishResponse)
-> Either String (Maybe Text)
-> Either String (Int -> PublishResponse)
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 (Int -> PublishResponse)
-> Either String Int -> Either String PublishResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
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 Publish
instance Prelude.NFData Publish
instance Core.ToHeaders Publish where
toHeaders :: Publish -> ResponseHeaders
toHeaders = ResponseHeaders -> Publish -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath Publish where
toPath :: Publish -> ByteString
toPath = ByteString -> Publish -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery Publish where
toQuery :: Publish -> QueryString
toQuery Publish' {Maybe Text
Maybe (HashMap Text MessageAttributeValue)
Text
message :: Text
messageGroupId :: Maybe Text
messageStructure :: Maybe Text
messageDeduplicationId :: Maybe Text
phoneNumber :: Maybe Text
topicArn :: Maybe Text
messageAttributes :: Maybe (HashMap Text MessageAttributeValue)
targetArn :: Maybe Text
subject :: Maybe Text
$sel:message:Publish' :: Publish -> Text
$sel:messageGroupId:Publish' :: Publish -> Maybe Text
$sel:messageStructure:Publish' :: Publish -> Maybe Text
$sel:messageDeduplicationId:Publish' :: Publish -> Maybe Text
$sel:phoneNumber:Publish' :: Publish -> Maybe Text
$sel:topicArn:Publish' :: Publish -> Maybe Text
$sel:messageAttributes:Publish' :: Publish -> Maybe (HashMap Text MessageAttributeValue)
$sel:targetArn:Publish' :: Publish -> Maybe Text
$sel:subject:Publish' :: Publish -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action" ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"Publish" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
ByteString
"Subject" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
subject,
ByteString
"TargetArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
targetArn,
ByteString
"MessageAttributes"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString
-> ByteString
-> ByteString
-> HashMap Text MessageAttributeValue
-> QueryString
forall k v.
(ToQuery k, ToQuery v) =>
ByteString
-> ByteString -> ByteString -> HashMap k v -> QueryString
Core.toQueryMap ByteString
"entry" ByteString
"Name" ByteString
"Value"
(HashMap Text MessageAttributeValue -> QueryString)
-> Maybe (HashMap Text MessageAttributeValue) -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text MessageAttributeValue)
messageAttributes
),
ByteString
"TopicArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
topicArn,
ByteString
"PhoneNumber" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
phoneNumber,
ByteString
"MessageDeduplicationId"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
messageDeduplicationId,
ByteString
"MessageStructure" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
messageStructure,
ByteString
"MessageGroupId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
messageGroupId,
ByteString
"Message" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
message
]
data PublishResponse = PublishResponse'
{
PublishResponse -> Maybe Text
sequenceNumber :: Prelude.Maybe Prelude.Text,
PublishResponse -> Maybe Text
messageId :: Prelude.Maybe Prelude.Text,
PublishResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PublishResponse -> PublishResponse -> Bool
(PublishResponse -> PublishResponse -> Bool)
-> (PublishResponse -> PublishResponse -> Bool)
-> Eq PublishResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublishResponse -> PublishResponse -> Bool
$c/= :: PublishResponse -> PublishResponse -> Bool
== :: PublishResponse -> PublishResponse -> Bool
$c== :: PublishResponse -> PublishResponse -> Bool
Prelude.Eq, ReadPrec [PublishResponse]
ReadPrec PublishResponse
Int -> ReadS PublishResponse
ReadS [PublishResponse]
(Int -> ReadS PublishResponse)
-> ReadS [PublishResponse]
-> ReadPrec PublishResponse
-> ReadPrec [PublishResponse]
-> Read PublishResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublishResponse]
$creadListPrec :: ReadPrec [PublishResponse]
readPrec :: ReadPrec PublishResponse
$creadPrec :: ReadPrec PublishResponse
readList :: ReadS [PublishResponse]
$creadList :: ReadS [PublishResponse]
readsPrec :: Int -> ReadS PublishResponse
$creadsPrec :: Int -> ReadS PublishResponse
Prelude.Read, Int -> PublishResponse -> ShowS
[PublishResponse] -> ShowS
PublishResponse -> String
(Int -> PublishResponse -> ShowS)
-> (PublishResponse -> String)
-> ([PublishResponse] -> ShowS)
-> Show PublishResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublishResponse] -> ShowS
$cshowList :: [PublishResponse] -> ShowS
show :: PublishResponse -> String
$cshow :: PublishResponse -> String
showsPrec :: Int -> PublishResponse -> ShowS
$cshowsPrec :: Int -> PublishResponse -> ShowS
Prelude.Show, (forall x. PublishResponse -> Rep PublishResponse x)
-> (forall x. Rep PublishResponse x -> PublishResponse)
-> Generic PublishResponse
forall x. Rep PublishResponse x -> PublishResponse
forall x. PublishResponse -> Rep PublishResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PublishResponse x -> PublishResponse
$cfrom :: forall x. PublishResponse -> Rep PublishResponse x
Prelude.Generic)
newPublishResponse ::
Prelude.Int ->
PublishResponse
newPublishResponse :: Int -> PublishResponse
newPublishResponse Int
pHttpStatus_ =
PublishResponse' :: Maybe Text -> Maybe Text -> Int -> PublishResponse
PublishResponse'
{ $sel:sequenceNumber:PublishResponse' :: Maybe Text
sequenceNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:messageId:PublishResponse' :: Maybe Text
messageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PublishResponse' :: Int
httpStatus = Int
pHttpStatus_
}
publishResponse_sequenceNumber :: Lens.Lens' PublishResponse (Prelude.Maybe Prelude.Text)
publishResponse_sequenceNumber :: (Maybe Text -> f (Maybe Text))
-> PublishResponse -> f PublishResponse
publishResponse_sequenceNumber = (PublishResponse -> Maybe Text)
-> (PublishResponse -> Maybe Text -> PublishResponse)
-> Lens PublishResponse PublishResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishResponse' {Maybe Text
sequenceNumber :: Maybe Text
$sel:sequenceNumber:PublishResponse' :: PublishResponse -> Maybe Text
sequenceNumber} -> Maybe Text
sequenceNumber) (\s :: PublishResponse
s@PublishResponse' {} Maybe Text
a -> PublishResponse
s {$sel:sequenceNumber:PublishResponse' :: Maybe Text
sequenceNumber = Maybe Text
a} :: PublishResponse)
publishResponse_messageId :: Lens.Lens' PublishResponse (Prelude.Maybe Prelude.Text)
publishResponse_messageId :: (Maybe Text -> f (Maybe Text))
-> PublishResponse -> f PublishResponse
publishResponse_messageId = (PublishResponse -> Maybe Text)
-> (PublishResponse -> Maybe Text -> PublishResponse)
-> Lens PublishResponse PublishResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishResponse' {Maybe Text
messageId :: Maybe Text
$sel:messageId:PublishResponse' :: PublishResponse -> Maybe Text
messageId} -> Maybe Text
messageId) (\s :: PublishResponse
s@PublishResponse' {} Maybe Text
a -> PublishResponse
s {$sel:messageId:PublishResponse' :: Maybe Text
messageId = Maybe Text
a} :: PublishResponse)
publishResponse_httpStatus :: Lens.Lens' PublishResponse Prelude.Int
publishResponse_httpStatus :: (Int -> f Int) -> PublishResponse -> f PublishResponse
publishResponse_httpStatus = (PublishResponse -> Int)
-> (PublishResponse -> Int -> PublishResponse)
-> Lens PublishResponse PublishResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublishResponse' {Int
httpStatus :: Int
$sel:httpStatus:PublishResponse' :: PublishResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PublishResponse
s@PublishResponse' {} Int
a -> PublishResponse
s {$sel:httpStatus:PublishResponse' :: Int
httpStatus = Int
a} :: PublishResponse)
instance Prelude.NFData PublishResponse