amazonka-sns-2.0: Amazon Simple Notification Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.SNS.PublishBatch

Description

Publishes up to ten messages to the specified topic. This is a batch version of Publish. For FIFO topics, multiple messages within a single batch are published in the order they are sent, and messages are deduplicated within the batch and across batches for 5 minutes.

The result of publishing each message is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of 200.

The maximum allowed individual message size and the maximum total payload size (the sum of the individual lengths of all of the batched messages) are both 256 KB (262,144 bytes).

Some actions take lists of parameters. These lists are specified using the param.n notation. Values of n are integers starting from 1. For example, a parameter list with two elements looks like this:

&AttributeName.1=first

&AttributeName.2=second

If you send a batch message to a topic, Amazon SNS publishes the batch message to each endpoint that is subscribed to the topic. The format of the batch message depends on the notification protocol for each subscribed endpoint.

When a messageId is returned, the batch message is saved and Amazon SNS immediately delivers the message to subscribers.

Synopsis

Creating a Request

data PublishBatch Source #

See: newPublishBatch smart constructor.

Constructors

PublishBatch' 

Fields

Instances

Instances details
ToHeaders PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

ToPath PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

ToQuery PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

AWSRequest PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Associated Types

type AWSResponse PublishBatch #

Generic PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Associated Types

type Rep PublishBatch :: Type -> Type #

Read PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Show PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

NFData PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Methods

rnf :: PublishBatch -> () #

Eq PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Hashable PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

type AWSResponse PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

type Rep PublishBatch Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

type Rep PublishBatch = D1 ('MetaData "PublishBatch" "Amazonka.SNS.PublishBatch" "amazonka-sns-2.0-4k7AiJI7DyqhOUy5o4qb9" 'False) (C1 ('MetaCons "PublishBatch'" 'PrefixI 'True) (S1 ('MetaSel ('Just "topicArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "publishBatchRequestEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PublishBatchRequestEntry])))

newPublishBatch Source #

Create a value of PublishBatch with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

PublishBatch, publishBatch_topicArn - The Amazon resource name (ARN) of the topic you want to batch publish to.

$sel:publishBatchRequestEntries:PublishBatch', publishBatch_publishBatchRequestEntries - A list of PublishBatch request entries to be sent to the SNS topic.

Request Lenses

publishBatch_topicArn :: Lens' PublishBatch Text Source #

The Amazon resource name (ARN) of the topic you want to batch publish to.

publishBatch_publishBatchRequestEntries :: Lens' PublishBatch [PublishBatchRequestEntry] Source #

A list of PublishBatch request entries to be sent to the SNS topic.

Destructuring the Response

data PublishBatchResponse Source #

See: newPublishBatchResponse smart constructor.

Constructors

PublishBatchResponse' 

Fields

Instances

Instances details
Generic PublishBatchResponse Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Associated Types

type Rep PublishBatchResponse :: Type -> Type #

Read PublishBatchResponse Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Show PublishBatchResponse Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

NFData PublishBatchResponse Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

Methods

rnf :: PublishBatchResponse -> () #

Eq PublishBatchResponse Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

type Rep PublishBatchResponse Source # 
Instance details

Defined in Amazonka.SNS.PublishBatch

type Rep PublishBatchResponse = D1 ('MetaData "PublishBatchResponse" "Amazonka.SNS.PublishBatch" "amazonka-sns-2.0-4k7AiJI7DyqhOUy5o4qb9" 'False) (C1 ('MetaCons "PublishBatchResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "failed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [BatchResultErrorEntry])) :*: (S1 ('MetaSel ('Just "successful") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [PublishBatchResultEntry])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newPublishBatchResponse Source #

Create a value of PublishBatchResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:failed:PublishBatchResponse', publishBatchResponse_failed - A list of failed PublishBatch responses.

$sel:successful:PublishBatchResponse', publishBatchResponse_successful - A list of successful PublishBatch responses.

$sel:httpStatus:PublishBatchResponse', publishBatchResponse_httpStatus - The response's http status code.

Response Lenses