aws-sdk-sns 1.19.0 → 1.24.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.
@@ -6,6 +6,51 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::SNS
9
+
10
+ # When SNS returns an error response, the Ruby SDK constructs and raises an error.
11
+ # These errors all extend Aws::SNS::Errors::ServiceError < {Aws::Errors::ServiceError}
12
+ #
13
+ # You can rescue all SNS errors using ServiceError:
14
+ #
15
+ # begin
16
+ # # do stuff
17
+ # rescue Aws::SNS::Errors::ServiceError
18
+ # # rescues all SNS API errors
19
+ # end
20
+ #
21
+ #
22
+ # ## Request Context
23
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
24
+ # information about the request that generated the error.
25
+ # See {Seahorse::Client::RequestContext} for more information.
26
+ #
27
+ # ## Error Classes
28
+ # * {AuthorizationErrorException}
29
+ # * {ConcurrentAccessException}
30
+ # * {EndpointDisabledException}
31
+ # * {FilterPolicyLimitExceededException}
32
+ # * {InternalErrorException}
33
+ # * {InvalidParameterException}
34
+ # * {InvalidParameterValueException}
35
+ # * {InvalidSecurityException}
36
+ # * {KMSAccessDeniedException}
37
+ # * {KMSDisabledException}
38
+ # * {KMSInvalidStateException}
39
+ # * {KMSNotFoundException}
40
+ # * {KMSOptInRequired}
41
+ # * {KMSThrottlingException}
42
+ # * {NotFoundException}
43
+ # * {PlatformApplicationDisabledException}
44
+ # * {ResourceNotFoundException}
45
+ # * {StaleTagException}
46
+ # * {SubscriptionLimitExceededException}
47
+ # * {TagLimitExceededException}
48
+ # * {TagPolicyException}
49
+ # * {ThrottledException}
50
+ # * {TopicLimitExceededException}
51
+ #
52
+ # Additionally, error classes are dynamically generated for service errors based on the error code
53
+ # if they are not defined above.
9
54
  module Errors
10
55
 
11
56
  extend Aws::Errors::DynamicErrors
@@ -23,7 +68,6 @@ module Aws::SNS
23
68
  def message
24
69
  @message || @data[:message]
25
70
  end
26
-
27
71
  end
28
72
 
29
73
  class ConcurrentAccessException < ServiceError
@@ -39,7 +83,6 @@ module Aws::SNS
39
83
  def message
40
84
  @message || @data[:message]
41
85
  end
42
-
43
86
  end
44
87
 
45
88
  class EndpointDisabledException < ServiceError
@@ -55,7 +98,6 @@ module Aws::SNS
55
98
  def message
56
99
  @message || @data[:message]
57
100
  end
58
-
59
101
  end
60
102
 
61
103
  class FilterPolicyLimitExceededException < ServiceError
@@ -71,7 +113,6 @@ module Aws::SNS
71
113
  def message
72
114
  @message || @data[:message]
73
115
  end
74
-
75
116
  end
76
117
 
77
118
  class InternalErrorException < ServiceError
@@ -87,7 +128,6 @@ module Aws::SNS
87
128
  def message
88
129
  @message || @data[:message]
89
130
  end
90
-
91
131
  end
92
132
 
93
133
  class InvalidParameterException < ServiceError
@@ -103,7 +143,6 @@ module Aws::SNS
103
143
  def message
104
144
  @message || @data[:message]
105
145
  end
106
-
107
146
  end
108
147
 
109
148
  class InvalidParameterValueException < ServiceError
@@ -119,7 +158,6 @@ module Aws::SNS
119
158
  def message
120
159
  @message || @data[:message]
121
160
  end
122
-
123
161
  end
124
162
 
125
163
  class InvalidSecurityException < ServiceError
@@ -135,7 +173,6 @@ module Aws::SNS
135
173
  def message
136
174
  @message || @data[:message]
137
175
  end
138
-
139
176
  end
140
177
 
141
178
  class KMSAccessDeniedException < ServiceError
@@ -151,7 +188,6 @@ module Aws::SNS
151
188
  def message
152
189
  @message || @data[:message]
153
190
  end
154
-
155
191
  end
156
192
 
157
193
  class KMSDisabledException < ServiceError
@@ -167,7 +203,6 @@ module Aws::SNS
167
203
  def message
168
204
  @message || @data[:message]
169
205
  end
170
-
171
206
  end
172
207
 
173
208
  class KMSInvalidStateException < ServiceError
@@ -183,7 +218,6 @@ module Aws::SNS
183
218
  def message
184
219
  @message || @data[:message]
185
220
  end
186
-
187
221
  end
188
222
 
189
223
  class KMSNotFoundException < ServiceError
@@ -199,7 +233,6 @@ module Aws::SNS
199
233
  def message
200
234
  @message || @data[:message]
201
235
  end
202
-
203
236
  end
204
237
 
205
238
  class KMSOptInRequired < ServiceError
@@ -215,7 +248,6 @@ module Aws::SNS
215
248
  def message
216
249
  @message || @data[:message]
217
250
  end
218
-
219
251
  end
220
252
 
221
253
  class KMSThrottlingException < ServiceError
@@ -231,7 +263,6 @@ module Aws::SNS
231
263
  def message
232
264
  @message || @data[:message]
233
265
  end
234
-
235
266
  end
236
267
 
237
268
  class NotFoundException < ServiceError
@@ -247,7 +278,6 @@ module Aws::SNS
247
278
  def message
248
279
  @message || @data[:message]
249
280
  end
250
-
251
281
  end
252
282
 
253
283
  class PlatformApplicationDisabledException < ServiceError
@@ -263,7 +293,6 @@ module Aws::SNS
263
293
  def message
264
294
  @message || @data[:message]
265
295
  end
266
-
267
296
  end
268
297
 
269
298
  class ResourceNotFoundException < ServiceError
@@ -279,7 +308,6 @@ module Aws::SNS
279
308
  def message
280
309
  @message || @data[:message]
281
310
  end
282
-
283
311
  end
284
312
 
285
313
  class StaleTagException < ServiceError
@@ -295,7 +323,6 @@ module Aws::SNS
295
323
  def message
296
324
  @message || @data[:message]
297
325
  end
298
-
299
326
  end
300
327
 
301
328
  class SubscriptionLimitExceededException < ServiceError
@@ -311,7 +338,6 @@ module Aws::SNS
311
338
  def message
312
339
  @message || @data[:message]
313
340
  end
314
-
315
341
  end
316
342
 
317
343
  class TagLimitExceededException < ServiceError
@@ -327,7 +353,6 @@ module Aws::SNS
327
353
  def message
328
354
  @message || @data[:message]
329
355
  end
330
-
331
356
  end
332
357
 
333
358
  class TagPolicyException < ServiceError
@@ -343,7 +368,6 @@ module Aws::SNS
343
368
  def message
344
369
  @message || @data[:message]
345
370
  end
346
-
347
371
  end
348
372
 
349
373
  class ThrottledException < ServiceError
@@ -359,7 +383,6 @@ module Aws::SNS
359
383
  def message
360
384
  @message || @data[:message]
361
385
  end
362
-
363
386
  end
364
387
 
365
388
  class TopicLimitExceededException < ServiceError
@@ -375,7 +398,6 @@ module Aws::SNS
375
398
  def message
376
399
  @message || @data[:message]
377
400
  end
378
-
379
401
  end
380
402
 
381
403
  end
@@ -6,6 +6,7 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::SNS
9
+
9
10
  class PlatformApplication
10
11
 
11
12
  extend Aws::Deprecations
@@ -21,6 +22,7 @@ module Aws::SNS
21
22
  @arn = extract_arn(args, options)
22
23
  @data = options.delete(:data)
23
24
  @client = options.delete(:client) || Client.new(options)
25
+ @waiter_block_warned = false
24
26
  end
25
27
 
26
28
  # @!group Read-Only Attributes
@@ -101,7 +103,7 @@ module Aws::SNS
101
103
  # device. The specific name for Token will vary, depending on which
102
104
  # notification service is being used. For example, when using APNS as
103
105
  # the notification service, you need the device token. Alternatively,
104
- # when using GCM or ADM, the device token equivalent is called the
106
+ # when using FCM or ADM, the device token equivalent is called the
105
107
  # registration ID.
106
108
  # @option options [String] :custom_user_data
107
109
  # Arbitrary user data to associate with the endpoint. Amazon SNS does
@@ -147,12 +149,12 @@ module Aws::SNS
147
149
  #
148
150
  # * `PlatformCredential` – The credential received from the notification
149
151
  # service. For APNS/APNS\_SANDBOX, PlatformCredential is private key.
150
- # For GCM, PlatformCredential is "API key". For ADM,
152
+ # For FCM, PlatformCredential is "API key". For ADM,
151
153
  # PlatformCredential is "client secret".
152
154
  #
153
155
  # * `PlatformPrincipal` – The principal received from the notification
154
156
  # service. For APNS/APNS\_SANDBOX, PlatformPrincipal is SSL
155
- # certificate. For GCM, PlatformPrincipal is not applicable. For ADM,
157
+ # certificate. For FCM, PlatformPrincipal is not applicable. For ADM,
156
158
  # PlatformPrincipal is "client id".
157
159
  #
158
160
  # * `EventEndpointCreated` – Topic ARN to which EndpointCreated event
@@ -6,6 +6,7 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::SNS
9
+
9
10
  class PlatformEndpoint
10
11
 
11
12
  extend Aws::Deprecations
@@ -21,6 +22,7 @@ module Aws::SNS
21
22
  @arn = extract_arn(args, options)
22
23
  @data = options.delete(:data)
23
24
  @client = options.delete(:client) || Client.new(options)
25
+ @waiter_block_warned = false
24
26
  end
25
27
 
26
28
  # @!group Read-Only Attributes
@@ -45,6 +47,10 @@ module Aws::SNS
45
47
  # an app and mobile device. This is returned from the notification
46
48
  # service when an app and mobile device are registered with the
47
49
  # notification service.
50
+ #
51
+ # <note markdown="1"> The device token for the iOS platform is returned in lowercase.
52
+ #
53
+ # </note>
48
54
  # @return [Hash<String,String>]
49
55
  def attributes
50
56
  data[:attributes]
@@ -129,10 +135,6 @@ module Aws::SNS
129
135
  # @option options [required, String] :message
130
136
  # The message you want to send.
131
137
  #
132
- # The `Message` parameter is always a string. If you set
133
- # `MessageStructure` to `json`, you must string-encode the `Message`
134
- # parameter.
135
- #
136
138
  # If you are publishing to a topic and you want to send the same message
137
139
  # to all transport protocols, include the text of the message as a
138
140
  # String value. If you want to send different messages for each
@@ -208,16 +210,7 @@ module Aws::SNS
208
210
  # You can define other top-level keys that define the message you want
209
211
  # to send to a specific transport protocol (e.g., "http").
210
212
  #
211
- # For information about sending different messages for each protocol
212
- # using the AWS Management Console, go to [Create Different Messages for
213
- # Each Protocol][1] in the *Amazon Simple Notification Service Getting
214
- # Started Guide*.
215
- #
216
213
  # Valid value: `json`
217
- #
218
- #
219
- #
220
- # [1]: https://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol
221
214
  # @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
222
215
  # Message attributes for Publish action.
223
216
  # @return [Types::PublishResponse]
@@ -6,6 +6,18 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::SNS
9
+
10
+ # This class provides a resource oriented interface for SNS.
11
+ # To create a resource object:
12
+ #
13
+ # resource = Aws::SNS::Resource.new(region: 'us-west-2')
14
+ #
15
+ # You can supply a client object with custom configuration that will be used for all resource operations.
16
+ # If you do not pass `:client`, a default client will be constructed.
17
+ #
18
+ # client = Aws::SNS::Client.new(region: 'us-west-2')
19
+ # resource = Aws::SNS::Resource.new(client: client)
20
+ #
9
21
  class Resource
10
22
 
11
23
  # @param options ({})
@@ -37,8 +49,8 @@ module Aws::SNS
37
49
  # between 1 and 256 characters long.
38
50
  # @option options [required, String] :platform
39
51
  # The following platforms are supported: ADM (Amazon Device Messaging),
40
- # APNS (Apple Push Notification Service), APNS\_SANDBOX, and GCM (Google
41
- # Cloud Messaging).
52
+ # APNS (Apple Push Notification Service), APNS\_SANDBOX, and FCM
53
+ # (Firebase Cloud Messaging).
42
54
  # @option options [required, Hash<String,String>] :attributes
43
55
  # For a list of attributes, see [SetPlatformApplicationAttributes][1]
44
56
  #
@@ -106,6 +118,11 @@ module Aws::SNS
106
118
  # [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
107
119
  # @option options [Array<Types::Tag>] :tags
108
120
  # The list of tags to add to a new topic.
121
+ #
122
+ # <note markdown="1"> To be able to tag a topic on creation, you must have the
123
+ # `sns:CreateTopic` and `sns:TagResource` permissions.
124
+ #
125
+ # </note>
109
126
  # @return [Topic]
110
127
  def create_topic(options = {})
111
128
  resp = @client.create_topic(options)
@@ -6,6 +6,7 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::SNS
9
+
9
10
  class Subscription
10
11
 
11
12
  extend Aws::Deprecations
@@ -21,6 +22,7 @@ module Aws::SNS
21
22
  @arn = extract_arn(args, options)
22
23
  @data = options.delete(:data)
23
24
  @client = options.delete(:client) || Client.new(options)
25
+ @waiter_block_warned = false
24
26
  end
25
27
 
26
28
  # @!group Read-Only Attributes
@@ -56,6 +58,13 @@ module Aws::SNS
56
58
  # the subscription. Raw messages are free of JSON formatting and can
57
59
  # be sent to HTTP/S and Amazon SQS endpoints.
58
60
  #
61
+ # * `RedrivePolicy` – When specified, sends undeliverable messages to
62
+ # the specified Amazon SQS dead-letter queue. Messages that can't be
63
+ # delivered due to client errors (for example, when the subscribed
64
+ # endpoint is unreachable) or server errors (for example, when the
65
+ # service that powers the subscribed endpoint becomes unavailable) are
66
+ # held in the dead-letter queue for further analysis or reprocessing.
67
+ #
59
68
  # * `SubscriptionArn` – The subscription's ARN.
60
69
  #
61
70
  # * `TopicArn` – The topic ARN that the subscription is associated with.
@@ -136,6 +145,13 @@ module Aws::SNS
136
145
  # delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need
137
146
  # for the endpoints to process JSON formatting, which is otherwise
138
147
  # created for Amazon SNS metadata.
148
+ #
149
+ # * `RedrivePolicy` – When specified, sends undeliverable messages to
150
+ # the specified Amazon SQS dead-letter queue. Messages that can't be
151
+ # delivered due to client errors (for example, when the subscribed
152
+ # endpoint is unreachable) or server errors (for example, when the
153
+ # service that powers the subscribed endpoint becomes unavailable) are
154
+ # held in the dead-letter queue for further analysis or reprocessing.
139
155
  # @option options [String] :attribute_value
140
156
  # The new value for the attribute in JSON format.
141
157
  # @return [EmptyStructure]
@@ -6,6 +6,7 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::SNS
9
+
9
10
  class Topic
10
11
 
11
12
  extend Aws::Deprecations
@@ -21,6 +22,7 @@ module Aws::SNS
21
22
  @arn = extract_arn(args, options)
22
23
  @data = options.delete(:data)
23
24
  @client = options.delete(:client) || Client.new(options)
25
+ @waiter_block_warned = false
24
26
  end
25
27
 
26
28
  # @!group Read-Only Attributes
@@ -33,30 +35,45 @@ module Aws::SNS
33
35
  # A map of the topic's attributes. Attributes in this map include the
34
36
  # following:
35
37
  #
36
- # * `TopicArn` – the topic's ARN
38
+ # * `DeliveryPolicy` – The JSON serialization of the topic's delivery
39
+ # policy.
40
+ #
41
+ # * `DisplayName` – The human-readable name used in the `From` field for
42
+ # notifications to `email` and `email-json` endpoints.
43
+ #
44
+ # * `Owner` – The AWS account ID of the topic's owner.
45
+ #
46
+ # * `Policy` – The JSON serialization of the topic's access control
47
+ # policy.
37
48
  #
38
- # * `Owner` – the AWS account ID of the topic's owner
49
+ # * `SubscriptionsConfirmed` – The number of confirmed subscriptions for
50
+ # the topic.
39
51
  #
40
- # * `Policy` – the JSON serialization of the topic's access control
41
- # policy
52
+ # * `SubscriptionsDeleted` – The number of deleted subscriptions for the
53
+ # topic.
42
54
  #
43
- # * `DisplayName` – the human-readable name used in the "From" field
44
- # for notifications to email and email-json endpoints
55
+ # * `SubscriptionsPending` – The number of subscriptions pending
56
+ # confirmation for the topic.
45
57
  #
46
- # * `SubscriptionsPending` – the number of subscriptions pending
47
- # confirmation on this topic
58
+ # * `TopicArn` – The topic's ARN.
48
59
  #
49
- # * `SubscriptionsConfirmed` – the number of confirmed subscriptions on
50
- # this topic
60
+ # * `EffectiveDeliveryPolicy` – Yhe JSON serialization of the effective
61
+ # delivery policy, taking system defaults into account.
51
62
  #
52
- # * `SubscriptionsDeleted` the number of deleted subscriptions on this
53
- # topic
63
+ # The following attribute applies only to [server-side-encryption][1]\:
54
64
  #
55
- # * `DeliveryPolicy` the JSON serialization of the topic's delivery
56
- # policy
65
+ # * `KmsMasterKeyId` - The ID of an AWS-managed customer master key
66
+ # (CMK) for Amazon SNS or a custom CMK. For more information, see [Key
67
+ # Terms][2]. For more examples, see [KeyId][3] in the *AWS Key
68
+ # Management Service API Reference*.
57
69
  #
58
- # * `EffectiveDeliveryPolicy` – the JSON serialization of the effective
59
- # delivery policy that takes into account system defaults
70
+ # ^
71
+ #
72
+ #
73
+ #
74
+ # [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
75
+ # [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
76
+ # [3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
60
77
  # @return [Hash<String,String>]
61
78
  def attributes
62
79
  data[:attributes]
@@ -116,7 +133,7 @@ module Aws::SNS
116
133
  # @option options [required, Array<String>] :action_name
117
134
  # The action you want to allow for the specified principal(s).
118
135
  #
119
- # Valid values: any Amazon SNS action name.
136
+ # Valid values: Any Amazon SNS action name, for example `Publish`.
120
137
  # @return [EmptyStructure]
121
138
  def add_permission(options = {})
122
139
  options = options.merge(topic_arn: @arn)
@@ -189,10 +206,6 @@ module Aws::SNS
189
206
  # @option options [required, String] :message
190
207
  # The message you want to send.
191
208
  #
192
- # The `Message` parameter is always a string. If you set
193
- # `MessageStructure` to `json`, you must string-encode the `Message`
194
- # parameter.
195
- #
196
209
  # If you are publishing to a topic and you want to send the same message
197
210
  # to all transport protocols, include the text of the message as a
198
211
  # String value. If you want to send different messages for each
@@ -268,16 +281,7 @@ module Aws::SNS
268
281
  # You can define other top-level keys that define the message you want
269
282
  # to send to a specific transport protocol (e.g., "http").
270
283
  #
271
- # For information about sending different messages for each protocol
272
- # using the AWS Management Console, go to [Create Different Messages for
273
- # Each Protocol][1] in the *Amazon Simple Notification Service Getting
274
- # Started Guide*.
275
- #
276
284
  # Valid value: `json`
277
- #
278
- #
279
- #
280
- # [1]: https://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol
281
285
  # @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
282
286
  # Message attributes for Publish action.
283
287
  # @return [Types::PublishResponse]
@@ -376,17 +380,17 @@ module Aws::SNS
376
380
  # * `application` – delivery of JSON-encoded message to an EndpointArn
377
381
  # for a mobile app and device.
378
382
  #
379
- # * `lambda` – delivery of JSON-encoded message to an AWS Lambda
383
+ # * `lambda` – delivery of JSON-encoded message to an Amazon Lambda
380
384
  # function.
381
385
  # @option options [String] :endpoint
382
386
  # The endpoint that you want to receive notifications. Endpoints vary by
383
387
  # protocol:
384
388
  #
385
389
  # * For the `http` protocol, the endpoint is an URL beginning with
386
- # "https://"
390
+ # `http://`
387
391
  #
388
392
  # * For the `https` protocol, the endpoint is a URL beginning with
389
- # "https://"
393
+ # `https://`
390
394
  #
391
395
  # * For the `email` protocol, the endpoint is an email address
392
396
  #
@@ -401,8 +405,8 @@ module Aws::SNS
401
405
  # * For the `application` protocol, the endpoint is the EndpointArn of a
402
406
  # mobile app and device.
403
407
  #
404
- # * For the `lambda` protocol, the endpoint is the ARN of an AWS Lambda
405
- # function.
408
+ # * For the `lambda` protocol, the endpoint is the ARN of an Amazon
409
+ # Lambda function.
406
410
  # @option options [Hash<String,String>] :attributes
407
411
  # A map of attributes with their corresponding values.
408
412
  #
@@ -420,18 +424,27 @@ module Aws::SNS
420
424
  # delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need
421
425
  # for the endpoints to process JSON formatting, which is otherwise
422
426
  # created for Amazon SNS metadata.
427
+ #
428
+ # * `RedrivePolicy` – When specified, sends undeliverable messages to
429
+ # the specified Amazon SQS dead-letter queue. Messages that can't be
430
+ # delivered due to client errors (for example, when the subscribed
431
+ # endpoint is unreachable) or server errors (for example, when the
432
+ # service that powers the subscribed endpoint becomes unavailable) are
433
+ # held in the dead-letter queue for further analysis or reprocessing.
423
434
  # @option options [Boolean] :return_subscription_arn
424
435
  # Sets whether the response from the `Subscribe` request includes the
425
436
  # subscription ARN, even if the subscription is not yet confirmed.
426
437
  #
427
- # If you set this parameter to `false`, the response includes the ARN
428
- # for confirmed subscriptions, but it includes an ARN value of "pending
429
- # subscription" for subscriptions that are not yet confirmed. A
430
- # subscription becomes confirmed when the subscriber calls the
431
- # `ConfirmSubscription` action with a confirmation token.
438
+ # * If you have the subscription ARN returned, the response includes the
439
+ # ARN in all cases, even if the subscription is not yet confirmed.
440
+ #
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.
432
446
  #
433
- # If you set this parameter to `true`, the response includes the ARN in
434
- # all cases, even if the subscription is not yet confirmed.
447
+ # If you set this parameter to `true`, .
435
448
  #
436
449
  # The default value is `false`.
437
450
  # @return [Subscription]