aws-sdk-sns 1.0.0.rc1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c47c6b563e6b9fc2cb7deb4f74d46dbb2837ed73
4
+ data.tar.gz: e477dc5753d2df7b781a9922f8bda0d40139c05a
5
+ SHA512:
6
+ metadata.gz: 888083aafb3c99bdf8f6f26a97c452f730d0dda5c4e1eab83184a22a001c6b68369a0ce71d55eb6aa9c48646b97f9603c3e93df9e8546238390c95413c96c6c4
7
+ data.tar.gz: 8dd03e76f55a8aa439335466f3d81e00ea5130bec2898e01f4134da2a793087249d6a9e0f0cca8e3c3f58d850fc1f0603f50b3bf49fcb98e5cfb0d4ed9833977
@@ -0,0 +1,51 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-sns/types'
12
+ require_relative 'aws-sdk-sns/client_api'
13
+ require_relative 'aws-sdk-sns/client'
14
+ require_relative 'aws-sdk-sns/errors'
15
+ require_relative 'aws-sdk-sns/resource'
16
+ require_relative 'aws-sdk-sns/platform_application'
17
+ require_relative 'aws-sdk-sns/platform_endpoint'
18
+ require_relative 'aws-sdk-sns/subscription'
19
+ require_relative 'aws-sdk-sns/topic'
20
+ require_relative 'aws-sdk-sns/customizations'
21
+
22
+ # This module provides support for Amazon Simple Notification Service. This module is available in the
23
+ # `aws-sdk-sns` gem.
24
+ #
25
+ # # Client
26
+ #
27
+ # The {Client} class provides one method for each API operation. Operation
28
+ # methods each accept a hash of request parameters and return a response
29
+ # structure.
30
+ #
31
+ # See {Client} for more information.
32
+ #
33
+ # # Errors
34
+ #
35
+ # Errors returned from Amazon Simple Notification Service all
36
+ # extend {Errors::ServiceError}.
37
+ #
38
+ # begin
39
+ # # do stuff
40
+ # rescue Aws::SNS::Errors::ServiceError
41
+ # # rescues all service API errors
42
+ # end
43
+ #
44
+ # See {Errors} for more information.
45
+ #
46
+ # @service
47
+ module Aws::SNS
48
+
49
+ GEM_VERSION = '1.0.0.rc1'
50
+
51
+ end
@@ -0,0 +1,1378 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing for info on making contributions:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/response_paging.rb'
19
+ require 'aws-sdk-core/plugins/stub_responses.rb'
20
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
21
+ require 'aws-sdk-core/plugins/signature_v4.rb'
22
+ require 'aws-sdk-core/plugins/protocols/query.rb'
23
+
24
+ Aws::Plugins::GlobalConfiguration.add_identifier(:sns)
25
+
26
+ module Aws
27
+ module SNS
28
+ class Client < Seahorse::Client::Base
29
+
30
+ include Aws::ClientStubs
31
+
32
+ @identifier = :sns
33
+
34
+ set_api(ClientApi::API)
35
+
36
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
37
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
38
+ add_plugin(Aws::Plugins::Logging)
39
+ add_plugin(Aws::Plugins::ParamConverter)
40
+ add_plugin(Aws::Plugins::ParamValidator)
41
+ add_plugin(Aws::Plugins::UserAgent)
42
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
43
+ add_plugin(Aws::Plugins::RetryErrors)
44
+ add_plugin(Aws::Plugins::GlobalConfiguration)
45
+ add_plugin(Aws::Plugins::RegionalEndpoint)
46
+ add_plugin(Aws::Plugins::ResponsePaging)
47
+ add_plugin(Aws::Plugins::StubResponses)
48
+ add_plugin(Aws::Plugins::IdempotencyToken)
49
+ add_plugin(Aws::Plugins::SignatureV4)
50
+ add_plugin(Aws::Plugins::Protocols::Query)
51
+
52
+ # @option options [required, Aws::CredentialProvider] :credentials
53
+ # Your AWS credentials. This can be an instance of any one of the
54
+ # following classes:
55
+ #
56
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
57
+ # credentials.
58
+ #
59
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
60
+ # from an EC2 IMDS on an EC2 instance.
61
+ #
62
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
63
+ # shared file, such as `~/.aws/config`.
64
+ #
65
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
66
+ #
67
+ # When `:credentials` are not configured directly, the following
68
+ # locations will be searched for credentials:
69
+ #
70
+ # * `Aws.config[:credentials]`
71
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
72
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
73
+ # * `~/.aws/credentials`
74
+ # * `~/.aws/config`
75
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
76
+ # very aggressive. Construct and pass an instance of
77
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
78
+ # timeouts.
79
+ # @option options [required, String] :region
80
+ # The AWS region to connect to. The configured `:region` is
81
+ # used to determine the service `:endpoint`. When not passed,
82
+ # a default `:region` is search for in the following locations:
83
+ #
84
+ # * `Aws.config[:region]`
85
+ # * `ENV['AWS_REGION']`
86
+ # * `ENV['AMAZON_REGION']`
87
+ # * `ENV['AWS_DEFAULT_REGION']`
88
+ # * `~/.aws/credentials`
89
+ # * `~/.aws/config`
90
+ # @option options [String] :access_key_id
91
+ # @option options [Boolean] :convert_params (true)
92
+ # When `true`, an attempt is made to coerce request parameters into
93
+ # the required types.
94
+ # @option options [String] :endpoint
95
+ # The client endpoint is normally constructed from the `:region`
96
+ # option. You should only configure an `:endpoint` when connecting
97
+ # to test endpoints. This should be avalid HTTP(S) URI.
98
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
99
+ # The log formatter.
100
+ # @option options [Symbol] :log_level (:info)
101
+ # The log level to send messages to the `:logger` at.
102
+ # @option options [Logger] :logger
103
+ # The Logger instance to send log messages to. If this option
104
+ # is not set, logging will be disabled.
105
+ # @option options [String] :profile ("default")
106
+ # Used when loading credentials from the shared credentials file
107
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
108
+ # @option options [Integer] :retry_limit (3)
109
+ # The maximum number of times to retry failed requests. Only
110
+ # ~ 500 level server errors and certain ~ 400 level client errors
111
+ # are retried. Generally, these are throttling errors, data
112
+ # checksum errors, networking errors, timeout errors and auth
113
+ # errors from expired credentials.
114
+ # @option options [String] :secret_access_key
115
+ # @option options [String] :session_token
116
+ # @option options [Boolean] :stub_responses (false)
117
+ # Causes the client to return stubbed responses. By default
118
+ # fake responses are generated and returned. You can specify
119
+ # the response data to return or errors to raise by calling
120
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
121
+ #
122
+ # ** Please note ** When response stubbing is enabled, no HTTP
123
+ # requests are made, and retries are disabled.
124
+ # @option options [Boolean] :validate_params (true)
125
+ # When `true`, request parameters are validated before
126
+ # sending the request.
127
+ def initialize(*args)
128
+ super
129
+ end
130
+
131
+ # @!group API Operations
132
+
133
+ # Adds a statement to a topic's access control policy, granting access
134
+ # for the specified AWS accounts to the specified actions.
135
+ # @option params [required, String] :topic_arn
136
+ # The ARN of the topic whose access control policy you wish to modify.
137
+ # @option params [required, String] :label
138
+ # A unique identifier for the new policy statement.
139
+ # @option params [required, Array<String>] :aws_account_id
140
+ # The AWS account IDs of the users (principals) who will be given access
141
+ # to the specified actions. The users must have AWS accounts, but do not
142
+ # need to be signed up for this service.
143
+ # @option params [required, Array<String>] :action_name
144
+ # The action you want to allow for the specified principal(s).
145
+ #
146
+ # Valid values: any Amazon SNS action name.
147
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
148
+ #
149
+ # @example Request syntax with placeholder values
150
+ # resp = client.add_permission({
151
+ # topic_arn: "topicARN", # required
152
+ # label: "label", # required
153
+ # aws_account_id: ["delegate"], # required
154
+ # action_name: ["action"], # required
155
+ # })
156
+ # @overload add_permission(params = {})
157
+ # @param [Hash] params ({})
158
+ def add_permission(params = {}, options = {})
159
+ req = build_request(:add_permission, params)
160
+ req.send_request(options)
161
+ end
162
+
163
+ # Accepts a phone number and indicates whether the phone holder has
164
+ # opted out of receiving SMS messages from your account. You cannot send
165
+ # SMS messages to a number that is opted out.
166
+ #
167
+ # To resume sending messages, you can opt in the number by using the
168
+ # `OptInPhoneNumber` action.
169
+ # @option params [required, String] :phone_number
170
+ # The phone number for which you want to check the opt out status.
171
+ # @return [Types::CheckIfPhoneNumberIsOptedOutResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
172
+ #
173
+ # * {Types::CheckIfPhoneNumberIsOptedOutResponse#is_opted_out #isOptedOut} => Boolean
174
+ #
175
+ # @example Request syntax with placeholder values
176
+ # resp = client.check_if_phone_number_is_opted_out({
177
+ # phone_number: "PhoneNumber", # required
178
+ # })
179
+ #
180
+ # @example Response structure
181
+ # resp.is_opted_out #=> Boolean
182
+ # @overload check_if_phone_number_is_opted_out(params = {})
183
+ # @param [Hash] params ({})
184
+ def check_if_phone_number_is_opted_out(params = {}, options = {})
185
+ req = build_request(:check_if_phone_number_is_opted_out, params)
186
+ req.send_request(options)
187
+ end
188
+
189
+ # Verifies an endpoint owner's intent to receive messages by validating
190
+ # the token sent to the endpoint by an earlier `Subscribe` action. If
191
+ # the token is valid, the action creates a new subscription and returns
192
+ # its Amazon Resource Name (ARN). This call requires an AWS signature
193
+ # only when the `AuthenticateOnUnsubscribe` flag is set to "true".
194
+ # @option params [required, String] :topic_arn
195
+ # The ARN of the topic for which you wish to confirm a subscription.
196
+ # @option params [required, String] :token
197
+ # Short-lived token sent to an endpoint during the `Subscribe` action.
198
+ # @option params [String] :authenticate_on_unsubscribe
199
+ # Disallows unauthenticated unsubscribes of the subscription. If the
200
+ # value of this parameter is `true` and the request has an AWS
201
+ # signature, then only the topic owner and the subscription owner can
202
+ # unsubscribe the endpoint. The unsubscribe action requires AWS
203
+ # authentication.
204
+ # @return [Types::ConfirmSubscriptionResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
205
+ #
206
+ # * {Types::ConfirmSubscriptionResponse#subscription_arn #SubscriptionArn} => String
207
+ #
208
+ # @example Request syntax with placeholder values
209
+ # resp = client.confirm_subscription({
210
+ # topic_arn: "topicARN", # required
211
+ # token: "token", # required
212
+ # authenticate_on_unsubscribe: "authenticateOnUnsubscribe",
213
+ # })
214
+ #
215
+ # @example Response structure
216
+ # resp.subscription_arn #=> String
217
+ # @overload confirm_subscription(params = {})
218
+ # @param [Hash] params ({})
219
+ def confirm_subscription(params = {}, options = {})
220
+ req = build_request(:confirm_subscription, params)
221
+ req.send_request(options)
222
+ end
223
+
224
+ # Creates a platform application object for one of the supported push
225
+ # notification services, such as APNS and GCM, to which devices and
226
+ # mobile apps may register. You must specify PlatformPrincipal and
227
+ # PlatformCredential attributes when using the
228
+ # `CreatePlatformApplication` action. The PlatformPrincipal is received
229
+ # from the notification service. For APNS/APNS\_SANDBOX,
230
+ # PlatformPrincipal is "SSL certificate". For GCM, PlatformPrincipal
231
+ # is not applicable. For ADM, PlatformPrincipal is "client id". The
232
+ # PlatformCredential is also received from the notification service. For
233
+ # WNS, PlatformPrincipal is "Package Security Identifier". For MPNS,
234
+ # PlatformPrincipal is "TLS certificate". For Baidu, PlatformPrincipal
235
+ # is "API key".
236
+ #
237
+ # For APNS/APNS\_SANDBOX, PlatformCredential is "private key". For
238
+ # GCM, PlatformCredential is "API key". For ADM, PlatformCredential is
239
+ # "client secret". For WNS, PlatformCredential is "secret key". For
240
+ # MPNS, PlatformCredential is "private key". For Baidu,
241
+ # PlatformCredential is "secret key". The PlatformApplicationArn that
242
+ # is returned when using `CreatePlatformApplication` is then used as an
243
+ # attribute for the `CreatePlatformEndpoint` action. For more
244
+ # information, see [Using Amazon SNS Mobile Push Notifications][1]. For
245
+ # more information about obtaining the PlatformPrincipal and
246
+ # PlatformCredential for each of the supported push notification
247
+ # services, see [Getting Started with Apple Push Notification
248
+ # Service][2], [Getting Started with Amazon Device Messaging][3],
249
+ # [Getting Started with Baidu Cloud Push][4], [Getting Started with
250
+ # Google Cloud Messaging for Android][5], [Getting Started with
251
+ # MPNS][6], or [Getting Started with WNS][7].
252
+ #
253
+ #
254
+ #
255
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
256
+ # [2]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html
257
+ # [3]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-adm.html
258
+ # [4]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-baidu.html
259
+ # [5]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html
260
+ # [6]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-mpns.html
261
+ # [7]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-wns.html
262
+ # @option params [required, String] :name
263
+ # Application names must be made up of only uppercase and lowercase
264
+ # ASCII letters, numbers, underscores, hyphens, and periods, and must be
265
+ # between 1 and 256 characters long.
266
+ # @option params [required, String] :platform
267
+ # The following platforms are supported: ADM (Amazon Device Messaging),
268
+ # APNS (Apple Push Notification Service), APNS\_SANDBOX, and GCM (Google
269
+ # Cloud Messaging).
270
+ # @option params [required, Hash<String,String>] :attributes
271
+ # For a list of attributes, see [SetPlatformApplicationAttributes][1]
272
+ #
273
+ #
274
+ #
275
+ # [1]: http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html
276
+ # @return [Types::CreatePlatformApplicationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
277
+ #
278
+ # * {Types::CreatePlatformApplicationResponse#platform_application_arn #PlatformApplicationArn} => String
279
+ #
280
+ # @example Request syntax with placeholder values
281
+ # resp = client.create_platform_application({
282
+ # name: "String", # required
283
+ # platform: "String", # required
284
+ # attributes: { # required
285
+ # "String" => "String",
286
+ # },
287
+ # })
288
+ #
289
+ # @example Response structure
290
+ # resp.platform_application_arn #=> String
291
+ # @overload create_platform_application(params = {})
292
+ # @param [Hash] params ({})
293
+ def create_platform_application(params = {}, options = {})
294
+ req = build_request(:create_platform_application, params)
295
+ req.send_request(options)
296
+ end
297
+
298
+ # Creates an endpoint for a device and mobile app on one of the
299
+ # supported push notification services, such as GCM and APNS.
300
+ # `CreatePlatformEndpoint` requires the PlatformApplicationArn that is
301
+ # returned from `CreatePlatformApplication`. The EndpointArn that is
302
+ # returned when using `CreatePlatformEndpoint` can then be used by the
303
+ # `Publish` action to send a message to a mobile app or by the
304
+ # `Subscribe` action for subscription to a topic. The
305
+ # `CreatePlatformEndpoint` action is idempotent, so if the requester
306
+ # already owns an endpoint with the same device token and attributes,
307
+ # that endpoint's ARN is returned without creating a new endpoint. For
308
+ # more information, see [Using Amazon SNS Mobile Push Notifications][1].
309
+ #
310
+ # When using `CreatePlatformEndpoint` with Baidu, two attributes must be
311
+ # provided: ChannelId and UserId. The token field must also contain the
312
+ # ChannelId. For more information, see [Creating an Amazon SNS Endpoint
313
+ # for Baidu][2].
314
+ #
315
+ #
316
+ #
317
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
318
+ # [2]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePushBaiduEndpoint.html
319
+ # @option params [required, String] :platform_application_arn
320
+ # PlatformApplicationArn returned from CreatePlatformApplication is used
321
+ # to create a an endpoint.
322
+ # @option params [required, String] :token
323
+ # Unique identifier created by the notification service for an app on a
324
+ # device. The specific name for Token will vary, depending on which
325
+ # notification service is being used. For example, when using APNS as
326
+ # the notification service, you need the device token. Alternatively,
327
+ # when using GCM or ADM, the device token equivalent is called the
328
+ # registration ID.
329
+ # @option params [String] :custom_user_data
330
+ # Arbitrary user data to associate with the endpoint. Amazon SNS does
331
+ # not use this data. The data must be in UTF-8 format and less than 2KB.
332
+ # @option params [Hash<String,String>] :attributes
333
+ # For a list of attributes, see [SetEndpointAttributes][1].
334
+ #
335
+ #
336
+ #
337
+ # [1]: http://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html
338
+ # @return [Types::CreateEndpointResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
339
+ #
340
+ # * {Types::CreateEndpointResponse#endpoint_arn #EndpointArn} => String
341
+ #
342
+ # @example Request syntax with placeholder values
343
+ # resp = client.create_platform_endpoint({
344
+ # platform_application_arn: "String", # required
345
+ # token: "String", # required
346
+ # custom_user_data: "String",
347
+ # attributes: {
348
+ # "String" => "String",
349
+ # },
350
+ # })
351
+ #
352
+ # @example Response structure
353
+ # resp.endpoint_arn #=> String
354
+ # @overload create_platform_endpoint(params = {})
355
+ # @param [Hash] params ({})
356
+ def create_platform_endpoint(params = {}, options = {})
357
+ req = build_request(:create_platform_endpoint, params)
358
+ req.send_request(options)
359
+ end
360
+
361
+ # Creates a topic to which notifications can be published. Users can
362
+ # create at most 100,000 topics. For more information, see
363
+ # [http://aws.amazon.com/sns][1]. This action is idempotent, so if the
364
+ # requester already owns a topic with the specified name, that topic's
365
+ # ARN is returned without creating a new topic.
366
+ #
367
+ #
368
+ #
369
+ # [1]: http://aws.amazon.com/sns/
370
+ # @option params [required, String] :name
371
+ # The name of the topic you want to create.
372
+ #
373
+ # Constraints: Topic names must be made up of only uppercase and
374
+ # lowercase ASCII letters, numbers, underscores, and hyphens, and must
375
+ # be between 1 and 256 characters long.
376
+ # @return [Types::CreateTopicResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
377
+ #
378
+ # * {Types::CreateTopicResponse#topic_arn #TopicArn} => String
379
+ #
380
+ # @example Request syntax with placeholder values
381
+ # resp = client.create_topic({
382
+ # name: "topicName", # required
383
+ # })
384
+ #
385
+ # @example Response structure
386
+ # resp.topic_arn #=> String
387
+ # @overload create_topic(params = {})
388
+ # @param [Hash] params ({})
389
+ def create_topic(params = {}, options = {})
390
+ req = build_request(:create_topic, params)
391
+ req.send_request(options)
392
+ end
393
+
394
+ # Deletes the endpoint for a device and mobile app from Amazon SNS. This
395
+ # action is idempotent. For more information, see [Using Amazon SNS
396
+ # Mobile Push Notifications][1].
397
+ #
398
+ # When you delete an endpoint that is also subscribed to a topic, then
399
+ # you must also unsubscribe the endpoint from the topic.
400
+ #
401
+ #
402
+ #
403
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
404
+ # @option params [required, String] :endpoint_arn
405
+ # EndpointArn of endpoint to delete.
406
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
407
+ #
408
+ # @example Request syntax with placeholder values
409
+ # resp = client.delete_endpoint({
410
+ # endpoint_arn: "String", # required
411
+ # })
412
+ # @overload delete_endpoint(params = {})
413
+ # @param [Hash] params ({})
414
+ def delete_endpoint(params = {}, options = {})
415
+ req = build_request(:delete_endpoint, params)
416
+ req.send_request(options)
417
+ end
418
+
419
+ # Deletes a platform application object for one of the supported push
420
+ # notification services, such as APNS and GCM. For more information, see
421
+ # [Using Amazon SNS Mobile Push Notifications][1].
422
+ #
423
+ #
424
+ #
425
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
426
+ # @option params [required, String] :platform_application_arn
427
+ # PlatformApplicationArn of platform application object to delete.
428
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
429
+ #
430
+ # @example Request syntax with placeholder values
431
+ # resp = client.delete_platform_application({
432
+ # platform_application_arn: "String", # required
433
+ # })
434
+ # @overload delete_platform_application(params = {})
435
+ # @param [Hash] params ({})
436
+ def delete_platform_application(params = {}, options = {})
437
+ req = build_request(:delete_platform_application, params)
438
+ req.send_request(options)
439
+ end
440
+
441
+ # Deletes a topic and all its subscriptions. Deleting a topic might
442
+ # prevent some messages previously sent to the topic from being
443
+ # delivered to subscribers. This action is idempotent, so deleting a
444
+ # topic that does not exist does not result in an error.
445
+ # @option params [required, String] :topic_arn
446
+ # The ARN of the topic you want to delete.
447
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
448
+ #
449
+ # @example Request syntax with placeholder values
450
+ # resp = client.delete_topic({
451
+ # topic_arn: "topicARN", # required
452
+ # })
453
+ # @overload delete_topic(params = {})
454
+ # @param [Hash] params ({})
455
+ def delete_topic(params = {}, options = {})
456
+ req = build_request(:delete_topic, params)
457
+ req.send_request(options)
458
+ end
459
+
460
+ # Retrieves the endpoint attributes for a device on one of the supported
461
+ # push notification services, such as GCM and APNS. For more
462
+ # information, see [Using Amazon SNS Mobile Push Notifications][1].
463
+ #
464
+ #
465
+ #
466
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
467
+ # @option params [required, String] :endpoint_arn
468
+ # EndpointArn for GetEndpointAttributes input.
469
+ # @return [Types::GetEndpointAttributesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
470
+ #
471
+ # * {Types::GetEndpointAttributesResponse#attributes #Attributes} => Hash&lt;String,String&gt;
472
+ #
473
+ # @example Request syntax with placeholder values
474
+ # resp = client.get_endpoint_attributes({
475
+ # endpoint_arn: "String", # required
476
+ # })
477
+ #
478
+ # @example Response structure
479
+ # resp.attributes #=> Hash
480
+ # resp.attributes["String"] #=> String
481
+ # @overload get_endpoint_attributes(params = {})
482
+ # @param [Hash] params ({})
483
+ def get_endpoint_attributes(params = {}, options = {})
484
+ req = build_request(:get_endpoint_attributes, params)
485
+ req.send_request(options)
486
+ end
487
+
488
+ # Retrieves the attributes of the platform application object for the
489
+ # supported push notification services, such as APNS and GCM. For more
490
+ # information, see [Using Amazon SNS Mobile Push Notifications][1].
491
+ #
492
+ #
493
+ #
494
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
495
+ # @option params [required, String] :platform_application_arn
496
+ # PlatformApplicationArn for GetPlatformApplicationAttributesInput.
497
+ # @return [Types::GetPlatformApplicationAttributesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
498
+ #
499
+ # * {Types::GetPlatformApplicationAttributesResponse#attributes #Attributes} => Hash&lt;String,String&gt;
500
+ #
501
+ # @example Request syntax with placeholder values
502
+ # resp = client.get_platform_application_attributes({
503
+ # platform_application_arn: "String", # required
504
+ # })
505
+ #
506
+ # @example Response structure
507
+ # resp.attributes #=> Hash
508
+ # resp.attributes["String"] #=> String
509
+ # @overload get_platform_application_attributes(params = {})
510
+ # @param [Hash] params ({})
511
+ def get_platform_application_attributes(params = {}, options = {})
512
+ req = build_request(:get_platform_application_attributes, params)
513
+ req.send_request(options)
514
+ end
515
+
516
+ # Returns the settings for sending SMS messages from your account.
517
+ #
518
+ # These settings are set with the `SetSMSAttributes` action.
519
+ # @option params [Array<String>] :attributes
520
+ # A list of the individual attribute names, such as `MonthlySpendLimit`,
521
+ # for which you want values.
522
+ #
523
+ # For all attribute names, see [SetSMSAttributes][1].
524
+ #
525
+ # If you don't use this parameter, Amazon SNS returns all SMS
526
+ # attributes.
527
+ #
528
+ #
529
+ #
530
+ # [1]: http://docs.aws.amazon.com/sns/latest/api/API_SetSMSAttributes.html
531
+ # @return [Types::GetSMSAttributesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
532
+ #
533
+ # * {Types::GetSMSAttributesResponse#attributes #attributes} => Hash&lt;String,String&gt;
534
+ #
535
+ # @example Request syntax with placeholder values
536
+ # resp = client.get_sms_attributes({
537
+ # attributes: ["String"],
538
+ # })
539
+ #
540
+ # @example Response structure
541
+ # resp.attributes #=> Hash
542
+ # resp.attributes["String"] #=> String
543
+ # @overload get_sms_attributes(params = {})
544
+ # @param [Hash] params ({})
545
+ def get_sms_attributes(params = {}, options = {})
546
+ req = build_request(:get_sms_attributes, params)
547
+ req.send_request(options)
548
+ end
549
+
550
+ # Returns all of the properties of a subscription.
551
+ # @option params [required, String] :subscription_arn
552
+ # The ARN of the subscription whose properties you want to get.
553
+ # @return [Types::GetSubscriptionAttributesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
554
+ #
555
+ # * {Types::GetSubscriptionAttributesResponse#attributes #Attributes} => Hash&lt;String,String&gt;
556
+ #
557
+ # @example Request syntax with placeholder values
558
+ # resp = client.get_subscription_attributes({
559
+ # subscription_arn: "subscriptionARN", # required
560
+ # })
561
+ #
562
+ # @example Response structure
563
+ # resp.attributes #=> Hash
564
+ # resp.attributes["attributeName"] #=> String
565
+ # @overload get_subscription_attributes(params = {})
566
+ # @param [Hash] params ({})
567
+ def get_subscription_attributes(params = {}, options = {})
568
+ req = build_request(:get_subscription_attributes, params)
569
+ req.send_request(options)
570
+ end
571
+
572
+ # Returns all of the properties of a topic. Topic properties returned
573
+ # might differ based on the authorization of the user.
574
+ # @option params [required, String] :topic_arn
575
+ # The ARN of the topic whose properties you want to get.
576
+ # @return [Types::GetTopicAttributesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
577
+ #
578
+ # * {Types::GetTopicAttributesResponse#attributes #Attributes} => Hash&lt;String,String&gt;
579
+ #
580
+ # @example Request syntax with placeholder values
581
+ # resp = client.get_topic_attributes({
582
+ # topic_arn: "topicARN", # required
583
+ # })
584
+ #
585
+ # @example Response structure
586
+ # resp.attributes #=> Hash
587
+ # resp.attributes["attributeName"] #=> String
588
+ # @overload get_topic_attributes(params = {})
589
+ # @param [Hash] params ({})
590
+ def get_topic_attributes(params = {}, options = {})
591
+ req = build_request(:get_topic_attributes, params)
592
+ req.send_request(options)
593
+ end
594
+
595
+ # Lists the endpoints and endpoint attributes for devices in a supported
596
+ # push notification service, such as GCM and APNS. The results for
597
+ # `ListEndpointsByPlatformApplication` are paginated and return a
598
+ # limited list of endpoints, up to 100. If additional records are
599
+ # available after the first page results, then a NextToken string will
600
+ # be returned. To receive the next page, you call
601
+ # `ListEndpointsByPlatformApplication` again using the NextToken string
602
+ # received from the previous call. When there are no more records to
603
+ # return, NextToken will be null. For more information, see [Using
604
+ # Amazon SNS Mobile Push Notifications][1].
605
+ #
606
+ #
607
+ #
608
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
609
+ # @option params [required, String] :platform_application_arn
610
+ # PlatformApplicationArn for ListEndpointsByPlatformApplicationInput
611
+ # action.
612
+ # @option params [String] :next_token
613
+ # NextToken string is used when calling
614
+ # ListEndpointsByPlatformApplication action to retrieve additional
615
+ # records that are available after the first page results.
616
+ # @return [Types::ListEndpointsByPlatformApplicationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
617
+ #
618
+ # * {Types::ListEndpointsByPlatformApplicationResponse#endpoints #Endpoints} => Array&lt;Types::Endpoint&gt;
619
+ # * {Types::ListEndpointsByPlatformApplicationResponse#next_token #NextToken} => String
620
+ #
621
+ # @example Request syntax with placeholder values
622
+ # resp = client.list_endpoints_by_platform_application({
623
+ # platform_application_arn: "String", # required
624
+ # next_token: "String",
625
+ # })
626
+ #
627
+ # @example Response structure
628
+ # resp.endpoints #=> Array
629
+ # resp.endpoints[0].endpoint_arn #=> String
630
+ # resp.endpoints[0].attributes #=> Hash
631
+ # resp.endpoints[0].attributes["String"] #=> String
632
+ # resp.next_token #=> String
633
+ # @overload list_endpoints_by_platform_application(params = {})
634
+ # @param [Hash] params ({})
635
+ def list_endpoints_by_platform_application(params = {}, options = {})
636
+ req = build_request(:list_endpoints_by_platform_application, params)
637
+ req.send_request(options)
638
+ end
639
+
640
+ # Returns a list of phone numbers that are opted out, meaning you cannot
641
+ # send SMS messages to them.
642
+ #
643
+ # The results for `ListPhoneNumbersOptedOut` are paginated, and each
644
+ # page returns up to 100 phone numbers. If additional phone numbers are
645
+ # available after the first page of results, then a `NextToken` string
646
+ # will be returned. To receive the next page, you call
647
+ # `ListPhoneNumbersOptedOut` again using the `NextToken` string received
648
+ # from the previous call. When there are no more records to return,
649
+ # `NextToken` will be null.
650
+ # @option params [String] :next_token
651
+ # A `NextToken` string is used when you call the
652
+ # `ListPhoneNumbersOptedOut` action to retrieve additional records that
653
+ # are available after the first page of results.
654
+ # @return [Types::ListPhoneNumbersOptedOutResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
655
+ #
656
+ # * {Types::ListPhoneNumbersOptedOutResponse#phone_numbers #phoneNumbers} => Array&lt;String&gt;
657
+ # * {Types::ListPhoneNumbersOptedOutResponse#next_token #nextToken} => String
658
+ #
659
+ # @example Request syntax with placeholder values
660
+ # resp = client.list_phone_numbers_opted_out({
661
+ # next_token: "string",
662
+ # })
663
+ #
664
+ # @example Response structure
665
+ # resp.phone_numbers #=> Array
666
+ # resp.phone_numbers[0] #=> String
667
+ # resp.next_token #=> String
668
+ # @overload list_phone_numbers_opted_out(params = {})
669
+ # @param [Hash] params ({})
670
+ def list_phone_numbers_opted_out(params = {}, options = {})
671
+ req = build_request(:list_phone_numbers_opted_out, params)
672
+ req.send_request(options)
673
+ end
674
+
675
+ # Lists the platform application objects for the supported push
676
+ # notification services, such as APNS and GCM. The results for
677
+ # `ListPlatformApplications` are paginated and return a limited list of
678
+ # applications, up to 100. If additional records are available after the
679
+ # first page results, then a NextToken string will be returned. To
680
+ # receive the next page, you call `ListPlatformApplications` using the
681
+ # NextToken string received from the previous call. When there are no
682
+ # more records to return, NextToken will be null. For more information,
683
+ # see [Using Amazon SNS Mobile Push Notifications][1].
684
+ #
685
+ #
686
+ #
687
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
688
+ # @option params [String] :next_token
689
+ # NextToken string is used when calling ListPlatformApplications action
690
+ # to retrieve additional records that are available after the first page
691
+ # results.
692
+ # @return [Types::ListPlatformApplicationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
693
+ #
694
+ # * {Types::ListPlatformApplicationsResponse#platform_applications #PlatformApplications} => Array&lt;Types::PlatformApplication&gt;
695
+ # * {Types::ListPlatformApplicationsResponse#next_token #NextToken} => String
696
+ #
697
+ # @example Request syntax with placeholder values
698
+ # resp = client.list_platform_applications({
699
+ # next_token: "String",
700
+ # })
701
+ #
702
+ # @example Response structure
703
+ # resp.platform_applications #=> Array
704
+ # resp.platform_applications[0].platform_application_arn #=> String
705
+ # resp.platform_applications[0].attributes #=> Hash
706
+ # resp.platform_applications[0].attributes["String"] #=> String
707
+ # resp.next_token #=> String
708
+ # @overload list_platform_applications(params = {})
709
+ # @param [Hash] params ({})
710
+ def list_platform_applications(params = {}, options = {})
711
+ req = build_request(:list_platform_applications, params)
712
+ req.send_request(options)
713
+ end
714
+
715
+ # Returns a list of the requester's subscriptions. Each call returns a
716
+ # limited list of subscriptions, up to 100. If there are more
717
+ # subscriptions, a `NextToken` is also returned. Use the `NextToken`
718
+ # parameter in a new `ListSubscriptions` call to get further results.
719
+ # @option params [String] :next_token
720
+ # Token returned by the previous `ListSubscriptions` request.
721
+ # @return [Types::ListSubscriptionsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
722
+ #
723
+ # * {Types::ListSubscriptionsResponse#subscriptions #Subscriptions} => Array&lt;Types::Subscription&gt;
724
+ # * {Types::ListSubscriptionsResponse#next_token #NextToken} => String
725
+ #
726
+ # @example Request syntax with placeholder values
727
+ # resp = client.list_subscriptions({
728
+ # next_token: "nextToken",
729
+ # })
730
+ #
731
+ # @example Response structure
732
+ # resp.subscriptions #=> Array
733
+ # resp.subscriptions[0].subscription_arn #=> String
734
+ # resp.subscriptions[0].owner #=> String
735
+ # resp.subscriptions[0].protocol #=> String
736
+ # resp.subscriptions[0].endpoint #=> String
737
+ # resp.subscriptions[0].topic_arn #=> String
738
+ # resp.next_token #=> String
739
+ # @overload list_subscriptions(params = {})
740
+ # @param [Hash] params ({})
741
+ def list_subscriptions(params = {}, options = {})
742
+ req = build_request(:list_subscriptions, params)
743
+ req.send_request(options)
744
+ end
745
+
746
+ # Returns a list of the subscriptions to a specific topic. Each call
747
+ # returns a limited list of subscriptions, up to 100. If there are more
748
+ # subscriptions, a `NextToken` is also returned. Use the `NextToken`
749
+ # parameter in a new `ListSubscriptionsByTopic` call to get further
750
+ # results.
751
+ # @option params [required, String] :topic_arn
752
+ # The ARN of the topic for which you wish to find subscriptions.
753
+ # @option params [String] :next_token
754
+ # Token returned by the previous `ListSubscriptionsByTopic` request.
755
+ # @return [Types::ListSubscriptionsByTopicResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
756
+ #
757
+ # * {Types::ListSubscriptionsByTopicResponse#subscriptions #Subscriptions} => Array&lt;Types::Subscription&gt;
758
+ # * {Types::ListSubscriptionsByTopicResponse#next_token #NextToken} => String
759
+ #
760
+ # @example Request syntax with placeholder values
761
+ # resp = client.list_subscriptions_by_topic({
762
+ # topic_arn: "topicARN", # required
763
+ # next_token: "nextToken",
764
+ # })
765
+ #
766
+ # @example Response structure
767
+ # resp.subscriptions #=> Array
768
+ # resp.subscriptions[0].subscription_arn #=> String
769
+ # resp.subscriptions[0].owner #=> String
770
+ # resp.subscriptions[0].protocol #=> String
771
+ # resp.subscriptions[0].endpoint #=> String
772
+ # resp.subscriptions[0].topic_arn #=> String
773
+ # resp.next_token #=> String
774
+ # @overload list_subscriptions_by_topic(params = {})
775
+ # @param [Hash] params ({})
776
+ def list_subscriptions_by_topic(params = {}, options = {})
777
+ req = build_request(:list_subscriptions_by_topic, params)
778
+ req.send_request(options)
779
+ end
780
+
781
+ # Returns a list of the requester's topics. Each call returns a limited
782
+ # list of topics, up to 100. If there are more topics, a `NextToken` is
783
+ # also returned. Use the `NextToken` parameter in a new `ListTopics`
784
+ # call to get further results.
785
+ # @option params [String] :next_token
786
+ # Token returned by the previous `ListTopics` request.
787
+ # @return [Types::ListTopicsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
788
+ #
789
+ # * {Types::ListTopicsResponse#topics #Topics} => Array&lt;Types::Topic&gt;
790
+ # * {Types::ListTopicsResponse#next_token #NextToken} => String
791
+ #
792
+ # @example Request syntax with placeholder values
793
+ # resp = client.list_topics({
794
+ # next_token: "nextToken",
795
+ # })
796
+ #
797
+ # @example Response structure
798
+ # resp.topics #=> Array
799
+ # resp.topics[0].topic_arn #=> String
800
+ # resp.next_token #=> String
801
+ # @overload list_topics(params = {})
802
+ # @param [Hash] params ({})
803
+ def list_topics(params = {}, options = {})
804
+ req = build_request(:list_topics, params)
805
+ req.send_request(options)
806
+ end
807
+
808
+ # Use this request to opt in a phone number that is opted out, which
809
+ # enables you to resume sending SMS messages to the number.
810
+ #
811
+ # You can opt in a phone number only once every 30 days.
812
+ # @option params [required, String] :phone_number
813
+ # The phone number to opt in.
814
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
815
+ #
816
+ # @example Request syntax with placeholder values
817
+ # resp = client.opt_in_phone_number({
818
+ # phone_number: "PhoneNumber", # required
819
+ # })
820
+ # @overload opt_in_phone_number(params = {})
821
+ # @param [Hash] params ({})
822
+ def opt_in_phone_number(params = {}, options = {})
823
+ req = build_request(:opt_in_phone_number, params)
824
+ req.send_request(options)
825
+ end
826
+
827
+ # Sends a message to all of a topic's subscribed endpoints. When a
828
+ # `messageId` is returned, the message has been saved and Amazon SNS
829
+ # will attempt to deliver it to the topic's subscribers shortly. The
830
+ # format of the outgoing message to each subscribed endpoint depends on
831
+ # the notification protocol.
832
+ #
833
+ # To use the `Publish` action for sending a message to a mobile
834
+ # endpoint, such as an app on a Kindle device or mobile phone, you must
835
+ # specify the EndpointArn for the TargetArn parameter. The EndpointArn
836
+ # is returned when making a call with the `CreatePlatformEndpoint`
837
+ # action.
838
+ #
839
+ # For more information about formatting messages, see [Send Custom
840
+ # Platform-Specific Payloads in Messages to Mobile Devices][1].
841
+ #
842
+ #
843
+ #
844
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html
845
+ # @option params [String] :topic_arn
846
+ # The topic you want to publish to.
847
+ #
848
+ # If you don't specify a value for the `TopicArn` parameter, you must
849
+ # specify a value for the `PhoneNumber` or `TargetArn` parameters.
850
+ # @option params [String] :target_arn
851
+ # Either TopicArn or EndpointArn, but not both.
852
+ #
853
+ # If you don't specify a value for the `TargetArn` parameter, you must
854
+ # specify a value for the `PhoneNumber` or `TopicArn` parameters.
855
+ # @option params [String] :phone_number
856
+ # The phone number to which you want to deliver an SMS message. Use
857
+ # E.164 format.
858
+ #
859
+ # If you don't specify a value for the `PhoneNumber` parameter, you
860
+ # must specify a value for the `TargetArn` or `TopicArn` parameters.
861
+ # @option params [required, String] :message
862
+ # The message you want to send to the topic.
863
+ #
864
+ # If you want to send the same message to all transport protocols,
865
+ # include the text of the message as a String value.
866
+ #
867
+ # If you want to send different messages for each transport protocol,
868
+ # set the value of the `MessageStructure` parameter to `json` and use a
869
+ # JSON object for the `Message` parameter.
870
+ #
871
+ # Constraints: Messages must be UTF-8 encoded strings at most 256 KB in
872
+ # size (262144 bytes, not 262144 characters).
873
+ #
874
+ # JSON-specific constraints:
875
+ #
876
+ # * Keys in the JSON object that correspond to supported transport
877
+ # protocols must have simple JSON string values.
878
+ #
879
+ # * The values will be parsed (unescaped) before they are used in
880
+ # outgoing messages.
881
+ #
882
+ # * Outbound notifications are JSON encoded (meaning that the characters
883
+ # will be reescaped for sending).
884
+ #
885
+ # * Values have a minimum length of 0 (the empty string, "", is
886
+ # allowed).
887
+ #
888
+ # * Values have a maximum length bounded by the overall message size
889
+ # (so, including multiple protocols may limit message sizes).
890
+ #
891
+ # * Non-string values will cause the key to be ignored.
892
+ #
893
+ # * Keys that do not correspond to supported transport protocols are
894
+ # ignored.
895
+ #
896
+ # * Duplicate keys are not allowed.
897
+ #
898
+ # * Failure to parse or validate any key or value in the message will
899
+ # cause the `Publish` call to return an error (no partial delivery).
900
+ # @option params [String] :subject
901
+ # Optional parameter to be used as the "Subject" line when the message
902
+ # is delivered to email endpoints. This field will also be included, if
903
+ # present, in the standard JSON messages delivered to other endpoints.
904
+ #
905
+ # Constraints: Subjects must be ASCII text that begins with a letter,
906
+ # number, or punctuation mark; must not include line breaks or control
907
+ # characters; and must be less than 100 characters long.
908
+ # @option params [String] :message_structure
909
+ # Set `MessageStructure` to `json` if you want to send a different
910
+ # message for each protocol. For example, using one publish action, you
911
+ # can send a short message to your SMS subscribers and a longer message
912
+ # to your email subscribers. If you set `MessageStructure` to `json`,
913
+ # the value of the `Message` parameter must:
914
+ #
915
+ # * be a syntactically valid JSON object; and
916
+ #
917
+ # * contain at least a top-level JSON key of "default" with a value
918
+ # that is a string.
919
+ #
920
+ # You can define other top-level keys that define the message you want
921
+ # to send to a specific transport protocol (e.g., "http").
922
+ #
923
+ # For information about sending different messages for each protocol
924
+ # using the AWS Management Console, go to [Create Different Messages for
925
+ # Each Protocol][1] in the *Amazon Simple Notification Service Getting
926
+ # Started Guide*.
927
+ #
928
+ # Valid value: `json`
929
+ #
930
+ #
931
+ #
932
+ # [1]: http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol
933
+ # @option params [Hash<String,Types::MessageAttributeValue>] :message_attributes
934
+ # Message attributes for Publish action.
935
+ # @return [Types::PublishResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
936
+ #
937
+ # * {Types::PublishResponse#message_id #MessageId} => String
938
+ #
939
+ # @example Request syntax with placeholder values
940
+ # resp = client.publish({
941
+ # topic_arn: "topicARN",
942
+ # target_arn: "String",
943
+ # phone_number: "String",
944
+ # message: "message", # required
945
+ # subject: "subject",
946
+ # message_structure: "messageStructure",
947
+ # message_attributes: {
948
+ # "String" => {
949
+ # data_type: "String", # required
950
+ # string_value: "String",
951
+ # binary_value: "data",
952
+ # },
953
+ # },
954
+ # })
955
+ #
956
+ # @example Response structure
957
+ # resp.message_id #=> String
958
+ # @overload publish(params = {})
959
+ # @param [Hash] params ({})
960
+ def publish(params = {}, options = {})
961
+ req = build_request(:publish, params)
962
+ req.send_request(options)
963
+ end
964
+
965
+ # Removes a statement from a topic's access control policy.
966
+ # @option params [required, String] :topic_arn
967
+ # The ARN of the topic whose access control policy you wish to modify.
968
+ # @option params [required, String] :label
969
+ # The unique label of the statement you want to remove.
970
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
971
+ #
972
+ # @example Request syntax with placeholder values
973
+ # resp = client.remove_permission({
974
+ # topic_arn: "topicARN", # required
975
+ # label: "label", # required
976
+ # })
977
+ # @overload remove_permission(params = {})
978
+ # @param [Hash] params ({})
979
+ def remove_permission(params = {}, options = {})
980
+ req = build_request(:remove_permission, params)
981
+ req.send_request(options)
982
+ end
983
+
984
+ # Sets the attributes for an endpoint for a device on one of the
985
+ # supported push notification services, such as GCM and APNS. For more
986
+ # information, see [Using Amazon SNS Mobile Push Notifications][1].
987
+ #
988
+ #
989
+ #
990
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
991
+ # @option params [required, String] :endpoint_arn
992
+ # EndpointArn used for SetEndpointAttributes action.
993
+ # @option params [required, Hash<String,String>] :attributes
994
+ # A map of the endpoint attributes. Attributes in this map include the
995
+ # following:
996
+ #
997
+ # * `CustomUserData` -- arbitrary user data to associate with the
998
+ # endpoint. Amazon SNS does not use this data. The data must be in
999
+ # UTF-8 format and less than 2KB.
1000
+ #
1001
+ # * `Enabled` -- flag that enables/disables delivery to the endpoint.
1002
+ # Amazon SNS will set this to false when a notification service
1003
+ # indicates to Amazon SNS that the endpoint is invalid. Users can set
1004
+ # it back to true, typically after updating Token.
1005
+ #
1006
+ # * `Token` -- device token, also referred to as a registration id, for
1007
+ # an app and mobile device. This is returned from the notification
1008
+ # service when an app and mobile device are registered with the
1009
+ # notification service.
1010
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1011
+ #
1012
+ # @example Request syntax with placeholder values
1013
+ # resp = client.set_endpoint_attributes({
1014
+ # endpoint_arn: "String", # required
1015
+ # attributes: { # required
1016
+ # "String" => "String",
1017
+ # },
1018
+ # })
1019
+ # @overload set_endpoint_attributes(params = {})
1020
+ # @param [Hash] params ({})
1021
+ def set_endpoint_attributes(params = {}, options = {})
1022
+ req = build_request(:set_endpoint_attributes, params)
1023
+ req.send_request(options)
1024
+ end
1025
+
1026
+ # Sets the attributes of the platform application object for the
1027
+ # supported push notification services, such as APNS and GCM. For more
1028
+ # information, see [Using Amazon SNS Mobile Push Notifications][1]. For
1029
+ # information on configuring attributes for message delivery status, see
1030
+ # [Using Amazon SNS Application Attributes for Message Delivery
1031
+ # Status][2].
1032
+ #
1033
+ #
1034
+ #
1035
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html
1036
+ # [2]: http://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html
1037
+ # @option params [required, String] :platform_application_arn
1038
+ # PlatformApplicationArn for SetPlatformApplicationAttributes action.
1039
+ # @option params [required, Hash<String,String>] :attributes
1040
+ # A map of the platform application attributes. Attributes in this map
1041
+ # include the following:
1042
+ #
1043
+ # * `PlatformCredential` -- The credential received from the
1044
+ # notification service. For APNS/APNS\_SANDBOX, PlatformCredential is
1045
+ # private key. For GCM, PlatformCredential is "API key". For ADM,
1046
+ # PlatformCredential is "client secret".
1047
+ #
1048
+ # * `PlatformPrincipal` -- The principal received from the notification
1049
+ # service. For APNS/APNS\_SANDBOX, PlatformPrincipal is SSL
1050
+ # certificate. For GCM, PlatformPrincipal is not applicable. For ADM,
1051
+ # PlatformPrincipal is "client id".
1052
+ #
1053
+ # * `EventEndpointCreated` -- Topic ARN to which EndpointCreated event
1054
+ # notifications should be sent.
1055
+ #
1056
+ # * `EventEndpointDeleted` -- Topic ARN to which EndpointDeleted event
1057
+ # notifications should be sent.
1058
+ #
1059
+ # * `EventEndpointUpdated` -- Topic ARN to which EndpointUpdate event
1060
+ # notifications should be sent.
1061
+ #
1062
+ # * `EventDeliveryFailure` -- Topic ARN to which DeliveryFailure event
1063
+ # notifications should be sent upon Direct Publish delivery failure
1064
+ # (permanent) to one of the application's endpoints.
1065
+ #
1066
+ # * `SuccessFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS
1067
+ # write access to use CloudWatch Logs on your behalf.
1068
+ #
1069
+ # * `FailureFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS
1070
+ # write access to use CloudWatch Logs on your behalf.
1071
+ #
1072
+ # * `SuccessFeedbackSampleRate` -- Sample rate percentage (0-100) of
1073
+ # successfully delivered messages.
1074
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1075
+ #
1076
+ # @example Request syntax with placeholder values
1077
+ # resp = client.set_platform_application_attributes({
1078
+ # platform_application_arn: "String", # required
1079
+ # attributes: { # required
1080
+ # "String" => "String",
1081
+ # },
1082
+ # })
1083
+ # @overload set_platform_application_attributes(params = {})
1084
+ # @param [Hash] params ({})
1085
+ def set_platform_application_attributes(params = {}, options = {})
1086
+ req = build_request(:set_platform_application_attributes, params)
1087
+ req.send_request(options)
1088
+ end
1089
+
1090
+ # Use this request to set the default settings for sending SMS messages
1091
+ # and receiving daily SMS usage reports.
1092
+ #
1093
+ # You can override some of these settings for a single message when you
1094
+ # use the `Publish` action with the `MessageAttributes.entry.N`
1095
+ # parameter. For more information, see [Sending an SMS Message][1] in
1096
+ # the *Amazon SNS Developer Guide*.
1097
+ #
1098
+ #
1099
+ #
1100
+ # [1]: http://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html
1101
+ # @option params [required, Hash<String,String>] :attributes
1102
+ # The default settings for sending SMS messages from your account. You
1103
+ # can set values for the following attribute names:
1104
+ #
1105
+ # `MonthlySpendLimit` – The maximum amount in USD that you are willing
1106
+ # to spend each month to send SMS messages. When Amazon SNS determines
1107
+ # that sending an SMS message would incur a cost that exceeds this
1108
+ # limit, it stops sending SMS messages within minutes.
1109
+ #
1110
+ # Amazon SNS stops sending SMS messages within minutes of the limit
1111
+ # being crossed. During that interval, if you continue to send SMS
1112
+ # messages, you will incur costs that exceed your limit.
1113
+ #
1114
+ # By default, the spend limit is set to the maximum allowed by Amazon
1115
+ # SNS. If you want to exceed the maximum, contact [AWS Support][1] or
1116
+ # your AWS sales representative for a service limit increase.
1117
+ #
1118
+ # `DeliveryStatusIAMRole` – The ARN of the IAM role that allows Amazon
1119
+ # SNS to write logs about SMS deliveries in CloudWatch Logs. For each
1120
+ # SMS message that you send, Amazon SNS writes a log that includes the
1121
+ # message price, the success or failure status, the reason for failure
1122
+ # (if the message failed), the message dwell time, and other
1123
+ # information.
1124
+ #
1125
+ # `DeliveryStatusSuccessSamplingRate` – The percentage of successful SMS
1126
+ # deliveries for which Amazon SNS will write logs in CloudWatch Logs.
1127
+ # The value can be an integer from 0 - 100. For example, to write logs
1128
+ # only for failed deliveries, set this value to `0`. To write logs for
1129
+ # 10% of your successful deliveries, set it to `10`.
1130
+ #
1131
+ # `DefaultSenderID` – A string, such as your business brand, that is
1132
+ # displayed as the sender on the receiving device. Support for sender
1133
+ # IDs varies by country. The sender ID can be 1 - 11 alphanumeric
1134
+ # characters, and it must contain at least one letter.
1135
+ #
1136
+ # `DefaultSMSType` – The type of SMS message that you will send by
1137
+ # default. You can assign the following values:
1138
+ #
1139
+ # * `Promotional` – (Default) Noncritical messages, such as marketing
1140
+ # messages. Amazon SNS optimizes the message delivery to incur the
1141
+ # lowest cost.
1142
+ #
1143
+ # * `Transactional` – Critical messages that support customer
1144
+ # transactions, such as one-time passcodes for multi-factor
1145
+ # authentication. Amazon SNS optimizes the message delivery to achieve
1146
+ # the highest reliability.
1147
+ #
1148
+ # `UsageReportS3Bucket` – The name of the Amazon S3 bucket to receive
1149
+ # daily SMS usage reports from Amazon SNS. Each day, Amazon SNS will
1150
+ # deliver a usage report as a CSV file to the bucket. The report
1151
+ # includes the following information for each SMS message that was
1152
+ # successfully delivered by your account:
1153
+ #
1154
+ # * Time that the message was published (in UTC)
1155
+ #
1156
+ # * Message ID
1157
+ #
1158
+ # * Destination phone number
1159
+ #
1160
+ # * Message type
1161
+ #
1162
+ # * Delivery status
1163
+ #
1164
+ # * Message price (in USD)
1165
+ #
1166
+ # * Part number (a message is split into multiple parts if it is too
1167
+ # long for a single message)
1168
+ #
1169
+ # * Total number of parts
1170
+ #
1171
+ # To receive the report, the bucket must have a policy that allows the
1172
+ # Amazon SNS service principle to perform the `s3:PutObject` and
1173
+ # `s3:GetBucketLocation` actions.
1174
+ #
1175
+ # For an example bucket policy and usage report, see [Monitoring SMS
1176
+ # Activity][2] in the *Amazon SNS Developer Guide*.
1177
+ #
1178
+ #
1179
+ #
1180
+ # [1]: https://aws.amazon.com/premiumsupport/
1181
+ # [2]: http://docs.aws.amazon.com/sns/latest/dg/sms_stats.html
1182
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1183
+ #
1184
+ # @example Request syntax with placeholder values
1185
+ # resp = client.set_sms_attributes({
1186
+ # attributes: { # required
1187
+ # "String" => "String",
1188
+ # },
1189
+ # })
1190
+ # @overload set_sms_attributes(params = {})
1191
+ # @param [Hash] params ({})
1192
+ def set_sms_attributes(params = {}, options = {})
1193
+ req = build_request(:set_sms_attributes, params)
1194
+ req.send_request(options)
1195
+ end
1196
+
1197
+ # Allows a subscription owner to set an attribute of the topic to a new
1198
+ # value.
1199
+ # @option params [required, String] :subscription_arn
1200
+ # The ARN of the subscription to modify.
1201
+ # @option params [required, String] :attribute_name
1202
+ # The name of the attribute you want to set. Only a subset of the
1203
+ # subscriptions attributes are mutable.
1204
+ #
1205
+ # Valid values: `DeliveryPolicy` \| `RawMessageDelivery`
1206
+ # @option params [String] :attribute_value
1207
+ # The new value for the attribute in JSON format.
1208
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1209
+ #
1210
+ # @example Request syntax with placeholder values
1211
+ # resp = client.set_subscription_attributes({
1212
+ # subscription_arn: "subscriptionARN", # required
1213
+ # attribute_name: "attributeName", # required
1214
+ # attribute_value: "attributeValue",
1215
+ # })
1216
+ # @overload set_subscription_attributes(params = {})
1217
+ # @param [Hash] params ({})
1218
+ def set_subscription_attributes(params = {}, options = {})
1219
+ req = build_request(:set_subscription_attributes, params)
1220
+ req.send_request(options)
1221
+ end
1222
+
1223
+ # Allows a topic owner to set an attribute of the topic to a new value.
1224
+ # @option params [required, String] :topic_arn
1225
+ # The ARN of the topic to modify.
1226
+ # @option params [required, String] :attribute_name
1227
+ # The name of the attribute you want to set. Only a subset of the
1228
+ # topic's attributes are mutable.
1229
+ #
1230
+ # Valid values: `Policy` \| `DisplayName` \| `DeliveryPolicy`
1231
+ # @option params [String] :attribute_value
1232
+ # The new value for the attribute.
1233
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1234
+ #
1235
+ # @example Request syntax with placeholder values
1236
+ # resp = client.set_topic_attributes({
1237
+ # topic_arn: "topicARN", # required
1238
+ # attribute_name: "attributeName", # required
1239
+ # attribute_value: "attributeValue",
1240
+ # })
1241
+ # @overload set_topic_attributes(params = {})
1242
+ # @param [Hash] params ({})
1243
+ def set_topic_attributes(params = {}, options = {})
1244
+ req = build_request(:set_topic_attributes, params)
1245
+ req.send_request(options)
1246
+ end
1247
+
1248
+ # Prepares to subscribe an endpoint by sending the endpoint a
1249
+ # confirmation message. To actually create a subscription, the endpoint
1250
+ # owner must call the `ConfirmSubscription` action with the token from
1251
+ # the confirmation message. Confirmation tokens are valid for three
1252
+ # days.
1253
+ # @option params [required, String] :topic_arn
1254
+ # The ARN of the topic you want to subscribe to.
1255
+ # @option params [required, String] :protocol
1256
+ # The protocol you want to use. Supported protocols include:
1257
+ #
1258
+ # * `http` -- delivery of JSON-encoded message via HTTP POST
1259
+ #
1260
+ # * `https` -- delivery of JSON-encoded message via HTTPS POST
1261
+ #
1262
+ # * `email` -- delivery of message via SMTP
1263
+ #
1264
+ # * `email-json` -- delivery of JSON-encoded message via SMTP
1265
+ #
1266
+ # * `sms` -- delivery of message via SMS
1267
+ #
1268
+ # * `sqs` -- delivery of JSON-encoded message to an Amazon SQS queue
1269
+ #
1270
+ # * `application` -- delivery of JSON-encoded message to an EndpointArn
1271
+ # for a mobile app and device.
1272
+ #
1273
+ # * `lambda` -- delivery of JSON-encoded message to an AWS Lambda
1274
+ # function.
1275
+ # @option params [String] :endpoint
1276
+ # The endpoint that you want to receive notifications. Endpoints vary by
1277
+ # protocol:
1278
+ #
1279
+ # * For the `http` protocol, the endpoint is an URL beginning with
1280
+ # "http://"
1281
+ #
1282
+ # * For the `https` protocol, the endpoint is a URL beginning with
1283
+ # "https://"
1284
+ #
1285
+ # * For the `email` protocol, the endpoint is an email address
1286
+ #
1287
+ # * For the `email-json` protocol, the endpoint is an email address
1288
+ #
1289
+ # * For the `sms` protocol, the endpoint is a phone number of an
1290
+ # SMS-enabled device
1291
+ #
1292
+ # * For the `sqs` protocol, the endpoint is the ARN of an Amazon SQS
1293
+ # queue
1294
+ #
1295
+ # * For the `application` protocol, the endpoint is the EndpointArn of a
1296
+ # mobile app and device.
1297
+ #
1298
+ # * For the `lambda` protocol, the endpoint is the ARN of an AWS Lambda
1299
+ # function.
1300
+ # @return [Types::SubscribeResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
1301
+ #
1302
+ # * {Types::SubscribeResponse#subscription_arn #SubscriptionArn} => String
1303
+ #
1304
+ # @example Request syntax with placeholder values
1305
+ # resp = client.subscribe({
1306
+ # topic_arn: "topicARN", # required
1307
+ # protocol: "protocol", # required
1308
+ # endpoint: "endpoint",
1309
+ # })
1310
+ #
1311
+ # @example Response structure
1312
+ # resp.subscription_arn #=> String
1313
+ # @overload subscribe(params = {})
1314
+ # @param [Hash] params ({})
1315
+ def subscribe(params = {}, options = {})
1316
+ req = build_request(:subscribe, params)
1317
+ req.send_request(options)
1318
+ end
1319
+
1320
+ # Deletes a subscription. If the subscription requires authentication
1321
+ # for deletion, only the owner of the subscription or the topic's owner
1322
+ # can unsubscribe, and an AWS signature is required. If the
1323
+ # `Unsubscribe` call does not require authentication and the requester
1324
+ # is not the subscription owner, a final cancellation message is
1325
+ # delivered to the endpoint, so that the endpoint owner can easily
1326
+ # resubscribe to the topic if the `Unsubscribe` request was unintended.
1327
+ # @option params [required, String] :subscription_arn
1328
+ # The ARN of the subscription to be deleted.
1329
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
1330
+ #
1331
+ # @example Request syntax with placeholder values
1332
+ # resp = client.unsubscribe({
1333
+ # subscription_arn: "subscriptionARN", # required
1334
+ # })
1335
+ # @overload unsubscribe(params = {})
1336
+ # @param [Hash] params ({})
1337
+ def unsubscribe(params = {}, options = {})
1338
+ req = build_request(:unsubscribe, params)
1339
+ req.send_request(options)
1340
+ end
1341
+
1342
+ # @!endgroup
1343
+
1344
+ # @param params ({})
1345
+ # @api private
1346
+ def build_request(operation_name, params = {})
1347
+ handlers = @handlers.for(operation_name)
1348
+ context = Seahorse::Client::RequestContext.new(
1349
+ operation_name: operation_name,
1350
+ operation: config.api.operation(operation_name),
1351
+ client: self,
1352
+ params: params,
1353
+ config: config)
1354
+ context[:gem_name] = 'aws-sdk-sns'
1355
+ context[:gem_version] = '1.0.0.rc1'
1356
+ Seahorse::Client::Request.new(handlers, context)
1357
+ end
1358
+
1359
+ # @api private
1360
+ # @deprecated
1361
+ def waiter_names
1362
+ []
1363
+ end
1364
+
1365
+ class << self
1366
+
1367
+ # @api private
1368
+ attr_reader :identifier
1369
+
1370
+ # @api private
1371
+ def errors_module
1372
+ Errors
1373
+ end
1374
+
1375
+ end
1376
+ end
1377
+ end
1378
+ end