aws-sdk-sns 1.22.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +275 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-sns/client.rb +319 -139
- data/lib/aws-sdk-sns/client_api.rb +6 -1
- data/lib/aws-sdk-sns/customizations.rb +2 -0
- data/lib/aws-sdk-sns/errors.rb +3 -1
- data/lib/aws-sdk-sns/message_verifier.rb +24 -5
- data/lib/aws-sdk-sns/platform_application.rb +20 -17
- data/lib/aws-sdk-sns/platform_endpoint.rb +30 -1
- data/lib/aws-sdk-sns/resource.rb +38 -4
- data/lib/aws-sdk-sns/subscription.rb +45 -3
- data/lib/aws-sdk-sns/topic.rb +119 -25
- data/lib/aws-sdk-sns/types.rb +315 -50
- data/lib/aws-sdk-sns.rb +6 -3
- metadata +9 -6
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -362,9 +364,12 @@ module Aws::SNS
|
|
362
364
|
PublishInput.add_member(:subject, Shapes::ShapeRef.new(shape: subject, location_name: "Subject"))
|
363
365
|
PublishInput.add_member(:message_structure, Shapes::ShapeRef.new(shape: messageStructure, location_name: "MessageStructure"))
|
364
366
|
PublishInput.add_member(:message_attributes, Shapes::ShapeRef.new(shape: MessageAttributeMap, location_name: "MessageAttributes"))
|
367
|
+
PublishInput.add_member(:message_deduplication_id, Shapes::ShapeRef.new(shape: String, location_name: "MessageDeduplicationId"))
|
368
|
+
PublishInput.add_member(:message_group_id, Shapes::ShapeRef.new(shape: String, location_name: "MessageGroupId"))
|
365
369
|
PublishInput.struct_class = Types::PublishInput
|
366
370
|
|
367
371
|
PublishResponse.add_member(:message_id, Shapes::ShapeRef.new(shape: messageId, location_name: "MessageId"))
|
372
|
+
PublishResponse.add_member(:sequence_number, Shapes::ShapeRef.new(shape: String, location_name: "SequenceNumber"))
|
368
373
|
PublishResponse.struct_class = Types::PublishResponse
|
369
374
|
|
370
375
|
RemovePermissionInput.add_member(:topic_arn, Shapes::ShapeRef.new(shape: topicARN, required: true, location_name: "TopicArn"))
|
data/lib/aws-sdk-sns/errors.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'net/http'
|
2
4
|
require 'openssl'
|
3
5
|
require 'base64'
|
4
6
|
|
5
7
|
module Aws
|
6
8
|
module SNS
|
7
|
-
|
8
9
|
# A utility class that can be used to verify the authenticity of messages
|
9
10
|
# sent by Amazon SNS.
|
10
11
|
#
|
@@ -31,16 +32,20 @@ module Aws
|
|
31
32
|
'Timestamp',
|
32
33
|
'Token',
|
33
34
|
'TopicArn',
|
34
|
-
'Type'
|
35
|
+
'Type'
|
35
36
|
].freeze
|
36
37
|
|
37
38
|
# @api private
|
38
39
|
AWS_HOSTNAMES = [
|
39
40
|
/^sns\.[a-zA-Z0-9\-]{3,}\.amazonaws\.com(\.cn)?$/
|
40
|
-
]
|
41
|
+
].freeze
|
41
42
|
|
42
|
-
|
43
|
+
# @param [Hash] http_options Supported options to be passed to Net::HTTP.
|
44
|
+
# @option http_options [String] :http_proxy A proxy to send
|
45
|
+
# requests through. Formatted like 'http://proxy.com:123'.
|
46
|
+
def initialize(http_options = {})
|
43
47
|
@cached_pems = {}
|
48
|
+
@http_proxy = http_options[:http_proxy]
|
44
49
|
end
|
45
50
|
|
46
51
|
# @param [String<JSON>] message_body
|
@@ -149,7 +154,11 @@ module Aws
|
|
149
154
|
end
|
150
155
|
|
151
156
|
def https_get(uri, failed_attempts = 0)
|
152
|
-
|
157
|
+
args = []
|
158
|
+
args << uri.host
|
159
|
+
args << uri.port
|
160
|
+
args += http_proxy_parts
|
161
|
+
http = Net::HTTP.new(*args.compact)
|
153
162
|
http.use_ssl = true
|
154
163
|
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
155
164
|
http.start
|
@@ -166,6 +175,16 @@ module Aws
|
|
166
175
|
raise VerificationError, error.message
|
167
176
|
end
|
168
177
|
|
178
|
+
def http_proxy_parts
|
179
|
+
# empty string if not configured, URI parts return nil
|
180
|
+
http_proxy = URI.parse(@http_proxy.to_s)
|
181
|
+
[
|
182
|
+
http_proxy.host,
|
183
|
+
http_proxy.port,
|
184
|
+
(http_proxy.user && CGI.unescape(http_proxy.user)),
|
185
|
+
(http_proxy.password && CGI.unescape(http_proxy.password))
|
186
|
+
]
|
187
|
+
end
|
169
188
|
end
|
170
189
|
end
|
171
190
|
end
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -103,8 +105,8 @@ module Aws::SNS
|
|
103
105
|
# device. The specific name for Token will vary, depending on which
|
104
106
|
# notification service is being used. For example, when using APNS as
|
105
107
|
# the notification service, you need the device token. Alternatively,
|
106
|
-
# when using
|
107
|
-
# registration ID.
|
108
|
+
# when using GCM (Firebase Cloud Messaging) or ADM, the device token
|
109
|
+
# equivalent is called the registration ID.
|
108
110
|
# @option options [String] :custom_user_data
|
109
111
|
# Arbitrary user data to associate with the endpoint. Amazon SNS does
|
110
112
|
# not use this data. The data must be in UTF-8 format and less than 2KB.
|
@@ -148,26 +150,27 @@ module Aws::SNS
|
|
148
150
|
# include the following:
|
149
151
|
#
|
150
152
|
# * `PlatformCredential` – The credential received from the notification
|
151
|
-
# service. For APNS
|
152
|
-
#
|
153
|
-
# PlatformCredential is
|
153
|
+
# service. For `APNS` and `APNS_SANDBOX`, `PlatformCredential` is
|
154
|
+
# `private key`. For `GCM` (Firebase Cloud Messaging),
|
155
|
+
# `PlatformCredential` is `API key`. For `ADM`, `PlatformCredential`
|
156
|
+
# is `client secret`.
|
154
157
|
#
|
155
158
|
# * `PlatformPrincipal` – The principal received from the notification
|
156
|
-
# service. For APNS
|
157
|
-
# certificate
|
158
|
-
# PlatformPrincipal is
|
159
|
+
# service. For `APNS` and `APNS_SANDBOX`, `PlatformPrincipal` is `SSL
|
160
|
+
# certificate`. For `GCM` (Firebase Cloud Messaging), there is no
|
161
|
+
# `PlatformPrincipal`. For `ADM`, `PlatformPrincipal` is `client id`.
|
159
162
|
#
|
160
|
-
# * `EventEndpointCreated` – Topic ARN to which EndpointCreated event
|
161
|
-
# notifications
|
163
|
+
# * `EventEndpointCreated` – Topic ARN to which `EndpointCreated` event
|
164
|
+
# notifications are sent.
|
162
165
|
#
|
163
|
-
# * `EventEndpointDeleted` – Topic ARN to which EndpointDeleted event
|
164
|
-
# notifications
|
166
|
+
# * `EventEndpointDeleted` – Topic ARN to which `EndpointDeleted` event
|
167
|
+
# notifications are sent.
|
165
168
|
#
|
166
|
-
# * `EventEndpointUpdated` – Topic ARN to which EndpointUpdate event
|
167
|
-
# notifications
|
169
|
+
# * `EventEndpointUpdated` – Topic ARN to which `EndpointUpdate` event
|
170
|
+
# notifications are sent.
|
168
171
|
#
|
169
|
-
# * `EventDeliveryFailure` – Topic ARN to which DeliveryFailure event
|
170
|
-
# notifications
|
172
|
+
# * `EventDeliveryFailure` – Topic ARN to which `DeliveryFailure` event
|
173
|
+
# notifications are sent upon Direct Publish delivery failure
|
171
174
|
# (permanent) to one of the application's endpoints.
|
172
175
|
#
|
173
176
|
# * `SuccessFeedbackRoleArn` – IAM role ARN used to give Amazon SNS
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -119,6 +121,8 @@ module Aws::SNS
|
|
119
121
|
# binary_value: "data",
|
120
122
|
# },
|
121
123
|
# },
|
124
|
+
# message_deduplication_id: "String",
|
125
|
+
# message_group_id: "String",
|
122
126
|
# })
|
123
127
|
# @param [Hash] options ({})
|
124
128
|
# @option options [String] :topic_arn
|
@@ -213,6 +217,31 @@ module Aws::SNS
|
|
213
217
|
# Valid value: `json`
|
214
218
|
# @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
|
215
219
|
# Message attributes for Publish action.
|
220
|
+
# @option options [String] :message_deduplication_id
|
221
|
+
# This parameter applies only to FIFO (first-in-first-out) topics. The
|
222
|
+
# `MessageDeduplicationId` can contain up to 128 alphanumeric characters
|
223
|
+
# (a-z, A-Z, 0-9) and punctuation ``
|
224
|
+
# (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
225
|
+
#
|
226
|
+
# Every message must have a unique `MessageDeduplicationId`, which is a
|
227
|
+
# token used for deduplication of sent messages. If a message with a
|
228
|
+
# particular `MessageDeduplicationId` is sent successfully, any message
|
229
|
+
# sent with the same `MessageDeduplicationId` during the 5-minute
|
230
|
+
# deduplication interval is treated as a duplicate.
|
231
|
+
#
|
232
|
+
# If the topic has `ContentBasedDeduplication` set, the system generates
|
233
|
+
# a `MessageDeduplicationId` based on the contents of the message. Your
|
234
|
+
# `MessageDeduplicationId` overrides the generated one.
|
235
|
+
# @option options [String] :message_group_id
|
236
|
+
# This parameter applies only to FIFO (first-in-first-out) topics. The
|
237
|
+
# `MessageGroupId` can contain up to 128 alphanumeric characters (a-z,
|
238
|
+
# A-Z, 0-9) and punctuation `` (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
239
|
+
#
|
240
|
+
# The `MessageGroupId` is a tag that specifies that a message belongs to
|
241
|
+
# a specific message group. Messages that belong to the same message
|
242
|
+
# group are processed in a FIFO manner (however, messages in different
|
243
|
+
# message groups might be processed out of order). Every message must
|
244
|
+
# include a `MessageGroupId`.
|
216
245
|
# @return [Types::PublishResponse]
|
217
246
|
def publish(options = {})
|
218
247
|
options = options.merge(target_arn: @arn)
|
data/lib/aws-sdk-sns/resource.rb
CHANGED
@@ -1,18 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
8
10
|
module Aws::SNS
|
11
|
+
|
9
12
|
# This class provides a resource oriented interface for SNS.
|
10
13
|
# To create a resource object:
|
14
|
+
#
|
11
15
|
# resource = Aws::SNS::Resource.new(region: 'us-west-2')
|
16
|
+
#
|
12
17
|
# You can supply a client object with custom configuration that will be used for all resource operations.
|
13
|
-
# If you do not pass
|
18
|
+
# If you do not pass `:client`, a default client will be constructed.
|
19
|
+
#
|
14
20
|
# client = Aws::SNS::Client.new(region: 'us-west-2')
|
15
21
|
# resource = Aws::SNS::Resource.new(client: client)
|
22
|
+
#
|
16
23
|
class Resource
|
17
24
|
|
18
25
|
# @param options ({})
|
@@ -44,7 +51,7 @@ module Aws::SNS
|
|
44
51
|
# between 1 and 256 characters long.
|
45
52
|
# @option options [required, String] :platform
|
46
53
|
# The following platforms are supported: ADM (Amazon Device Messaging),
|
47
|
-
# APNS (Apple Push Notification Service), APNS\_SANDBOX, and
|
54
|
+
# APNS (Apple Push Notification Service), APNS\_SANDBOX, and GCM
|
48
55
|
# (Firebase Cloud Messaging).
|
49
56
|
# @option options [required, Hash<String,String>] :attributes
|
50
57
|
# For a list of attributes, see [SetPlatformApplicationAttributes][1]
|
@@ -82,6 +89,9 @@ module Aws::SNS
|
|
82
89
|
# Constraints: Topic names must be made up of only uppercase and
|
83
90
|
# lowercase ASCII letters, numbers, underscores, and hyphens, and must
|
84
91
|
# be between 1 and 256 characters long.
|
92
|
+
#
|
93
|
+
# For a FIFO (first-in-first-out) topic, the name must end with the
|
94
|
+
# `.fifo` suffix.
|
85
95
|
# @option options [Hash<String,String>] :attributes
|
86
96
|
# A map of attributes with their corresponding values.
|
87
97
|
#
|
@@ -94,23 +104,47 @@ module Aws::SNS
|
|
94
104
|
# * `DisplayName` – The display name to use for a topic with SMS
|
95
105
|
# subscriptions.
|
96
106
|
#
|
107
|
+
# * `FifoTopic` – Set to true to create a FIFO topic.
|
108
|
+
#
|
97
109
|
# * `Policy` – The policy that defines who can access your topic. By
|
98
110
|
# default, only the topic owner can publish or subscribe to the topic.
|
99
111
|
#
|
100
112
|
# The following attribute applies only to [server-side-encryption][1]\:
|
101
113
|
#
|
102
|
-
# * `KmsMasterKeyId`
|
114
|
+
# * `KmsMasterKeyId` – The ID of an AWS-managed customer master key
|
103
115
|
# (CMK) for Amazon SNS or a custom CMK. For more information, see [Key
|
104
116
|
# Terms][2]. For more examples, see [KeyId][3] in the *AWS Key
|
105
117
|
# Management Service API Reference*.
|
106
118
|
#
|
107
119
|
# ^
|
108
120
|
#
|
121
|
+
# The following attributes apply only to [FIFO topics][4]\:
|
122
|
+
#
|
123
|
+
# * `FifoTopic` – When this is set to `true`, a FIFO topic is created.
|
124
|
+
#
|
125
|
+
# * `ContentBasedDeduplication` – Enables content-based deduplication
|
126
|
+
# for FIFO topics.
|
127
|
+
#
|
128
|
+
# * By default, `ContentBasedDeduplication` is set to `false`. If you
|
129
|
+
# create a FIFO topic and this attribute is `false`, you must
|
130
|
+
# specify a value for the `MessageDeduplicationId` parameter for the
|
131
|
+
# [Publish][5] action.
|
132
|
+
#
|
133
|
+
# * When you set `ContentBasedDeduplication` to `true`, Amazon SNS
|
134
|
+
# uses a SHA-256 hash to generate the `MessageDeduplicationId` using
|
135
|
+
# the body of the message (but not the attributes of the message).
|
136
|
+
#
|
137
|
+
# (Optional) To override the generated value, you can specify a
|
138
|
+
# value for the the `MessageDeduplicationId` parameter for the
|
139
|
+
# `Publish` action.
|
140
|
+
#
|
109
141
|
#
|
110
142
|
#
|
111
143
|
# [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
|
112
144
|
# [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
|
113
145
|
# [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
146
|
+
# [4]: https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html
|
147
|
+
# [5]: https://docs.aws.amazon.com/sns/latest/api/API_Publish.html
|
114
148
|
# @option options [Array<Types::Tag>] :tags
|
115
149
|
# The list of tags to add to a new topic.
|
116
150
|
#
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -46,7 +48,8 @@ module Aws::SNS
|
|
46
48
|
# and account system defaults.
|
47
49
|
#
|
48
50
|
# * `FilterPolicy` – The filter policy JSON that is assigned to the
|
49
|
-
# subscription.
|
51
|
+
# subscription. For more information, see [Amazon SNS Message
|
52
|
+
# Filtering][1] in the *Amazon SNS Developer Guide*.
|
50
53
|
#
|
51
54
|
# * `Owner` – The AWS account ID of the subscription's owner.
|
52
55
|
#
|
@@ -68,6 +71,26 @@ module Aws::SNS
|
|
68
71
|
# * `SubscriptionArn` – The subscription's ARN.
|
69
72
|
#
|
70
73
|
# * `TopicArn` – The topic ARN that the subscription is associated with.
|
74
|
+
#
|
75
|
+
# The following attribute applies only to Amazon Kinesis Data Firehose
|
76
|
+
# delivery stream subscriptions:
|
77
|
+
#
|
78
|
+
# * `SubscriptionRoleArn` – The ARN of the IAM role that has the
|
79
|
+
# following:
|
80
|
+
#
|
81
|
+
# * Permission to write to the Kinesis Data Firehose delivery stream
|
82
|
+
#
|
83
|
+
# * Amazon SNS listed as a trusted entity
|
84
|
+
#
|
85
|
+
# Specifying a valid ARN for this attribute is required for Kinesis
|
86
|
+
# Data Firehose delivery stream subscriptions. For more information,
|
87
|
+
# see [Fanout to Kinesis Data Firehose delivery streams][2] in the
|
88
|
+
# *Amazon SNS Developer Guide*.
|
89
|
+
#
|
90
|
+
#
|
91
|
+
#
|
92
|
+
# [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html
|
93
|
+
# [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-kinesis-subscriber.html
|
71
94
|
# @return [Hash<String,String>]
|
72
95
|
def attributes
|
73
96
|
data[:attributes]
|
@@ -132,7 +155,7 @@ module Aws::SNS
|
|
132
155
|
# A map of attributes with their corresponding values.
|
133
156
|
#
|
134
157
|
# The following lists the names, descriptions, and values of the special
|
135
|
-
# request parameters that
|
158
|
+
# request parameters that this action uses:
|
136
159
|
#
|
137
160
|
# * `DeliveryPolicy` – The policy that defines how Amazon SNS retries
|
138
161
|
# failed deliveries to HTTP/S endpoints.
|
@@ -152,6 +175,25 @@ module Aws::SNS
|
|
152
175
|
# endpoint is unreachable) or server errors (for example, when the
|
153
176
|
# service that powers the subscribed endpoint becomes unavailable) are
|
154
177
|
# held in the dead-letter queue for further analysis or reprocessing.
|
178
|
+
#
|
179
|
+
# The following attribute applies only to Amazon Kinesis Data Firehose
|
180
|
+
# delivery stream subscriptions:
|
181
|
+
#
|
182
|
+
# * `SubscriptionRoleArn` – The ARN of the IAM role that has the
|
183
|
+
# following:
|
184
|
+
#
|
185
|
+
# * Permission to write to the Kinesis Data Firehose delivery stream
|
186
|
+
#
|
187
|
+
# * Amazon SNS listed as a trusted entity
|
188
|
+
#
|
189
|
+
# Specifying a valid ARN for this attribute is required for Kinesis
|
190
|
+
# Data Firehose delivery stream subscriptions. For more information,
|
191
|
+
# see [Fanout to Kinesis Data Firehose delivery streams][1] in the
|
192
|
+
# *Amazon SNS Developer Guide*.
|
193
|
+
#
|
194
|
+
#
|
195
|
+
#
|
196
|
+
# [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-kinesis-subscriber.html
|
155
197
|
# @option options [String] :attribute_value
|
156
198
|
# The new value for the attribute in JSON format.
|
157
199
|
# @return [EmptyStructure]
|
data/lib/aws-sdk-sns/topic.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -57,7 +59,7 @@ module Aws::SNS
|
|
57
59
|
#
|
58
60
|
# * `TopicArn` – The topic's ARN.
|
59
61
|
#
|
60
|
-
# * `EffectiveDeliveryPolicy` –
|
62
|
+
# * `EffectiveDeliveryPolicy` – The JSON serialization of the effective
|
61
63
|
# delivery policy, taking system defaults into account.
|
62
64
|
#
|
63
65
|
# The following attribute applies only to [server-side-encryption][1]\:
|
@@ -69,11 +71,33 @@ module Aws::SNS
|
|
69
71
|
#
|
70
72
|
# ^
|
71
73
|
#
|
74
|
+
# The following attributes apply only to [FIFO topics][4]\:
|
75
|
+
#
|
76
|
+
# * `FifoTopic` – When this is set to `true`, a FIFO topic is created.
|
77
|
+
#
|
78
|
+
# * `ContentBasedDeduplication` – Enables content-based deduplication
|
79
|
+
# for FIFO topics.
|
80
|
+
#
|
81
|
+
# * By default, `ContentBasedDeduplication` is set to `false`. If you
|
82
|
+
# create a FIFO topic and this attribute is `false`, you must
|
83
|
+
# specify a value for the `MessageDeduplicationId` parameter for the
|
84
|
+
# [Publish][5] action.
|
85
|
+
#
|
86
|
+
# * When you set `ContentBasedDeduplication` to `true`, Amazon SNS
|
87
|
+
# uses a SHA-256 hash to generate the `MessageDeduplicationId` using
|
88
|
+
# the body of the message (but not the attributes of the message).
|
89
|
+
#
|
90
|
+
# (Optional) To override the generated value, you can specify a
|
91
|
+
# value for the the `MessageDeduplicationId` parameter for the
|
92
|
+
# `Publish` action.
|
93
|
+
#
|
72
94
|
#
|
73
95
|
#
|
74
96
|
# [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
|
75
97
|
# [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
|
76
98
|
# [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
99
|
+
# [4]: https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html
|
100
|
+
# [5]: https://docs.aws.amazon.com/sns/latest/api/API_Publish.html
|
77
101
|
# @return [Hash<String,String>]
|
78
102
|
def attributes
|
79
103
|
data[:attributes]
|
@@ -192,6 +216,8 @@ module Aws::SNS
|
|
192
216
|
# binary_value: "data",
|
193
217
|
# },
|
194
218
|
# },
|
219
|
+
# message_deduplication_id: "String",
|
220
|
+
# message_group_id: "String",
|
195
221
|
# })
|
196
222
|
# @param [Hash] options ({})
|
197
223
|
# @option options [String] :target_arn
|
@@ -284,6 +310,31 @@ module Aws::SNS
|
|
284
310
|
# Valid value: `json`
|
285
311
|
# @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
|
286
312
|
# Message attributes for Publish action.
|
313
|
+
# @option options [String] :message_deduplication_id
|
314
|
+
# This parameter applies only to FIFO (first-in-first-out) topics. The
|
315
|
+
# `MessageDeduplicationId` can contain up to 128 alphanumeric characters
|
316
|
+
# (a-z, A-Z, 0-9) and punctuation ``
|
317
|
+
# (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
318
|
+
#
|
319
|
+
# Every message must have a unique `MessageDeduplicationId`, which is a
|
320
|
+
# token used for deduplication of sent messages. If a message with a
|
321
|
+
# particular `MessageDeduplicationId` is sent successfully, any message
|
322
|
+
# sent with the same `MessageDeduplicationId` during the 5-minute
|
323
|
+
# deduplication interval is treated as a duplicate.
|
324
|
+
#
|
325
|
+
# If the topic has `ContentBasedDeduplication` set, the system generates
|
326
|
+
# a `MessageDeduplicationId` based on the contents of the message. Your
|
327
|
+
# `MessageDeduplicationId` overrides the generated one.
|
328
|
+
# @option options [String] :message_group_id
|
329
|
+
# This parameter applies only to FIFO (first-in-first-out) topics. The
|
330
|
+
# `MessageGroupId` can contain up to 128 alphanumeric characters (a-z,
|
331
|
+
# A-Z, 0-9) and punctuation `` (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
332
|
+
#
|
333
|
+
# The `MessageGroupId` is a tag that specifies that a message belongs to
|
334
|
+
# a specific message group. Messages that belong to the same message
|
335
|
+
# group are processed in a FIFO manner (however, messages in different
|
336
|
+
# message groups might be processed out of order). Every message must
|
337
|
+
# include a `MessageGroupId`.
|
287
338
|
# @return [Types::PublishResponse]
|
288
339
|
def publish(options = {})
|
289
340
|
options = options.merge(topic_arn: @arn)
|
@@ -330,18 +381,38 @@ module Aws::SNS
|
|
330
381
|
#
|
331
382
|
# The following attribute applies only to [server-side-encryption][1]\:
|
332
383
|
#
|
333
|
-
# * `KmsMasterKeyId`
|
384
|
+
# * `KmsMasterKeyId` – The ID of an AWS-managed customer master key
|
334
385
|
# (CMK) for Amazon SNS or a custom CMK. For more information, see [Key
|
335
386
|
# Terms][2]. For more examples, see [KeyId][3] in the *AWS Key
|
336
387
|
# Management Service API Reference*.
|
337
388
|
#
|
338
389
|
# ^
|
339
390
|
#
|
391
|
+
# The following attribute applies only to [FIFO topics][4]\:
|
392
|
+
#
|
393
|
+
# * `ContentBasedDeduplication` – Enables content-based deduplication
|
394
|
+
# for FIFO topics.
|
395
|
+
#
|
396
|
+
# * By default, `ContentBasedDeduplication` is set to `false`. If you
|
397
|
+
# create a FIFO topic and this attribute is `false`, you must
|
398
|
+
# specify a value for the `MessageDeduplicationId` parameter for the
|
399
|
+
# [Publish][5] action.
|
400
|
+
#
|
401
|
+
# * When you set `ContentBasedDeduplication` to `true`, Amazon SNS
|
402
|
+
# uses a SHA-256 hash to generate the `MessageDeduplicationId` using
|
403
|
+
# the body of the message (but not the attributes of the message).
|
404
|
+
#
|
405
|
+
# (Optional) To override the generated value, you can specify a
|
406
|
+
# value for the the `MessageDeduplicationId` parameter for the
|
407
|
+
# `Publish` action.
|
408
|
+
#
|
340
409
|
#
|
341
410
|
#
|
342
411
|
# [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
|
343
412
|
# [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
|
344
413
|
# [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
|
414
|
+
# [4]: https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html
|
415
|
+
# [5]: https://docs.aws.amazon.com/sns/latest/api/API_Publish.html
|
345
416
|
# @option options [String] :attribute_value
|
346
417
|
# The new value for the attribute.
|
347
418
|
# @return [EmptyStructure]
|
@@ -363,7 +434,7 @@ module Aws::SNS
|
|
363
434
|
# })
|
364
435
|
# @param [Hash] options ({})
|
365
436
|
# @option options [required, String] :protocol
|
366
|
-
# The protocol you want to use. Supported protocols include:
|
437
|
+
# The protocol that you want to use. Supported protocols include:
|
367
438
|
#
|
368
439
|
# * `http` – delivery of JSON-encoded message via HTTP POST
|
369
440
|
#
|
@@ -378,35 +449,41 @@ module Aws::SNS
|
|
378
449
|
# * `sqs` – delivery of JSON-encoded message to an Amazon SQS queue
|
379
450
|
#
|
380
451
|
# * `application` – delivery of JSON-encoded message to an EndpointArn
|
381
|
-
# for a mobile app and device
|
452
|
+
# for a mobile app and device
|
382
453
|
#
|
383
|
-
# * `lambda` – delivery of JSON-encoded message to an
|
384
|
-
# function
|
454
|
+
# * `lambda` – delivery of JSON-encoded message to an AWS Lambda
|
455
|
+
# function
|
456
|
+
#
|
457
|
+
# * `firehose` – delivery of JSON-encoded message to an Amazon Kinesis
|
458
|
+
# Data Firehose delivery stream.
|
385
459
|
# @option options [String] :endpoint
|
386
460
|
# The endpoint that you want to receive notifications. Endpoints vary by
|
387
461
|
# protocol:
|
388
462
|
#
|
389
|
-
# * For the `http` protocol, the endpoint is
|
390
|
-
# `http
|
463
|
+
# * For the `http` protocol, the (public) endpoint is a URL beginning
|
464
|
+
# with `http://`.
|
391
465
|
#
|
392
|
-
# * For the `https` protocol, the endpoint is a URL beginning
|
393
|
-
# `https
|
466
|
+
# * For the `https` protocol, the (public) endpoint is a URL beginning
|
467
|
+
# with `https://`.
|
394
468
|
#
|
395
|
-
# * For the `email` protocol, the endpoint is an email address
|
469
|
+
# * For the `email` protocol, the endpoint is an email address.
|
396
470
|
#
|
397
|
-
# * For the `email-json` protocol, the endpoint is an email address
|
471
|
+
# * For the `email-json` protocol, the endpoint is an email address.
|
398
472
|
#
|
399
473
|
# * For the `sms` protocol, the endpoint is a phone number of an
|
400
|
-
# SMS-enabled device
|
474
|
+
# SMS-enabled device.
|
401
475
|
#
|
402
476
|
# * For the `sqs` protocol, the endpoint is the ARN of an Amazon SQS
|
403
|
-
# queue
|
477
|
+
# queue.
|
404
478
|
#
|
405
479
|
# * For the `application` protocol, the endpoint is the EndpointArn of a
|
406
480
|
# mobile app and device.
|
407
481
|
#
|
408
|
-
# * For the `lambda` protocol, the endpoint is the ARN of an
|
409
|
-
#
|
482
|
+
# * For the `lambda` protocol, the endpoint is the ARN of an AWS Lambda
|
483
|
+
# function.
|
484
|
+
#
|
485
|
+
# * For the `firehose` protocol, the endpoint is the ARN of an Amazon
|
486
|
+
# Kinesis Data Firehose delivery stream.
|
410
487
|
# @option options [Hash<String,String>] :attributes
|
411
488
|
# A map of attributes with their corresponding values.
|
412
489
|
#
|
@@ -431,20 +508,37 @@ module Aws::SNS
|
|
431
508
|
# endpoint is unreachable) or server errors (for example, when the
|
432
509
|
# service that powers the subscribed endpoint becomes unavailable) are
|
433
510
|
# held in the dead-letter queue for further analysis or reprocessing.
|
511
|
+
#
|
512
|
+
# The following attribute applies only to Amazon Kinesis Data Firehose
|
513
|
+
# delivery stream subscriptions:
|
514
|
+
#
|
515
|
+
# * `SubscriptionRoleArn` – The ARN of the IAM role that has the
|
516
|
+
# following:
|
517
|
+
#
|
518
|
+
# * Permission to write to the Kinesis Data Firehose delivery stream
|
519
|
+
#
|
520
|
+
# * Amazon SNS listed as a trusted entity
|
521
|
+
#
|
522
|
+
# Specifying a valid ARN for this attribute is required for Kinesis
|
523
|
+
# Data Firehose delivery stream subscriptions. For more information,
|
524
|
+
# see [Fanout to Kinesis Data Firehose delivery streams][1] in the
|
525
|
+
# *Amazon SNS Developer Guide*.
|
526
|
+
#
|
527
|
+
#
|
528
|
+
#
|
529
|
+
# [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-kinesis-subscriber.html
|
434
530
|
# @option options [Boolean] :return_subscription_arn
|
435
531
|
# Sets whether the response from the `Subscribe` request includes the
|
436
532
|
# subscription ARN, even if the subscription is not yet confirmed.
|
437
533
|
#
|
438
|
-
#
|
439
|
-
#
|
534
|
+
# If you set this parameter to `true`, the response includes the ARN in
|
535
|
+
# all cases, even if the subscription is not yet confirmed. In addition
|
536
|
+
# to the ARN for confirmed subscriptions, the response also includes the
|
537
|
+
# `pending subscription` ARN value for subscriptions that aren't yet
|
538
|
+
# confirmed. A subscription becomes confirmed when the subscriber calls
|
539
|
+
# the `ConfirmSubscription` action with a confirmation token.
|
440
540
|
#
|
441
|
-
# * If you don't have the subscription ARN returned, in addition to the
|
442
|
-
# ARN for confirmed subscriptions, the response also includes the
|
443
|
-
# `pending subscription` ARN value for subscriptions that aren't yet
|
444
|
-
# confirmed. A subscription becomes confirmed when the subscriber
|
445
|
-
# calls the `ConfirmSubscription` action with a confirmation token.
|
446
541
|
#
|
447
|
-
# If you set this parameter to `true`, .
|
448
542
|
#
|
449
543
|
# The default value is `false`.
|
450
544
|
# @return [Subscription]
|