aws-sdk-sns 1.42.0 → 1.77.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,11 +43,31 @@ module Aws::SNS
43
43
  # * `DisplayName` – The human-readable name used in the `From` field for
44
44
  # notifications to `email` and `email-json` endpoints.
45
45
  #
46
- # * `Owner` – The account ID of the topic's owner.
46
+ # * `EffectiveDeliveryPolicy` – The JSON serialization of the effective
47
+ # delivery policy, taking system defaults into account.
48
+ #
49
+ # * `Owner` – The Amazon Web Services account ID of the topic's owner.
47
50
  #
48
51
  # * `Policy` – The JSON serialization of the topic's access control
49
52
  # policy.
50
53
  #
54
+ # * `SignatureVersion` – The signature version corresponds to the
55
+ # hashing algorithm used while creating the signature of the
56
+ # notifications, subscription confirmations, or unsubscribe
57
+ # confirmation messages sent by Amazon SNS.
58
+ #
59
+ # * By default, `SignatureVersion` is set to **1**. The signature is a
60
+ # Base64-encoded **SHA1withRSA** signature.
61
+ #
62
+ # * When you set `SignatureVersion` to **2**. Amazon SNS uses a
63
+ # Base64-encoded **SHA256withRSA** signature.
64
+ #
65
+ # <note markdown="1"> If the API response does not include the `SignatureVersion`
66
+ # attribute, it means that the `SignatureVersion` for the topic has
67
+ # value **1**.
68
+ #
69
+ # </note>
70
+ #
51
71
  # * `SubscriptionsConfirmed` – The number of confirmed subscriptions for
52
72
  # the topic.
53
73
  #
@@ -59,10 +79,14 @@ module Aws::SNS
59
79
  #
60
80
  # * `TopicArn` – The topic's ARN.
61
81
  #
62
- # * `EffectiveDeliveryPolicy` – The JSON serialization of the effective
63
- # delivery policy, taking system defaults into account.
82
+ # * `TracingConfig` – Tracing mode of an Amazon SNS topic. By default
83
+ # `TracingConfig` is set to `PassThrough`, and the topic passes
84
+ # through the tracing header it receives from an Amazon SNS publisher
85
+ # to its subscriptions. If set to `Active`, Amazon SNS will vend X-Ray
86
+ # segment data to topic owner account if the sampled flag in the
87
+ # tracing header is true. This is only supported on standard topics.
64
88
  #
65
- # The following attribute applies only to [server-side-encryption][1]\:
89
+ # The following attribute applies only to [server-side-encryption][1]:
66
90
  #
67
91
  # * `KmsMasterKeyId` - The ID of an Amazon Web Services managed customer
68
92
  # master key (CMK) for Amazon SNS or a custom CMK. For more
@@ -71,7 +95,7 @@ module Aws::SNS
71
95
  #
72
96
  # ^
73
97
  #
74
- # The following attributes apply only to [FIFO topics][4]\:
98
+ # The following attributes apply only to [FIFO topics][4]:
75
99
  #
76
100
  # * `FifoTopic` – When this is set to `true`, a FIFO topic is created.
77
101
  #
@@ -117,7 +141,9 @@ module Aws::SNS
117
141
  #
118
142
  # @return [self]
119
143
  def load
120
- resp = @client.get_topic_attributes(topic_arn: @arn)
144
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
145
+ @client.get_topic_attributes(topic_arn: @arn)
146
+ end
121
147
  @data = resp.data
122
148
  self
123
149
  end
@@ -151,9 +177,10 @@ module Aws::SNS
151
177
  # @option options [required, String] :label
152
178
  # A unique identifier for the new policy statement.
153
179
  # @option options [required, Array<String>] :aws_account_id
154
- # The account IDs of the users (principals) who will be given access to
155
- # the specified actions. The users must have account, but do not need to
156
- # be signed up for this service.
180
+ # The Amazon Web Services account IDs of the users (principals) who will
181
+ # be given access to the specified actions. The users must have Amazon
182
+ # Web Services account, but do not need to be signed up for this
183
+ # service.
157
184
  # @option options [required, Array<String>] :action_name
158
185
  # The action you want to allow for the specified principal(s).
159
186
  #
@@ -161,7 +188,9 @@ module Aws::SNS
161
188
  # @return [EmptyStructure]
162
189
  def add_permission(options = {})
163
190
  options = options.merge(topic_arn: @arn)
164
- resp = @client.add_permission(options)
191
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
192
+ @client.add_permission(options)
193
+ end
165
194
  resp.data
166
195
  end
167
196
 
@@ -183,7 +212,9 @@ module Aws::SNS
183
212
  # @return [Subscription]
184
213
  def confirm_subscription(options = {})
185
214
  options = options.merge(topic_arn: @arn)
186
- resp = @client.confirm_subscription(options)
215
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
216
+ @client.confirm_subscription(options)
217
+ end
187
218
  Subscription.new(
188
219
  arn: resp.data.subscription_arn,
189
220
  client: @client
@@ -197,7 +228,9 @@ module Aws::SNS
197
228
  # @return [EmptyStructure]
198
229
  def delete(options = {})
199
230
  options = options.merge(topic_arn: @arn)
200
- resp = @client.delete_topic(options)
231
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
232
+ @client.delete_topic(options)
233
+ end
201
234
  resp.data
202
235
  end
203
236
 
@@ -205,7 +238,7 @@ module Aws::SNS
205
238
  #
206
239
  # topic.publish({
207
240
  # target_arn: "String",
208
- # phone_number: "String",
241
+ # phone_number: "PhoneNumber",
209
242
  # message: "message", # required
210
243
  # subject: "subject",
211
244
  # message_structure: "messageStructure",
@@ -289,9 +322,8 @@ module Aws::SNS
289
322
  # is delivered to email endpoints. This field will also be included, if
290
323
  # present, in the standard JSON messages delivered to other endpoints.
291
324
  #
292
- # Constraints: Subjects must be ASCII text that begins with a letter,
293
- # number, or punctuation mark; must not include line breaks or control
294
- # characters; and must be less than 100 characters long.
325
+ # Constraints: Subjects must be UTF-8 text with no line breaks or
326
+ # control characters, and less than 100 characters long.
295
327
  # @option options [String] :message_structure
296
328
  # Set `MessageStructure` to `json` if you want to send a different
297
329
  # message for each protocol. For example, using one publish action, you
@@ -313,7 +345,7 @@ module Aws::SNS
313
345
  # @option options [String] :message_deduplication_id
314
346
  # This parameter applies only to FIFO (first-in-first-out) topics. The
315
347
  # `MessageDeduplicationId` can contain up to 128 alphanumeric characters
316
- # (a-z, A-Z, 0-9) and punctuation ``
348
+ # `(a-z, A-Z, 0-9)` and punctuation ``
317
349
  # (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
318
350
  #
319
351
  # Every message must have a unique `MessageDeduplicationId`, which is a
@@ -327,8 +359,8 @@ module Aws::SNS
327
359
  # `MessageDeduplicationId` overrides the generated one.
328
360
  # @option options [String] :message_group_id
329
361
  # 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 `` (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
362
+ # `MessageGroupId` can contain up to 128 alphanumeric characters `(a-z,
363
+ # A-Z, 0-9)` and punctuation `` (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
332
364
  #
333
365
  # The `MessageGroupId` is a tag that specifies that a message belongs to
334
366
  # a specific message group. Messages that belong to the same message
@@ -338,7 +370,9 @@ module Aws::SNS
338
370
  # @return [Types::PublishResponse]
339
371
  def publish(options = {})
340
372
  options = options.merge(topic_arn: @arn)
341
- resp = @client.publish(options)
373
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
374
+ @client.publish(options)
375
+ end
342
376
  resp.data
343
377
  end
344
378
 
@@ -353,7 +387,9 @@ module Aws::SNS
353
387
  # @return [EmptyStructure]
354
388
  def remove_permission(options = {})
355
389
  options = options.merge(topic_arn: @arn)
356
- resp = @client.remove_permission(options)
390
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
391
+ @client.remove_permission(options)
392
+ end
357
393
  resp.data
358
394
  end
359
395
 
@@ -370,6 +406,10 @@ module Aws::SNS
370
406
  # The following lists the names, descriptions, and values of the special
371
407
  # request parameters that the `SetTopicAttributes` action uses:
372
408
  #
409
+ # * `ApplicationSuccessFeedbackRoleArn` – Indicates failed message
410
+ # delivery status for an Amazon SNS topic that is subscribed to a
411
+ # platform application endpoint.
412
+ #
373
413
  # * `DeliveryPolicy` – The policy that defines how Amazon SNS retries
374
414
  # failed deliveries to HTTP/S endpoints.
375
415
  #
@@ -379,16 +419,119 @@ module Aws::SNS
379
419
  # * `Policy` – The policy that defines who can access your topic. By
380
420
  # default, only the topic owner can publish or subscribe to the topic.
381
421
  #
382
- # The following attribute applies only to [server-side-encryption][1]\:
422
+ # * `TracingConfig` Tracing mode of an Amazon SNS topic. By default
423
+ # `TracingConfig` is set to `PassThrough`, and the topic passes
424
+ # through the tracing header it receives from an Amazon SNS publisher
425
+ # to its subscriptions. If set to `Active`, Amazon SNS will vend X-Ray
426
+ # segment data to topic owner account if the sampled flag in the
427
+ # tracing header is true. This is only supported on standard topics.
428
+ #
429
+ # * HTTP
430
+ #
431
+ # * `HTTPSuccessFeedbackRoleArn` – Indicates successful message
432
+ # delivery status for an Amazon SNS topic that is subscribed to an
433
+ # HTTP endpoint.
434
+ #
435
+ # * `HTTPSuccessFeedbackSampleRate` – Indicates percentage of
436
+ # successful messages to sample for an Amazon SNS topic that is
437
+ # subscribed to an HTTP endpoint.
438
+ #
439
+ # * `HTTPFailureFeedbackRoleArn` – Indicates failed message delivery
440
+ # status for an Amazon SNS topic that is subscribed to an HTTP
441
+ # endpoint.
442
+ #
443
+ # * Amazon Kinesis Data Firehose
444
+ #
445
+ # * `FirehoseSuccessFeedbackRoleArn` – Indicates successful message
446
+ # delivery status for an Amazon SNS topic that is subscribed to an
447
+ # Amazon Kinesis Data Firehose endpoint.
448
+ #
449
+ # * `FirehoseSuccessFeedbackSampleRate` – Indicates percentage of
450
+ # successful messages to sample for an Amazon SNS topic that is
451
+ # subscribed to an Amazon Kinesis Data Firehose endpoint.
452
+ #
453
+ # * `FirehoseFailureFeedbackRoleArn` – Indicates failed message
454
+ # delivery status for an Amazon SNS topic that is subscribed to an
455
+ # Amazon Kinesis Data Firehose endpoint.
456
+ #
457
+ # * Lambda
458
+ #
459
+ # * `LambdaSuccessFeedbackRoleArn` – Indicates successful message
460
+ # delivery status for an Amazon SNS topic that is subscribed to an
461
+ # Lambda endpoint.
462
+ #
463
+ # * `LambdaSuccessFeedbackSampleRate` – Indicates percentage of
464
+ # successful messages to sample for an Amazon SNS topic that is
465
+ # subscribed to an Lambda endpoint.
466
+ #
467
+ # * `LambdaFailureFeedbackRoleArn` – Indicates failed message delivery
468
+ # status for an Amazon SNS topic that is subscribed to an Lambda
469
+ # endpoint.
470
+ #
471
+ # * Platform application endpoint
472
+ #
473
+ # * `ApplicationSuccessFeedbackRoleArn` – Indicates successful message
474
+ # delivery status for an Amazon SNS topic that is subscribed to an
475
+ # Amazon Web Services application endpoint.
476
+ #
477
+ # * `ApplicationSuccessFeedbackSampleRate` – Indicates percentage of
478
+ # successful messages to sample for an Amazon SNS topic that is
479
+ # subscribed to an Amazon Web Services application endpoint.
480
+ #
481
+ # * `ApplicationFailureFeedbackRoleArn` – Indicates failed message
482
+ # delivery status for an Amazon SNS topic that is subscribed to an
483
+ # Amazon Web Services application endpoint.
484
+ #
485
+ # <note markdown="1"> In addition to being able to configure topic attributes for message
486
+ # delivery status of notification messages sent to Amazon SNS
487
+ # application endpoints, you can also configure application attributes
488
+ # for the delivery status of push notification messages sent to push
489
+ # notification services.
490
+ #
491
+ # For example, For more information, see [Using Amazon SNS Application
492
+ # Attributes for Message Delivery Status][1].
493
+ #
494
+ # </note>
495
+ #
496
+ # * Amazon SQS
497
+ #
498
+ # * `SQSSuccessFeedbackRoleArn` – Indicates successful message
499
+ # delivery status for an Amazon SNS topic that is subscribed to an
500
+ # Amazon SQS endpoint.
501
+ #
502
+ # * `SQSSuccessFeedbackSampleRate` – Indicates percentage of
503
+ # successful messages to sample for an Amazon SNS topic that is
504
+ # subscribed to an Amazon SQS endpoint.
505
+ #
506
+ # * `SQSFailureFeedbackRoleArn` – Indicates failed message delivery
507
+ # status for an Amazon SNS topic that is subscribed to an Amazon SQS
508
+ # endpoint.
509
+ #
510
+ # <note markdown="1"> The &lt;ENDPOINT&gt;SuccessFeedbackRoleArn and
511
+ # &lt;ENDPOINT&gt;FailureFeedbackRoleArn attributes are used to give
512
+ # Amazon SNS write access to use CloudWatch Logs on your behalf. The
513
+ # &lt;ENDPOINT&gt;SuccessFeedbackSampleRate attribute is for specifying
514
+ # the sample rate percentage (0-100) of successfully delivered messages.
515
+ # After you configure the &lt;ENDPOINT&gt;FailureFeedbackRoleArn
516
+ # attribute, then all failed message deliveries generate CloudWatch
517
+ # Logs.
518
+ #
519
+ # </note>
520
+ #
521
+ # The following attribute applies only to [server-side-encryption][2]:
383
522
  #
384
523
  # * `KmsMasterKeyId` – The ID of an Amazon Web Services managed customer
385
524
  # master key (CMK) for Amazon SNS or a custom CMK. For more
386
- # information, see [Key Terms][2]. For more examples, see [KeyId][3]
525
+ # information, see [Key Terms][3]. For more examples, see [KeyId][4]
387
526
  # in the *Key Management Service API Reference*.
388
527
  #
389
- # ^
528
+ # * `SignatureVersion` – The signature version corresponds to the
529
+ # hashing algorithm used while creating the signature of the
530
+ # notifications, subscription confirmations, or unsubscribe
531
+ # confirmation messages sent by Amazon SNS. By default,
532
+ # `SignatureVersion` is set to `1`.
390
533
  #
391
- # The following attribute applies only to [FIFO topics][4]\:
534
+ # The following attribute applies only to [FIFO topics][5]:
392
535
  #
393
536
  # * `ContentBasedDeduplication` – Enables content-based deduplication
394
537
  # for FIFO topics.
@@ -396,7 +539,7 @@ module Aws::SNS
396
539
  # * By default, `ContentBasedDeduplication` is set to `false`. If you
397
540
  # create a FIFO topic and this attribute is `false`, you must
398
541
  # specify a value for the `MessageDeduplicationId` parameter for the
399
- # [Publish][5] action.
542
+ # [Publish][6] action.
400
543
  #
401
544
  # * When you set `ContentBasedDeduplication` to `true`, Amazon SNS
402
545
  # uses a SHA-256 hash to generate the `MessageDeduplicationId` using
@@ -408,17 +551,20 @@ module Aws::SNS
408
551
  #
409
552
  #
410
553
  #
411
- # [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
412
- # [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
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
554
+ # [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html
555
+ # [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
556
+ # [3]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
557
+ # [4]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
558
+ # [5]: https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html
559
+ # [6]: https://docs.aws.amazon.com/sns/latest/api/API_Publish.html
416
560
  # @option options [String] :attribute_value
417
561
  # The new value for the attribute.
418
562
  # @return [EmptyStructure]
419
563
  def set_attributes(options = {})
420
564
  options = options.merge(topic_arn: @arn)
421
- resp = @client.set_topic_attributes(options)
565
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
566
+ @client.set_topic_attributes(options)
567
+ end
422
568
  resp.data
423
569
  end
424
570
 
@@ -496,6 +642,14 @@ module Aws::SNS
496
642
  # receive only a subset of messages, rather than receiving every
497
643
  # message published to the topic.
498
644
  #
645
+ # * `FilterPolicyScope` – This attribute lets you choose the filtering
646
+ # scope by using one of the following string value types:
647
+ #
648
+ # * `MessageAttributes` (default) – The filter is applied on the
649
+ # message attributes.
650
+ #
651
+ # * `MessageBody` – The filter is applied on the message body.
652
+ #
499
653
  # * `RawMessageDelivery` – When set to `true`, enables raw message
500
654
  # delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need
501
655
  # for the endpoints to process JSON formatting, which is otherwise
@@ -508,24 +662,45 @@ module Aws::SNS
508
662
  # service that powers the subscribed endpoint becomes unavailable) are
509
663
  # held in the dead-letter queue for further analysis or reprocessing.
510
664
  #
511
- # The following attribute applies only to Amazon Kinesis Data Firehose
512
- # delivery stream subscriptions:
665
+ # The following attribute applies only to Amazon Data Firehose delivery
666
+ # stream subscriptions:
513
667
  #
514
668
  # * `SubscriptionRoleArn` – The ARN of the IAM role that has the
515
669
  # following:
516
670
  #
517
- # * Permission to write to the Kinesis Data Firehose delivery stream
671
+ # * Permission to write to the Firehose delivery stream
518
672
  #
519
673
  # * Amazon SNS listed as a trusted entity
520
674
  #
521
- # Specifying a valid ARN for this attribute is required for Kinesis
522
- # Data Firehose delivery stream subscriptions. For more information,
523
- # see [Fanout to Kinesis Data Firehose delivery streams][1] in the
524
- # *Amazon SNS Developer Guide*.
675
+ # Specifying a valid ARN for this attribute is required for Firehose
676
+ # delivery stream subscriptions. For more information, see [Fanout to
677
+ # Firehose delivery streams][1] in the *Amazon SNS Developer Guide*.
678
+ #
679
+ # The following attributes apply only to [FIFO topics][2]:
680
+ #
681
+ # * `ReplayPolicy` – Adds or updates an inline policy document for a
682
+ # subscription to replay messages stored in the specified Amazon SNS
683
+ # topic.
684
+ #
685
+ # * `ReplayStatus` – Retrieves the status of the subscription message
686
+ # replay, which can be one of the following:
687
+ #
688
+ # * `Completed` – The replay has successfully redelivered all
689
+ # messages, and is now delivering newly published messages. If an
690
+ # ending point was specified in the `ReplayPolicy` then the
691
+ # subscription will no longer receive newly published messages.
692
+ #
693
+ # * `In progress` – The replay is currently replaying the selected
694
+ # messages.
695
+ #
696
+ # * `Failed` – The replay was unable to complete.
697
+ #
698
+ # * `Pending` – The default state while the replay initiates.
525
699
  #
526
700
  #
527
701
  #
528
702
  # [1]: https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html
703
+ # [2]: https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html
529
704
  # @option options [Boolean] :return_subscription_arn
530
705
  # Sets whether the response from the `Subscribe` request includes the
531
706
  # subscription ARN, even if the subscription is not yet confirmed.
@@ -543,7 +718,9 @@ module Aws::SNS
543
718
  # @return [Subscription]
544
719
  def subscribe(options = {})
545
720
  options = options.merge(topic_arn: @arn)
546
- resp = @client.subscribe(options)
721
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
722
+ @client.subscribe(options)
723
+ end
547
724
  Subscription.new(
548
725
  arn: resp.data.subscription_arn,
549
726
  client: @client
@@ -560,7 +737,9 @@ module Aws::SNS
560
737
  def subscriptions(options = {})
561
738
  batches = Enumerator.new do |y|
562
739
  options = options.merge(topic_arn: @arn)
563
- resp = @client.list_subscriptions_by_topic(options)
740
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
741
+ @client.list_subscriptions_by_topic(options)
742
+ end
564
743
  resp.each_page do |page|
565
744
  batch = []
566
745
  page.data.subscriptions.each do |s|