aws-sdk-sns 1.54.0 → 1.56.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.
@@ -0,0 +1,152 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::SNS
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::SNS::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::SNS::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::SNS::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :add_permission
60
+ Aws::SNS::Endpoints::AddPermission.build(context)
61
+ when :check_if_phone_number_is_opted_out
62
+ Aws::SNS::Endpoints::CheckIfPhoneNumberIsOptedOut.build(context)
63
+ when :confirm_subscription
64
+ Aws::SNS::Endpoints::ConfirmSubscription.build(context)
65
+ when :create_platform_application
66
+ Aws::SNS::Endpoints::CreatePlatformApplication.build(context)
67
+ when :create_platform_endpoint
68
+ Aws::SNS::Endpoints::CreatePlatformEndpoint.build(context)
69
+ when :create_sms_sandbox_phone_number
70
+ Aws::SNS::Endpoints::CreateSMSSandboxPhoneNumber.build(context)
71
+ when :create_topic
72
+ Aws::SNS::Endpoints::CreateTopic.build(context)
73
+ when :delete_endpoint
74
+ Aws::SNS::Endpoints::DeleteEndpoint.build(context)
75
+ when :delete_platform_application
76
+ Aws::SNS::Endpoints::DeletePlatformApplication.build(context)
77
+ when :delete_sms_sandbox_phone_number
78
+ Aws::SNS::Endpoints::DeleteSMSSandboxPhoneNumber.build(context)
79
+ when :delete_topic
80
+ Aws::SNS::Endpoints::DeleteTopic.build(context)
81
+ when :get_data_protection_policy
82
+ Aws::SNS::Endpoints::GetDataProtectionPolicy.build(context)
83
+ when :get_endpoint_attributes
84
+ Aws::SNS::Endpoints::GetEndpointAttributes.build(context)
85
+ when :get_platform_application_attributes
86
+ Aws::SNS::Endpoints::GetPlatformApplicationAttributes.build(context)
87
+ when :get_sms_attributes
88
+ Aws::SNS::Endpoints::GetSMSAttributes.build(context)
89
+ when :get_sms_sandbox_account_status
90
+ Aws::SNS::Endpoints::GetSMSSandboxAccountStatus.build(context)
91
+ when :get_subscription_attributes
92
+ Aws::SNS::Endpoints::GetSubscriptionAttributes.build(context)
93
+ when :get_topic_attributes
94
+ Aws::SNS::Endpoints::GetTopicAttributes.build(context)
95
+ when :list_endpoints_by_platform_application
96
+ Aws::SNS::Endpoints::ListEndpointsByPlatformApplication.build(context)
97
+ when :list_origination_numbers
98
+ Aws::SNS::Endpoints::ListOriginationNumbers.build(context)
99
+ when :list_phone_numbers_opted_out
100
+ Aws::SNS::Endpoints::ListPhoneNumbersOptedOut.build(context)
101
+ when :list_platform_applications
102
+ Aws::SNS::Endpoints::ListPlatformApplications.build(context)
103
+ when :list_sms_sandbox_phone_numbers
104
+ Aws::SNS::Endpoints::ListSMSSandboxPhoneNumbers.build(context)
105
+ when :list_subscriptions
106
+ Aws::SNS::Endpoints::ListSubscriptions.build(context)
107
+ when :list_subscriptions_by_topic
108
+ Aws::SNS::Endpoints::ListSubscriptionsByTopic.build(context)
109
+ when :list_tags_for_resource
110
+ Aws::SNS::Endpoints::ListTagsForResource.build(context)
111
+ when :list_topics
112
+ Aws::SNS::Endpoints::ListTopics.build(context)
113
+ when :opt_in_phone_number
114
+ Aws::SNS::Endpoints::OptInPhoneNumber.build(context)
115
+ when :publish
116
+ Aws::SNS::Endpoints::Publish.build(context)
117
+ when :publish_batch
118
+ Aws::SNS::Endpoints::PublishBatch.build(context)
119
+ when :put_data_protection_policy
120
+ Aws::SNS::Endpoints::PutDataProtectionPolicy.build(context)
121
+ when :remove_permission
122
+ Aws::SNS::Endpoints::RemovePermission.build(context)
123
+ when :set_endpoint_attributes
124
+ Aws::SNS::Endpoints::SetEndpointAttributes.build(context)
125
+ when :set_platform_application_attributes
126
+ Aws::SNS::Endpoints::SetPlatformApplicationAttributes.build(context)
127
+ when :set_sms_attributes
128
+ Aws::SNS::Endpoints::SetSMSAttributes.build(context)
129
+ when :set_subscription_attributes
130
+ Aws::SNS::Endpoints::SetSubscriptionAttributes.build(context)
131
+ when :set_topic_attributes
132
+ Aws::SNS::Endpoints::SetTopicAttributes.build(context)
133
+ when :subscribe
134
+ Aws::SNS::Endpoints::Subscribe.build(context)
135
+ when :tag_resource
136
+ Aws::SNS::Endpoints::TagResource.build(context)
137
+ when :unsubscribe
138
+ Aws::SNS::Endpoints::Unsubscribe.build(context)
139
+ when :untag_resource
140
+ Aws::SNS::Endpoints::UntagResource.build(context)
141
+ when :verify_sms_sandbox_phone_number
142
+ Aws::SNS::Endpoints::VerifySMSSandboxPhoneNumber.build(context)
143
+ end
144
+ end
145
+ end
146
+
147
+ def add_handlers(handlers, _config)
148
+ handlers.add(Handler, step: :build, priority: 75)
149
+ end
150
+ end
151
+ end
152
+ end
@@ -81,6 +81,7 @@ module Aws::SNS
81
81
  # value: "TagValue", # required
82
82
  # },
83
83
  # ],
84
+ # data_protection_policy: "attributeValue",
84
85
  # })
85
86
  # @param [Hash] options ({})
86
87
  # @option options [required, String] :name
@@ -152,6 +153,14 @@ module Aws::SNS
152
153
  # `sns:CreateTopic` and `sns:TagResource` permissions.
153
154
  #
154
155
  # </note>
156
+ # @option options [String] :data_protection_policy
157
+ # The body of the policy document you want to use for this topic.
158
+ #
159
+ # You can only add one policy per topic.
160
+ #
161
+ # The policy must be in JSON string format.
162
+ #
163
+ # Length Constraints: Maximum length of 30,720.
155
164
  # @return [Topic]
156
165
  def create_topic(options = {})
157
166
  resp = @client.create_topic(options)
@@ -401,6 +401,7 @@ module Aws::SNS
401
401
  # value: "TagValue", # required
402
402
  # },
403
403
  # ],
404
+ # data_protection_policy: "attributeValue",
404
405
  # }
405
406
  #
406
407
  # @!attribute [rw] name
@@ -481,12 +482,23 @@ module Aws::SNS
481
482
  # </note>
482
483
  # @return [Array<Types::Tag>]
483
484
  #
485
+ # @!attribute [rw] data_protection_policy
486
+ # The body of the policy document you want to use for this topic.
487
+ #
488
+ # You can only add one policy per topic.
489
+ #
490
+ # The policy must be in JSON string format.
491
+ #
492
+ # Length Constraints: Maximum length of 30,720.
493
+ # @return [String]
494
+ #
484
495
  # @see http://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/CreateTopicInput AWS API Documentation
485
496
  #
486
497
  class CreateTopicInput < Struct.new(
487
498
  :name,
488
499
  :attributes,
489
- :tags)
500
+ :tags,
501
+ :data_protection_policy)
490
502
  SENSITIVE = []
491
503
  include Aws::Structure
492
504
  end
@@ -651,6 +663,44 @@ module Aws::SNS
651
663
  include Aws::Structure
652
664
  end
653
665
 
666
+ # @note When making an API call, you may pass GetDataProtectionPolicyInput
667
+ # data as a hash:
668
+ #
669
+ # {
670
+ # resource_arn: "topicARN", # required
671
+ # }
672
+ #
673
+ # @!attribute [rw] resource_arn
674
+ # The ARN of the topic whose `DataProtectionPolicy` you want to get.
675
+ #
676
+ # For more information about ARNs, see [Amazon Resource Names
677
+ # (ARNs)][1] in the Amazon Web Services General Reference.
678
+ #
679
+ #
680
+ #
681
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
682
+ # @return [String]
683
+ #
684
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetDataProtectionPolicyInput AWS API Documentation
685
+ #
686
+ class GetDataProtectionPolicyInput < Struct.new(
687
+ :resource_arn)
688
+ SENSITIVE = []
689
+ include Aws::Structure
690
+ end
691
+
692
+ # @!attribute [rw] data_protection_policy
693
+ # Retrieves the `DataProtectionPolicy` in JSON string format.
694
+ # @return [String]
695
+ #
696
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/GetDataProtectionPolicyResponse AWS API Documentation
697
+ #
698
+ class GetDataProtectionPolicyResponse < Struct.new(
699
+ :data_protection_policy)
700
+ SENSITIVE = []
701
+ include Aws::Structure
702
+ end
703
+
654
704
  # Input for GetEndpointAttributes action.
655
705
  #
656
706
  # @note When making an API call, you may pass GetEndpointAttributesInput
@@ -2227,6 +2277,43 @@ module Aws::SNS
2227
2277
  include Aws::Structure
2228
2278
  end
2229
2279
 
2280
+ # @note When making an API call, you may pass PutDataProtectionPolicyInput
2281
+ # data as a hash:
2282
+ #
2283
+ # {
2284
+ # resource_arn: "topicARN", # required
2285
+ # data_protection_policy: "attributeValue", # required
2286
+ # }
2287
+ #
2288
+ # @!attribute [rw] resource_arn
2289
+ # The ARN of the topic whose `DataProtectionPolicy` you want to add or
2290
+ # update.
2291
+ #
2292
+ # For more information about ARNs, see [Amazon Resource Names
2293
+ # (ARNs)][1] in the Amazon Web Services General Reference.
2294
+ #
2295
+ #
2296
+ #
2297
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
2298
+ # @return [String]
2299
+ #
2300
+ # @!attribute [rw] data_protection_policy
2301
+ # The JSON serialization of the topic's `DataProtectionPolicy`.
2302
+ #
2303
+ # The `DataProtectionPolicy` must be in JSON string format.
2304
+ #
2305
+ # Length Constraints: Maximum length of 30,720.
2306
+ # @return [String]
2307
+ #
2308
+ # @see http://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/PutDataProtectionPolicyInput AWS API Documentation
2309
+ #
2310
+ class PutDataProtectionPolicyInput < Struct.new(
2311
+ :resource_arn,
2312
+ :data_protection_policy)
2313
+ SENSITIVE = []
2314
+ include Aws::Structure
2315
+ end
2316
+
2230
2317
  # Input for RemovePermission action.
2231
2318
  #
2232
2319
  # @note When making an API call, you may pass RemovePermissionInput
data/lib/aws-sdk-sns.rb CHANGED
@@ -13,9 +13,13 @@ require 'aws-sigv4'
13
13
 
14
14
  require_relative 'aws-sdk-sns/types'
15
15
  require_relative 'aws-sdk-sns/client_api'
16
+ require_relative 'aws-sdk-sns/plugins/endpoints.rb'
16
17
  require_relative 'aws-sdk-sns/client'
17
18
  require_relative 'aws-sdk-sns/errors'
18
19
  require_relative 'aws-sdk-sns/resource'
20
+ require_relative 'aws-sdk-sns/endpoint_parameters'
21
+ require_relative 'aws-sdk-sns/endpoint_provider'
22
+ require_relative 'aws-sdk-sns/endpoints'
19
23
  require_relative 'aws-sdk-sns/platform_application'
20
24
  require_relative 'aws-sdk-sns/platform_endpoint'
21
25
  require_relative 'aws-sdk-sns/subscription'
@@ -52,6 +56,6 @@ require_relative 'aws-sdk-sns/customizations'
52
56
  # @!group service
53
57
  module Aws::SNS
54
58
 
55
- GEM_VERSION = '1.54.0'
59
+ GEM_VERSION = '1.56.0'
56
60
 
57
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-sns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.54.0
4
+ version: 1.56.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-22 00:00:00.000000000 Z
11
+ date: 2022-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 3.127.0
22
+ version: 3.165.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 3.127.0
32
+ version: 3.165.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: aws-sigv4
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -59,10 +59,14 @@ files:
59
59
  - lib/aws-sdk-sns/client.rb
60
60
  - lib/aws-sdk-sns/client_api.rb
61
61
  - lib/aws-sdk-sns/customizations.rb
62
+ - lib/aws-sdk-sns/endpoint_parameters.rb
63
+ - lib/aws-sdk-sns/endpoint_provider.rb
64
+ - lib/aws-sdk-sns/endpoints.rb
62
65
  - lib/aws-sdk-sns/errors.rb
63
66
  - lib/aws-sdk-sns/message_verifier.rb
64
67
  - lib/aws-sdk-sns/platform_application.rb
65
68
  - lib/aws-sdk-sns/platform_endpoint.rb
69
+ - lib/aws-sdk-sns/plugins/endpoints.rb
66
70
  - lib/aws-sdk-sns/resource.rb
67
71
  - lib/aws-sdk-sns/subscription.rb
68
72
  - lib/aws-sdk-sns/topic.rb