aws-sdk-sns 1.0.0.rc1 → 1.0.0.rc2
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/lib/aws-sdk-sns.rb +2 -2
- data/lib/aws-sdk-sns/client.rb +1547 -1308
- data/lib/aws-sdk-sns/client_api.rb +702 -704
- data/lib/aws-sdk-sns/errors.rb +4 -13
- data/lib/aws-sdk-sns/platform_application.rb +208 -210
- data/lib/aws-sdk-sns/platform_endpoint.rb +237 -239
- data/lib/aws-sdk-sns/resource.rb +152 -154
- data/lib/aws-sdk-sns/subscription.rb +127 -129
- data/lib/aws-sdk-sns/topic.rb +381 -383
- data/lib/aws-sdk-sns/types.rb +1531 -1287
- metadata +2 -2
@@ -1,266 +1,264 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
class PlatformEndpoint
|
8
|
+
module Aws::SNS
|
9
|
+
class PlatformEndpoint
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Deprecations
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
13
|
+
# @overload def initialize(arn, options = {})
|
14
|
+
# @param [String] arn
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :arn
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@arn = extract_arn(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
# @return [String]
|
29
|
+
def arn
|
30
|
+
@arn
|
31
|
+
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
33
|
+
# Attributes include the following:
|
34
|
+
#
|
35
|
+
# * `CustomUserData` -- arbitrary user data to associate with the
|
36
|
+
# endpoint. Amazon SNS does not use this data. The data must be in
|
37
|
+
# UTF-8 format and less than 2KB.
|
38
|
+
#
|
39
|
+
# * `Enabled` -- flag that enables/disables delivery to the endpoint.
|
40
|
+
# Amazon SNS will set this to false when a notification service
|
41
|
+
# indicates to Amazon SNS that the endpoint is invalid. Users can set
|
42
|
+
# it back to true, typically after updating Token.
|
43
|
+
#
|
44
|
+
# * `Token` -- device token, also referred to as a registration id, for
|
45
|
+
# an app and mobile device. This is returned from the notification
|
46
|
+
# service when an app and mobile device are registered with the
|
47
|
+
# notification service.
|
48
|
+
# @return [Hash<String,String>]
|
49
|
+
def attributes
|
50
|
+
data.attributes
|
51
|
+
end
|
53
52
|
|
54
|
-
|
53
|
+
# @!endgroup
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
# @return [Client]
|
56
|
+
def client
|
57
|
+
@client
|
58
|
+
end
|
60
59
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
60
|
+
# Loads, or reloads {#data} for the current {PlatformEndpoint}.
|
61
|
+
# Returns `self` making it possible to chain methods.
|
62
|
+
#
|
63
|
+
# platform_endpoint.reload.data
|
64
|
+
#
|
65
|
+
# @return [self]
|
66
|
+
def load
|
67
|
+
resp = @client.get_endpoint_attributes(endpoint_arn: @arn)
|
68
|
+
@data = resp.data
|
69
|
+
self
|
70
|
+
end
|
71
|
+
alias :reload :load
|
73
72
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
73
|
+
# @return [Types::GetEndpointAttributesResponse]
|
74
|
+
# Returns the data for this {PlatformEndpoint}. Calls
|
75
|
+
# {Client#get_endpoint_attributes} if {#data_loaded?} is `false`.
|
76
|
+
def data
|
77
|
+
load unless @data
|
78
|
+
@data
|
79
|
+
end
|
81
80
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
81
|
+
# @return [Boolean]
|
82
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
83
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
84
|
+
def data_loaded?
|
85
|
+
!!@data
|
86
|
+
end
|
88
87
|
|
89
|
-
|
88
|
+
# @!group Actions
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
90
|
+
# @example Request syntax with placeholder values
|
91
|
+
#
|
92
|
+
# platform_endpoint.delete()
|
93
|
+
# @param [Hash] options ({})
|
94
|
+
# @return [EmptyStructure]
|
95
|
+
def delete(options = {})
|
96
|
+
options = options.merge(endpoint_arn: @arn)
|
97
|
+
resp = @client.delete_endpoint(options)
|
98
|
+
resp.data
|
99
|
+
end
|
101
100
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
101
|
+
# @example Request syntax with placeholder values
|
102
|
+
#
|
103
|
+
# platform_endpoint.publish({
|
104
|
+
# topic_arn: "topicARN",
|
105
|
+
# phone_number: "String",
|
106
|
+
# message: "message", # required
|
107
|
+
# subject: "subject",
|
108
|
+
# message_structure: "messageStructure",
|
109
|
+
# message_attributes: {
|
110
|
+
# "String" => {
|
111
|
+
# data_type: "String", # required
|
112
|
+
# string_value: "String",
|
113
|
+
# binary_value: "data",
|
114
|
+
# },
|
115
|
+
# },
|
116
|
+
# })
|
117
|
+
# @param [Hash] options ({})
|
118
|
+
# @option options [String] :topic_arn
|
119
|
+
# The topic you want to publish to.
|
120
|
+
#
|
121
|
+
# If you don't specify a value for the `TopicArn` parameter, you must
|
122
|
+
# specify a value for the `PhoneNumber` or `TargetArn` parameters.
|
123
|
+
# @option options [String] :phone_number
|
124
|
+
# The phone number to which you want to deliver an SMS message. Use
|
125
|
+
# E.164 format.
|
126
|
+
#
|
127
|
+
# If you don't specify a value for the `PhoneNumber` parameter, you
|
128
|
+
# must specify a value for the `TargetArn` or `TopicArn` parameters.
|
129
|
+
# @option options [required, String] :message
|
130
|
+
# The message you want to send to the topic.
|
131
|
+
#
|
132
|
+
# If you want to send the same message to all transport protocols,
|
133
|
+
# include the text of the message as a String value.
|
134
|
+
#
|
135
|
+
# If you want to send different messages for each transport protocol,
|
136
|
+
# set the value of the `MessageStructure` parameter to `json` and use a
|
137
|
+
# JSON object for the `Message` parameter.
|
138
|
+
#
|
139
|
+
# Constraints: Messages must be UTF-8 encoded strings at most 256 KB in
|
140
|
+
# size (262144 bytes, not 262144 characters).
|
141
|
+
#
|
142
|
+
# JSON-specific constraints:
|
143
|
+
#
|
144
|
+
# * Keys in the JSON object that correspond to supported transport
|
145
|
+
# protocols must have simple JSON string values.
|
146
|
+
#
|
147
|
+
# * The values will be parsed (unescaped) before they are used in
|
148
|
+
# outgoing messages.
|
149
|
+
#
|
150
|
+
# * Outbound notifications are JSON encoded (meaning that the characters
|
151
|
+
# will be reescaped for sending).
|
152
|
+
#
|
153
|
+
# * Values have a minimum length of 0 (the empty string, "", is
|
154
|
+
# allowed).
|
155
|
+
#
|
156
|
+
# * Values have a maximum length bounded by the overall message size
|
157
|
+
# (so, including multiple protocols may limit message sizes).
|
158
|
+
#
|
159
|
+
# * Non-string values will cause the key to be ignored.
|
160
|
+
#
|
161
|
+
# * Keys that do not correspond to supported transport protocols are
|
162
|
+
# ignored.
|
163
|
+
#
|
164
|
+
# * Duplicate keys are not allowed.
|
165
|
+
#
|
166
|
+
# * Failure to parse or validate any key or value in the message will
|
167
|
+
# cause the `Publish` call to return an error (no partial delivery).
|
168
|
+
# @option options [String] :subject
|
169
|
+
# Optional parameter to be used as the "Subject" line when the message
|
170
|
+
# is delivered to email endpoints. This field will also be included, if
|
171
|
+
# present, in the standard JSON messages delivered to other endpoints.
|
172
|
+
#
|
173
|
+
# Constraints: Subjects must be ASCII text that begins with a letter,
|
174
|
+
# number, or punctuation mark; must not include line breaks or control
|
175
|
+
# characters; and must be less than 100 characters long.
|
176
|
+
# @option options [String] :message_structure
|
177
|
+
# Set `MessageStructure` to `json` if you want to send a different
|
178
|
+
# message for each protocol. For example, using one publish action, you
|
179
|
+
# can send a short message to your SMS subscribers and a longer message
|
180
|
+
# to your email subscribers. If you set `MessageStructure` to `json`,
|
181
|
+
# the value of the `Message` parameter must:
|
182
|
+
#
|
183
|
+
# * be a syntactically valid JSON object; and
|
184
|
+
#
|
185
|
+
# * contain at least a top-level JSON key of "default" with a value
|
186
|
+
# that is a string.
|
187
|
+
#
|
188
|
+
# You can define other top-level keys that define the message you want
|
189
|
+
# to send to a specific transport protocol (e.g., "http").
|
190
|
+
#
|
191
|
+
# For information about sending different messages for each protocol
|
192
|
+
# using the AWS Management Console, go to [Create Different Messages for
|
193
|
+
# Each Protocol][1] in the *Amazon Simple Notification Service Getting
|
194
|
+
# Started Guide*.
|
195
|
+
#
|
196
|
+
# Valid value: `json`
|
197
|
+
#
|
198
|
+
#
|
199
|
+
#
|
200
|
+
# [1]: http://docs.aws.amazon.com/sns/latest/gsg/Publish.html#sns-message-formatting-by-protocol
|
201
|
+
# @option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
|
202
|
+
# Message attributes for Publish action.
|
203
|
+
# @return [Types::PublishResponse]
|
204
|
+
def publish(options = {})
|
205
|
+
options = options.merge(target_arn: @arn)
|
206
|
+
resp = @client.publish(options)
|
207
|
+
resp.data
|
208
|
+
end
|
210
209
|
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
210
|
+
# @example Request syntax with placeholder values
|
211
|
+
#
|
212
|
+
# platform_endpoint.set_attributes({
|
213
|
+
# attributes: { # required
|
214
|
+
# "String" => "String",
|
215
|
+
# },
|
216
|
+
# })
|
217
|
+
# @param [Hash] options ({})
|
218
|
+
# @option options [required, Hash<String,String>] :attributes
|
219
|
+
# A map of the endpoint attributes. Attributes in this map include the
|
220
|
+
# following:
|
221
|
+
#
|
222
|
+
# * `CustomUserData` -- arbitrary user data to associate with the
|
223
|
+
# endpoint. Amazon SNS does not use this data. The data must be in
|
224
|
+
# UTF-8 format and less than 2KB.
|
225
|
+
#
|
226
|
+
# * `Enabled` -- flag that enables/disables delivery to the endpoint.
|
227
|
+
# Amazon SNS will set this to false when a notification service
|
228
|
+
# indicates to Amazon SNS that the endpoint is invalid. Users can set
|
229
|
+
# it back to true, typically after updating Token.
|
230
|
+
#
|
231
|
+
# * `Token` -- device token, also referred to as a registration id, for
|
232
|
+
# an app and mobile device. This is returned from the notification
|
233
|
+
# service when an app and mobile device are registered with the
|
234
|
+
# notification service.
|
235
|
+
# @return [EmptyStructure]
|
236
|
+
def set_attributes(options = {})
|
237
|
+
options = options.merge(endpoint_arn: @arn)
|
238
|
+
resp = @client.set_endpoint_attributes(options)
|
239
|
+
resp.data
|
240
|
+
end
|
242
241
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
242
|
+
# @deprecated
|
243
|
+
# @api private
|
244
|
+
def identifiers
|
245
|
+
{ arn: @arn }
|
246
|
+
end
|
247
|
+
deprecated(:identifiers)
|
249
248
|
|
250
|
-
|
249
|
+
private
|
251
250
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
end
|
251
|
+
def extract_arn(args, options)
|
252
|
+
value = args[0] || options.delete(:arn)
|
253
|
+
case value
|
254
|
+
when String then value
|
255
|
+
when nil then raise ArgumentError, "missing required option :arn"
|
256
|
+
else
|
257
|
+
msg = "expected :arn to be a String, got #{value.class}"
|
258
|
+
raise ArgumentError, msg
|
261
259
|
end
|
262
|
-
|
263
|
-
class Collection < Aws::Resources::Collection; end
|
264
260
|
end
|
261
|
+
|
262
|
+
class Collection < Aws::Resources::Collection; end
|
265
263
|
end
|
266
264
|
end
|