aws-sdk-sns 1.42.0 → 1.77.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 +4 -4
- data/CHANGELOG.md +182 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-sns/client.rb +684 -180
- data/lib/aws-sdk-sns/client_api.rb +173 -28
- data/lib/aws-sdk-sns/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sns/endpoint_provider.rb +60 -0
- data/lib/aws-sdk-sns/endpoints.rb +604 -0
- data/lib/aws-sdk-sns/errors.rb +112 -0
- data/lib/aws-sdk-sns/message_verifier.rb +32 -5
- data/lib/aws-sdk-sns/platform_application.rb +76 -13
- data/lib/aws-sdk-sns/platform_endpoint.rb +18 -11
- data/lib/aws-sdk-sns/plugins/endpoints.rb +154 -0
- data/lib/aws-sdk-sns/resource.rb +49 -10
- data/lib/aws-sdk-sns/subscription.rb +39 -18
- data/lib/aws-sdk-sns/topic.rb +220 -41
- data/lib/aws-sdk-sns/types.rb +793 -479
- data/lib/aws-sdk-sns.rb +5 -1
- data/sig/client.rbs +525 -0
- data/sig/errors.rbs +119 -0
- data/sig/platform_application.rbs +64 -0
- data/sig/platform_endpoint.rbs +68 -0
- data/sig/resource.rbs +128 -0
- data/sig/subscription.rbs +52 -0
- data/sig/topic.rbs +104 -0
- data/sig/types.rbs +664 -0
- data/sig/waiters.rbs +13 -0
- metadata +22 -9
data/lib/aws-sdk-sns/errors.rb
CHANGED
@@ -28,13 +28,18 @@ module Aws::SNS
|
|
28
28
|
#
|
29
29
|
# ## Error Classes
|
30
30
|
# * {AuthorizationErrorException}
|
31
|
+
# * {BatchEntryIdsNotDistinctException}
|
32
|
+
# * {BatchRequestTooLongException}
|
31
33
|
# * {ConcurrentAccessException}
|
34
|
+
# * {EmptyBatchRequestException}
|
32
35
|
# * {EndpointDisabledException}
|
33
36
|
# * {FilterPolicyLimitExceededException}
|
34
37
|
# * {InternalErrorException}
|
38
|
+
# * {InvalidBatchEntryIdException}
|
35
39
|
# * {InvalidParameterException}
|
36
40
|
# * {InvalidParameterValueException}
|
37
41
|
# * {InvalidSecurityException}
|
42
|
+
# * {InvalidStateException}
|
38
43
|
# * {KMSAccessDeniedException}
|
39
44
|
# * {KMSDisabledException}
|
40
45
|
# * {KMSInvalidStateException}
|
@@ -44,12 +49,14 @@ module Aws::SNS
|
|
44
49
|
# * {NotFoundException}
|
45
50
|
# * {OptedOutException}
|
46
51
|
# * {PlatformApplicationDisabledException}
|
52
|
+
# * {ReplayLimitExceededException}
|
47
53
|
# * {ResourceNotFoundException}
|
48
54
|
# * {StaleTagException}
|
49
55
|
# * {SubscriptionLimitExceededException}
|
50
56
|
# * {TagLimitExceededException}
|
51
57
|
# * {TagPolicyException}
|
52
58
|
# * {ThrottledException}
|
59
|
+
# * {TooManyEntriesInBatchRequestException}
|
53
60
|
# * {TopicLimitExceededException}
|
54
61
|
# * {UserErrorException}
|
55
62
|
# * {ValidationException}
|
@@ -76,6 +83,36 @@ module Aws::SNS
|
|
76
83
|
end
|
77
84
|
end
|
78
85
|
|
86
|
+
class BatchEntryIdsNotDistinctException < ServiceError
|
87
|
+
|
88
|
+
# @param [Seahorse::Client::RequestContext] context
|
89
|
+
# @param [String] message
|
90
|
+
# @param [Aws::SNS::Types::BatchEntryIdsNotDistinctException] data
|
91
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
92
|
+
super(context, message, data)
|
93
|
+
end
|
94
|
+
|
95
|
+
# @return [String]
|
96
|
+
def message
|
97
|
+
@message || @data[:message]
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
class BatchRequestTooLongException < ServiceError
|
102
|
+
|
103
|
+
# @param [Seahorse::Client::RequestContext] context
|
104
|
+
# @param [String] message
|
105
|
+
# @param [Aws::SNS::Types::BatchRequestTooLongException] data
|
106
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
107
|
+
super(context, message, data)
|
108
|
+
end
|
109
|
+
|
110
|
+
# @return [String]
|
111
|
+
def message
|
112
|
+
@message || @data[:message]
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
79
116
|
class ConcurrentAccessException < ServiceError
|
80
117
|
|
81
118
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -91,6 +128,21 @@ module Aws::SNS
|
|
91
128
|
end
|
92
129
|
end
|
93
130
|
|
131
|
+
class EmptyBatchRequestException < ServiceError
|
132
|
+
|
133
|
+
# @param [Seahorse::Client::RequestContext] context
|
134
|
+
# @param [String] message
|
135
|
+
# @param [Aws::SNS::Types::EmptyBatchRequestException] data
|
136
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
137
|
+
super(context, message, data)
|
138
|
+
end
|
139
|
+
|
140
|
+
# @return [String]
|
141
|
+
def message
|
142
|
+
@message || @data[:message]
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
94
146
|
class EndpointDisabledException < ServiceError
|
95
147
|
|
96
148
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -136,6 +188,21 @@ module Aws::SNS
|
|
136
188
|
end
|
137
189
|
end
|
138
190
|
|
191
|
+
class InvalidBatchEntryIdException < ServiceError
|
192
|
+
|
193
|
+
# @param [Seahorse::Client::RequestContext] context
|
194
|
+
# @param [String] message
|
195
|
+
# @param [Aws::SNS::Types::InvalidBatchEntryIdException] data
|
196
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
197
|
+
super(context, message, data)
|
198
|
+
end
|
199
|
+
|
200
|
+
# @return [String]
|
201
|
+
def message
|
202
|
+
@message || @data[:message]
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
139
206
|
class InvalidParameterException < ServiceError
|
140
207
|
|
141
208
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -181,6 +248,21 @@ module Aws::SNS
|
|
181
248
|
end
|
182
249
|
end
|
183
250
|
|
251
|
+
class InvalidStateException < ServiceError
|
252
|
+
|
253
|
+
# @param [Seahorse::Client::RequestContext] context
|
254
|
+
# @param [String] message
|
255
|
+
# @param [Aws::SNS::Types::InvalidStateException] data
|
256
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
257
|
+
super(context, message, data)
|
258
|
+
end
|
259
|
+
|
260
|
+
# @return [String]
|
261
|
+
def message
|
262
|
+
@message || @data[:message]
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
184
266
|
class KMSAccessDeniedException < ServiceError
|
185
267
|
|
186
268
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -316,6 +398,21 @@ module Aws::SNS
|
|
316
398
|
end
|
317
399
|
end
|
318
400
|
|
401
|
+
class ReplayLimitExceededException < ServiceError
|
402
|
+
|
403
|
+
# @param [Seahorse::Client::RequestContext] context
|
404
|
+
# @param [String] message
|
405
|
+
# @param [Aws::SNS::Types::ReplayLimitExceededException] data
|
406
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
407
|
+
super(context, message, data)
|
408
|
+
end
|
409
|
+
|
410
|
+
# @return [String]
|
411
|
+
def message
|
412
|
+
@message || @data[:message]
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
319
416
|
class ResourceNotFoundException < ServiceError
|
320
417
|
|
321
418
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -406,6 +503,21 @@ module Aws::SNS
|
|
406
503
|
end
|
407
504
|
end
|
408
505
|
|
506
|
+
class TooManyEntriesInBatchRequestException < ServiceError
|
507
|
+
|
508
|
+
# @param [Seahorse::Client::RequestContext] context
|
509
|
+
# @param [String] message
|
510
|
+
# @param [Aws::SNS::Types::TooManyEntriesInBatchRequestException] data
|
511
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
512
|
+
super(context, message, data)
|
513
|
+
end
|
514
|
+
|
515
|
+
# @return [String]
|
516
|
+
def message
|
517
|
+
@message || @data[:message]
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
409
521
|
class TopicLimitExceededException < ServiceError
|
410
522
|
|
411
523
|
# @param [Seahorse::Client::RequestContext] context
|
@@ -65,11 +65,15 @@ module Aws
|
|
65
65
|
def authenticate!(message_body)
|
66
66
|
msg = Json.load(message_body)
|
67
67
|
msg = convert_lambda_msg(msg) if is_from_lambda(msg)
|
68
|
-
|
69
|
-
|
68
|
+
|
69
|
+
case msg['SignatureVersion']
|
70
|
+
when '1'
|
71
|
+
verify!(msg, sha1)
|
72
|
+
when '2'
|
73
|
+
verify!(msg, sha256)
|
70
74
|
else
|
71
|
-
|
72
|
-
raise VerificationError,
|
75
|
+
error_msg = 'Invalid SignatureVersion'
|
76
|
+
raise VerificationError, error_msg
|
73
77
|
end
|
74
78
|
end
|
75
79
|
|
@@ -88,10 +92,23 @@ module Aws
|
|
88
92
|
message
|
89
93
|
end
|
90
94
|
|
95
|
+
def verify!(msg, hash_alg)
|
96
|
+
if public_key(msg).verify(hash_alg, signature(msg), canonical_string(msg))
|
97
|
+
true
|
98
|
+
else
|
99
|
+
msg = 'the authenticity of the message cannot be verified'
|
100
|
+
raise VerificationError, msg
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
91
104
|
def sha1
|
92
105
|
OpenSSL::Digest::SHA1.new
|
93
106
|
end
|
94
107
|
|
108
|
+
def sha256
|
109
|
+
OpenSSL::Digest::SHA256.new
|
110
|
+
end
|
111
|
+
|
95
112
|
def signature(message)
|
96
113
|
Base64.decode64(message['Signature'])
|
97
114
|
end
|
@@ -123,7 +140,9 @@ module Aws
|
|
123
140
|
|
124
141
|
def download_pem(uri)
|
125
142
|
verify_uri!(uri)
|
126
|
-
https_get(uri)
|
143
|
+
pem = https_get(uri)
|
144
|
+
verify_pem_format!(pem)
|
145
|
+
pem
|
127
146
|
end
|
128
147
|
|
129
148
|
def verify_uri!(uri)
|
@@ -153,6 +172,14 @@ module Aws
|
|
153
172
|
end
|
154
173
|
end
|
155
174
|
|
175
|
+
def verify_pem_format!(pem)
|
176
|
+
cert_regex = /\A[\s]*-----BEGIN [A-Z]+-----\n[A-Za-z\d+\/\n]+[=]{0,2}\n-----END [A-Z]+-----[\s]*\Z/
|
177
|
+
unless pem =~ cert_regex
|
178
|
+
msg = 'The certificate does not match expected X509 PEM format.'
|
179
|
+
raise VerificationError, msg
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
156
183
|
def https_get(uri, failed_attempts = 0)
|
157
184
|
args = []
|
158
185
|
args << uri.host
|
@@ -36,6 +36,23 @@ module Aws::SNS
|
|
36
36
|
|
37
37
|
# Attributes include the following:
|
38
38
|
#
|
39
|
+
# * `AppleCertificateExpiryDate` – The expiry date of the SSL
|
40
|
+
# certificate used to configure certificate-based authentication.
|
41
|
+
#
|
42
|
+
# * `ApplePlatformTeamID` – The Apple developer account ID used to
|
43
|
+
# configure token-based authentication.
|
44
|
+
#
|
45
|
+
# * `ApplePlatformBundleID` – The app identifier used to configure
|
46
|
+
# token-based authentication.
|
47
|
+
#
|
48
|
+
# * `AuthenticationMethod` – Returns the credential type used when
|
49
|
+
# sending push notifications from application to APNS/APNS\_Sandbox,
|
50
|
+
# or application to GCM.
|
51
|
+
#
|
52
|
+
# * APNS – Returns the token or certificate.
|
53
|
+
#
|
54
|
+
# * GCM – Returns the token or key.
|
55
|
+
#
|
39
56
|
# * `EventEndpointCreated` – Topic ARN to which EndpointCreated event
|
40
57
|
# notifications should be sent.
|
41
58
|
#
|
@@ -67,7 +84,9 @@ module Aws::SNS
|
|
67
84
|
#
|
68
85
|
# @return [self]
|
69
86
|
def load
|
70
|
-
resp =
|
87
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
88
|
+
@client.get_platform_application_attributes(platform_application_arn: @arn)
|
89
|
+
end
|
71
90
|
@data = resp.data
|
72
91
|
self
|
73
92
|
end
|
@@ -111,7 +130,7 @@ module Aws::SNS
|
|
111
130
|
# Arbitrary user data to associate with the endpoint. Amazon SNS does
|
112
131
|
# not use this data. The data must be in UTF-8 format and less than 2KB.
|
113
132
|
# @option options [Hash<String,String>] :attributes
|
114
|
-
# For a list of attributes, see [SetEndpointAttributes][1].
|
133
|
+
# For a list of attributes, see [ `SetEndpointAttributes` ][1].
|
115
134
|
#
|
116
135
|
#
|
117
136
|
#
|
@@ -119,7 +138,9 @@ module Aws::SNS
|
|
119
138
|
# @return [PlatformEndpoint]
|
120
139
|
def create_platform_endpoint(options = {})
|
121
140
|
options = options.merge(platform_application_arn: @arn)
|
122
|
-
resp =
|
141
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
142
|
+
@client.create_platform_endpoint(options)
|
143
|
+
end
|
123
144
|
PlatformEndpoint.new(
|
124
145
|
arn: resp.data.endpoint_arn,
|
125
146
|
client: @client
|
@@ -133,7 +154,9 @@ module Aws::SNS
|
|
133
154
|
# @return [EmptyStructure]
|
134
155
|
def delete(options = {})
|
135
156
|
options = options.merge(platform_application_arn: @arn)
|
136
|
-
resp =
|
157
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
158
|
+
@client.delete_platform_application(options)
|
159
|
+
end
|
137
160
|
resp.data
|
138
161
|
end
|
139
162
|
|
@@ -150,15 +173,42 @@ module Aws::SNS
|
|
150
173
|
# include the following:
|
151
174
|
#
|
152
175
|
# * `PlatformCredential` – The credential received from the notification
|
153
|
-
# service.
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
176
|
+
# service.
|
177
|
+
#
|
178
|
+
# * For ADM, `PlatformCredential`is client secret.
|
179
|
+
#
|
180
|
+
# * For Apple Services using certificate credentials,
|
181
|
+
# `PlatformCredential` is private key.
|
182
|
+
#
|
183
|
+
# * For Apple Services using token credentials, `PlatformCredential`
|
184
|
+
# is signing key.
|
185
|
+
#
|
186
|
+
# * For GCM (Firebase Cloud Messaging) using key credentials, there is
|
187
|
+
# no `PlatformPrincipal`. The `PlatformCredential` is `API key`.
|
188
|
+
#
|
189
|
+
# * For GCM (Firebase Cloud Messaging) using token credentials, there
|
190
|
+
# is no `PlatformPrincipal`. The `PlatformCredential` is a JSON
|
191
|
+
# formatted private key file. When using the Amazon Web Services
|
192
|
+
# CLI, the file must be in string format and special characters must
|
193
|
+
# be ignored. To format the file correctly, Amazon SNS recommends
|
194
|
+
# using the following command: `` SERVICE_JSON=`jq @json <<< cat
|
195
|
+
# service.json` ``.
|
196
|
+
# ^
|
157
197
|
#
|
158
198
|
# * `PlatformPrincipal` – The principal received from the notification
|
159
|
-
# service.
|
160
|
-
#
|
161
|
-
#
|
199
|
+
# service.
|
200
|
+
#
|
201
|
+
# * For ADM, `PlatformPrincipal`is client id.
|
202
|
+
#
|
203
|
+
# * For Apple Services using certificate credentials,
|
204
|
+
# `PlatformPrincipal` is SSL certificate.
|
205
|
+
#
|
206
|
+
# * For Apple Services using token credentials, `PlatformPrincipal` is
|
207
|
+
# signing key ID.
|
208
|
+
#
|
209
|
+
# * For GCM (Firebase Cloud Messaging), there is no
|
210
|
+
# `PlatformPrincipal`.
|
211
|
+
# ^
|
162
212
|
#
|
163
213
|
# * `EventEndpointCreated` – Topic ARN to which `EndpointCreated` event
|
164
214
|
# notifications are sent.
|
@@ -181,10 +231,21 @@ module Aws::SNS
|
|
181
231
|
#
|
182
232
|
# * `SuccessFeedbackSampleRate` – Sample rate percentage (0-100) of
|
183
233
|
# successfully delivered messages.
|
234
|
+
#
|
235
|
+
# The following attributes only apply to `APNs` token-based
|
236
|
+
# authentication:
|
237
|
+
#
|
238
|
+
# * `ApplePlatformTeamID` – The identifier that's assigned to your
|
239
|
+
# Apple developer account team.
|
240
|
+
#
|
241
|
+
# * `ApplePlatformBundleID` – The bundle identifier that's assigned to
|
242
|
+
# your iOS app.
|
184
243
|
# @return [EmptyStructure]
|
185
244
|
def set_attributes(options = {})
|
186
245
|
options = options.merge(platform_application_arn: @arn)
|
187
|
-
resp =
|
246
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
247
|
+
@client.set_platform_application_attributes(options)
|
248
|
+
end
|
188
249
|
resp.data
|
189
250
|
end
|
190
251
|
|
@@ -198,7 +259,9 @@ module Aws::SNS
|
|
198
259
|
def endpoints(options = {})
|
199
260
|
batches = Enumerator.new do |y|
|
200
261
|
options = options.merge(platform_application_arn: @arn)
|
201
|
-
resp =
|
262
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
263
|
+
@client.list_endpoints_by_platform_application(options)
|
264
|
+
end
|
202
265
|
resp.each_page do |page|
|
203
266
|
batch = []
|
204
267
|
page.data.endpoints.each do |e|
|
@@ -72,7 +72,9 @@ module Aws::SNS
|
|
72
72
|
#
|
73
73
|
# @return [self]
|
74
74
|
def load
|
75
|
-
resp =
|
75
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
76
|
+
@client.get_endpoint_attributes(endpoint_arn: @arn)
|
77
|
+
end
|
76
78
|
@data = resp.data
|
77
79
|
self
|
78
80
|
end
|
@@ -102,7 +104,9 @@ module Aws::SNS
|
|
102
104
|
# @return [EmptyStructure]
|
103
105
|
def delete(options = {})
|
104
106
|
options = options.merge(endpoint_arn: @arn)
|
105
|
-
resp =
|
107
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
108
|
+
@client.delete_endpoint(options)
|
109
|
+
end
|
106
110
|
resp.data
|
107
111
|
end
|
108
112
|
|
@@ -110,7 +114,7 @@ module Aws::SNS
|
|
110
114
|
#
|
111
115
|
# platform_endpoint.publish({
|
112
116
|
# topic_arn: "topicARN",
|
113
|
-
# phone_number: "
|
117
|
+
# phone_number: "PhoneNumber",
|
114
118
|
# message: "message", # required
|
115
119
|
# subject: "subject",
|
116
120
|
# message_structure: "messageStructure",
|
@@ -196,9 +200,8 @@ module Aws::SNS
|
|
196
200
|
# is delivered to email endpoints. This field will also be included, if
|
197
201
|
# present, in the standard JSON messages delivered to other endpoints.
|
198
202
|
#
|
199
|
-
# Constraints: Subjects must be
|
200
|
-
#
|
201
|
-
# characters; and must be less than 100 characters long.
|
203
|
+
# Constraints: Subjects must be UTF-8 text with no line breaks or
|
204
|
+
# control characters, and less than 100 characters long.
|
202
205
|
# @option options [String] :message_structure
|
203
206
|
# Set `MessageStructure` to `json` if you want to send a different
|
204
207
|
# message for each protocol. For example, using one publish action, you
|
@@ -220,7 +223,7 @@ module Aws::SNS
|
|
220
223
|
# @option options [String] :message_deduplication_id
|
221
224
|
# This parameter applies only to FIFO (first-in-first-out) topics. The
|
222
225
|
# `MessageDeduplicationId` can contain up to 128 alphanumeric characters
|
223
|
-
# (a-z, A-Z, 0-9) and punctuation ``
|
226
|
+
# `(a-z, A-Z, 0-9)` and punctuation ``
|
224
227
|
# (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
225
228
|
#
|
226
229
|
# Every message must have a unique `MessageDeduplicationId`, which is a
|
@@ -234,8 +237,8 @@ module Aws::SNS
|
|
234
237
|
# `MessageDeduplicationId` overrides the generated one.
|
235
238
|
# @option options [String] :message_group_id
|
236
239
|
# 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 `` (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
240
|
+
# `MessageGroupId` can contain up to 128 alphanumeric characters `(a-z,
|
241
|
+
# A-Z, 0-9)` and punctuation `` (!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
|
239
242
|
#
|
240
243
|
# The `MessageGroupId` is a tag that specifies that a message belongs to
|
241
244
|
# a specific message group. Messages that belong to the same message
|
@@ -245,7 +248,9 @@ module Aws::SNS
|
|
245
248
|
# @return [Types::PublishResponse]
|
246
249
|
def publish(options = {})
|
247
250
|
options = options.merge(target_arn: @arn)
|
248
|
-
resp =
|
251
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
252
|
+
@client.publish(options)
|
253
|
+
end
|
249
254
|
resp.data
|
250
255
|
end
|
251
256
|
|
@@ -277,7 +282,9 @@ module Aws::SNS
|
|
277
282
|
# @return [EmptyStructure]
|
278
283
|
def set_attributes(options = {})
|
279
284
|
options = options.merge(endpoint_arn: @arn)
|
280
|
-
resp =
|
285
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
286
|
+
@client.set_endpoint_attributes(options)
|
287
|
+
end
|
281
288
|
resp.data
|
282
289
|
end
|
283
290
|
|
@@ -0,0 +1,154 @@
|
|
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
|
+
rbs_type: 'untyped',
|
18
|
+
docstring: 'The endpoint provider used to resolve endpoints. Any '\
|
19
|
+
'object that responds to `#resolve_endpoint(parameters)` '\
|
20
|
+
'where `parameters` is a Struct similar to '\
|
21
|
+
'`Aws::SNS::EndpointParameters`'
|
22
|
+
) do |cfg|
|
23
|
+
Aws::SNS::EndpointProvider.new
|
24
|
+
end
|
25
|
+
|
26
|
+
# @api private
|
27
|
+
class Handler < Seahorse::Client::Handler
|
28
|
+
def call(context)
|
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
|
+
|
36
|
+
context[:endpoint_params] = params
|
37
|
+
context[:endpoint_properties] = endpoint.properties
|
38
|
+
end
|
39
|
+
|
40
|
+
context[:auth_scheme] =
|
41
|
+
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
42
|
+
|
43
|
+
@handler.call(context)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def apply_endpoint_headers(context, headers)
|
49
|
+
headers.each do |key, values|
|
50
|
+
value = values
|
51
|
+
.compact
|
52
|
+
.map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
|
53
|
+
.join(',')
|
54
|
+
|
55
|
+
context.http_request.headers[key] = value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def parameters_for_operation(context)
|
60
|
+
case context.operation_name
|
61
|
+
when :add_permission
|
62
|
+
Aws::SNS::Endpoints::AddPermission.build(context)
|
63
|
+
when :check_if_phone_number_is_opted_out
|
64
|
+
Aws::SNS::Endpoints::CheckIfPhoneNumberIsOptedOut.build(context)
|
65
|
+
when :confirm_subscription
|
66
|
+
Aws::SNS::Endpoints::ConfirmSubscription.build(context)
|
67
|
+
when :create_platform_application
|
68
|
+
Aws::SNS::Endpoints::CreatePlatformApplication.build(context)
|
69
|
+
when :create_platform_endpoint
|
70
|
+
Aws::SNS::Endpoints::CreatePlatformEndpoint.build(context)
|
71
|
+
when :create_sms_sandbox_phone_number
|
72
|
+
Aws::SNS::Endpoints::CreateSMSSandboxPhoneNumber.build(context)
|
73
|
+
when :create_topic
|
74
|
+
Aws::SNS::Endpoints::CreateTopic.build(context)
|
75
|
+
when :delete_endpoint
|
76
|
+
Aws::SNS::Endpoints::DeleteEndpoint.build(context)
|
77
|
+
when :delete_platform_application
|
78
|
+
Aws::SNS::Endpoints::DeletePlatformApplication.build(context)
|
79
|
+
when :delete_sms_sandbox_phone_number
|
80
|
+
Aws::SNS::Endpoints::DeleteSMSSandboxPhoneNumber.build(context)
|
81
|
+
when :delete_topic
|
82
|
+
Aws::SNS::Endpoints::DeleteTopic.build(context)
|
83
|
+
when :get_data_protection_policy
|
84
|
+
Aws::SNS::Endpoints::GetDataProtectionPolicy.build(context)
|
85
|
+
when :get_endpoint_attributes
|
86
|
+
Aws::SNS::Endpoints::GetEndpointAttributes.build(context)
|
87
|
+
when :get_platform_application_attributes
|
88
|
+
Aws::SNS::Endpoints::GetPlatformApplicationAttributes.build(context)
|
89
|
+
when :get_sms_attributes
|
90
|
+
Aws::SNS::Endpoints::GetSMSAttributes.build(context)
|
91
|
+
when :get_sms_sandbox_account_status
|
92
|
+
Aws::SNS::Endpoints::GetSMSSandboxAccountStatus.build(context)
|
93
|
+
when :get_subscription_attributes
|
94
|
+
Aws::SNS::Endpoints::GetSubscriptionAttributes.build(context)
|
95
|
+
when :get_topic_attributes
|
96
|
+
Aws::SNS::Endpoints::GetTopicAttributes.build(context)
|
97
|
+
when :list_endpoints_by_platform_application
|
98
|
+
Aws::SNS::Endpoints::ListEndpointsByPlatformApplication.build(context)
|
99
|
+
when :list_origination_numbers
|
100
|
+
Aws::SNS::Endpoints::ListOriginationNumbers.build(context)
|
101
|
+
when :list_phone_numbers_opted_out
|
102
|
+
Aws::SNS::Endpoints::ListPhoneNumbersOptedOut.build(context)
|
103
|
+
when :list_platform_applications
|
104
|
+
Aws::SNS::Endpoints::ListPlatformApplications.build(context)
|
105
|
+
when :list_sms_sandbox_phone_numbers
|
106
|
+
Aws::SNS::Endpoints::ListSMSSandboxPhoneNumbers.build(context)
|
107
|
+
when :list_subscriptions
|
108
|
+
Aws::SNS::Endpoints::ListSubscriptions.build(context)
|
109
|
+
when :list_subscriptions_by_topic
|
110
|
+
Aws::SNS::Endpoints::ListSubscriptionsByTopic.build(context)
|
111
|
+
when :list_tags_for_resource
|
112
|
+
Aws::SNS::Endpoints::ListTagsForResource.build(context)
|
113
|
+
when :list_topics
|
114
|
+
Aws::SNS::Endpoints::ListTopics.build(context)
|
115
|
+
when :opt_in_phone_number
|
116
|
+
Aws::SNS::Endpoints::OptInPhoneNumber.build(context)
|
117
|
+
when :publish
|
118
|
+
Aws::SNS::Endpoints::Publish.build(context)
|
119
|
+
when :publish_batch
|
120
|
+
Aws::SNS::Endpoints::PublishBatch.build(context)
|
121
|
+
when :put_data_protection_policy
|
122
|
+
Aws::SNS::Endpoints::PutDataProtectionPolicy.build(context)
|
123
|
+
when :remove_permission
|
124
|
+
Aws::SNS::Endpoints::RemovePermission.build(context)
|
125
|
+
when :set_endpoint_attributes
|
126
|
+
Aws::SNS::Endpoints::SetEndpointAttributes.build(context)
|
127
|
+
when :set_platform_application_attributes
|
128
|
+
Aws::SNS::Endpoints::SetPlatformApplicationAttributes.build(context)
|
129
|
+
when :set_sms_attributes
|
130
|
+
Aws::SNS::Endpoints::SetSMSAttributes.build(context)
|
131
|
+
when :set_subscription_attributes
|
132
|
+
Aws::SNS::Endpoints::SetSubscriptionAttributes.build(context)
|
133
|
+
when :set_topic_attributes
|
134
|
+
Aws::SNS::Endpoints::SetTopicAttributes.build(context)
|
135
|
+
when :subscribe
|
136
|
+
Aws::SNS::Endpoints::Subscribe.build(context)
|
137
|
+
when :tag_resource
|
138
|
+
Aws::SNS::Endpoints::TagResource.build(context)
|
139
|
+
when :unsubscribe
|
140
|
+
Aws::SNS::Endpoints::Unsubscribe.build(context)
|
141
|
+
when :untag_resource
|
142
|
+
Aws::SNS::Endpoints::UntagResource.build(context)
|
143
|
+
when :verify_sms_sandbox_phone_number
|
144
|
+
Aws::SNS::Endpoints::VerifySMSSandboxPhoneNumber.build(context)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
def add_handlers(handlers, _config)
|
150
|
+
handlers.add(Handler, step: :build, priority: 75)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|