aws-sdk-sns 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/lib/aws-sdk-sns/errors.rb
CHANGED
@@ -1,23 +1,14 @@
|
|
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
|
-
module
|
10
|
-
module Errors
|
8
|
+
module Aws::SNS
|
9
|
+
module Errors
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Errors::DynamicErrors
|
13
12
|
|
14
|
-
# Raised when calling #load or #data on a resource class that can not be
|
15
|
-
# loaded. This can happen when:
|
16
|
-
#
|
17
|
-
# * A resource class has identifiers, but no data attributes.
|
18
|
-
# * Resource data is only available when making an API call that
|
19
|
-
# enumerates all resources of that type.
|
20
|
-
class ResourceNotLoadable < RuntimeError; end
|
21
|
-
end
|
22
13
|
end
|
23
14
|
end
|
@@ -1,235 +1,233 @@
|
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::SNS
|
9
|
+
class PlatformApplication
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
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
|
-
|
33
|
+
# Attributes include the following:
|
34
|
+
#
|
35
|
+
# * `EventEndpointCreated` -- Topic ARN to which EndpointCreated event
|
36
|
+
# notifications should be sent.
|
37
|
+
#
|
38
|
+
# * `EventEndpointDeleted` -- Topic ARN to which EndpointDeleted event
|
39
|
+
# notifications should be sent.
|
40
|
+
#
|
41
|
+
# * `EventEndpointUpdated` -- Topic ARN to which EndpointUpdate event
|
42
|
+
# notifications should be sent.
|
43
|
+
#
|
44
|
+
# * `EventDeliveryFailure` -- Topic ARN to which DeliveryFailure event
|
45
|
+
# notifications should be sent upon Direct Publish delivery failure
|
46
|
+
# (permanent) to one of the application's endpoints.
|
47
|
+
# @return [Hash<String,String>]
|
48
|
+
def attributes
|
49
|
+
data.attributes
|
50
|
+
end
|
52
51
|
|
53
|
-
|
52
|
+
# @!endgroup
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
# @return [Client]
|
55
|
+
def client
|
56
|
+
@client
|
57
|
+
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
59
|
+
# Loads, or reloads {#data} for the current {PlatformApplication}.
|
60
|
+
# Returns `self` making it possible to chain methods.
|
61
|
+
#
|
62
|
+
# platform_application.reload.data
|
63
|
+
#
|
64
|
+
# @return [self]
|
65
|
+
def load
|
66
|
+
resp = @client.get_platform_application_attributes(platform_application_arn: @arn)
|
67
|
+
@data = resp.data
|
68
|
+
self
|
69
|
+
end
|
70
|
+
alias :reload :load
|
71
|
+
|
72
|
+
# @return [Types::GetPlatformApplicationAttributesResponse]
|
73
|
+
# Returns the data for this {PlatformApplication}. Calls
|
74
|
+
# {Client#get_platform_application_attributes} if {#data_loaded?} is `false`.
|
75
|
+
def data
|
76
|
+
load unless @data
|
77
|
+
@data
|
78
|
+
end
|
80
79
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
80
|
+
# @return [Boolean]
|
81
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
82
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
83
|
+
def data_loaded?
|
84
|
+
!!@data
|
85
|
+
end
|
87
86
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
87
|
+
# @!group Actions
|
88
|
+
|
89
|
+
# @example Request syntax with placeholder values
|
90
|
+
#
|
91
|
+
# platformendpoint = platform_application.create_platform_endpoint({
|
92
|
+
# token: "String", # required
|
93
|
+
# custom_user_data: "String",
|
94
|
+
# attributes: {
|
95
|
+
# "String" => "String",
|
96
|
+
# },
|
97
|
+
# })
|
98
|
+
# @param [Hash] options ({})
|
99
|
+
# @option options [required, String] :token
|
100
|
+
# Unique identifier created by the notification service for an app on a
|
101
|
+
# device. The specific name for Token will vary, depending on which
|
102
|
+
# notification service is being used. For example, when using APNS as
|
103
|
+
# the notification service, you need the device token. Alternatively,
|
104
|
+
# when using GCM or ADM, the device token equivalent is called the
|
105
|
+
# registration ID.
|
106
|
+
# @option options [String] :custom_user_data
|
107
|
+
# Arbitrary user data to associate with the endpoint. Amazon SNS does
|
108
|
+
# not use this data. The data must be in UTF-8 format and less than 2KB.
|
109
|
+
# @option options [Hash<String,String>] :attributes
|
110
|
+
# For a list of attributes, see [SetEndpointAttributes][1].
|
111
|
+
#
|
112
|
+
#
|
113
|
+
#
|
114
|
+
# [1]: http://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html
|
115
|
+
# @return [PlatformEndpoint]
|
116
|
+
def create_platform_endpoint(options = {})
|
117
|
+
options = options.merge(platform_application_arn: @arn)
|
118
|
+
resp = @client.create_platform_endpoint(options)
|
119
|
+
PlatformEndpoint.new(
|
120
|
+
arn: resp.data.endpoint_arn,
|
121
|
+
client: @client
|
122
|
+
)
|
123
|
+
end
|
125
124
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
125
|
+
# @example Request syntax with placeholder values
|
126
|
+
#
|
127
|
+
# platform_application.delete()
|
128
|
+
# @param [Hash] options ({})
|
129
|
+
# @return [EmptyStructure]
|
130
|
+
def delete(options = {})
|
131
|
+
options = options.merge(platform_application_arn: @arn)
|
132
|
+
resp = @client.delete_platform_application(options)
|
133
|
+
resp.data
|
134
|
+
end
|
136
135
|
|
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
|
-
|
136
|
+
# @example Request syntax with placeholder values
|
137
|
+
#
|
138
|
+
# platform_application.set_attributes({
|
139
|
+
# attributes: { # required
|
140
|
+
# "String" => "String",
|
141
|
+
# },
|
142
|
+
# })
|
143
|
+
# @param [Hash] options ({})
|
144
|
+
# @option options [required, Hash<String,String>] :attributes
|
145
|
+
# A map of the platform application attributes. Attributes in this map
|
146
|
+
# include the following:
|
147
|
+
#
|
148
|
+
# * `PlatformCredential` -- The credential received from the
|
149
|
+
# notification service. For APNS/APNS\_SANDBOX, PlatformCredential is
|
150
|
+
# private key. For GCM, PlatformCredential is "API key". For ADM,
|
151
|
+
# PlatformCredential is "client secret".
|
152
|
+
#
|
153
|
+
# * `PlatformPrincipal` -- The principal received from the notification
|
154
|
+
# service. For APNS/APNS\_SANDBOX, PlatformPrincipal is SSL
|
155
|
+
# certificate. For GCM, PlatformPrincipal is not applicable. For ADM,
|
156
|
+
# PlatformPrincipal is "client id".
|
157
|
+
#
|
158
|
+
# * `EventEndpointCreated` -- Topic ARN to which EndpointCreated event
|
159
|
+
# notifications should be sent.
|
160
|
+
#
|
161
|
+
# * `EventEndpointDeleted` -- Topic ARN to which EndpointDeleted event
|
162
|
+
# notifications should be sent.
|
163
|
+
#
|
164
|
+
# * `EventEndpointUpdated` -- Topic ARN to which EndpointUpdate event
|
165
|
+
# notifications should be sent.
|
166
|
+
#
|
167
|
+
# * `EventDeliveryFailure` -- Topic ARN to which DeliveryFailure event
|
168
|
+
# notifications should be sent upon Direct Publish delivery failure
|
169
|
+
# (permanent) to one of the application's endpoints.
|
170
|
+
#
|
171
|
+
# * `SuccessFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS
|
172
|
+
# write access to use CloudWatch Logs on your behalf.
|
173
|
+
#
|
174
|
+
# * `FailureFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS
|
175
|
+
# write access to use CloudWatch Logs on your behalf.
|
176
|
+
#
|
177
|
+
# * `SuccessFeedbackSampleRate` -- Sample rate percentage (0-100) of
|
178
|
+
# successfully delivered messages.
|
179
|
+
# @return [EmptyStructure]
|
180
|
+
def set_attributes(options = {})
|
181
|
+
options = options.merge(platform_application_arn: @arn)
|
182
|
+
resp = @client.set_platform_application_attributes(options)
|
183
|
+
resp.data
|
184
|
+
end
|
185
|
+
|
186
|
+
# @!group Associations
|
186
187
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
batch
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
client: @client
|
204
|
-
)
|
205
|
-
end
|
206
|
-
y.yield(batch)
|
188
|
+
# @example Request syntax with placeholder values
|
189
|
+
#
|
190
|
+
# platform_application.endpoints()
|
191
|
+
# @param [Hash] options ({})
|
192
|
+
# @return [PlatformEndpoint::Collection]
|
193
|
+
def endpoints(options = {})
|
194
|
+
batches = Enumerator.new do |y|
|
195
|
+
options = options.merge(platform_application_arn: @arn)
|
196
|
+
resp = @client.list_endpoints_by_platform_application(options)
|
197
|
+
resp.each_page do |page|
|
198
|
+
batch = []
|
199
|
+
page.data.endpoints.each do |e|
|
200
|
+
batch << PlatformEndpoint.new(
|
201
|
+
arn: e.endpoint_arn,
|
202
|
+
client: @client
|
203
|
+
)
|
207
204
|
end
|
205
|
+
y.yield(batch)
|
208
206
|
end
|
209
|
-
PlatformEndpoint::Collection.new(batches)
|
210
207
|
end
|
208
|
+
PlatformEndpoint::Collection.new(batches)
|
209
|
+
end
|
211
210
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
end
|
211
|
+
# @deprecated
|
212
|
+
# @api private
|
213
|
+
def identifiers
|
214
|
+
{ arn: @arn }
|
215
|
+
end
|
216
|
+
deprecated(:identifiers)
|
217
|
+
|
218
|
+
private
|
219
|
+
|
220
|
+
def extract_arn(args, options)
|
221
|
+
value = args[0] || options.delete(:arn)
|
222
|
+
case value
|
223
|
+
when String then value
|
224
|
+
when nil then raise ArgumentError, "missing required option :arn"
|
225
|
+
else
|
226
|
+
msg = "expected :arn to be a String, got #{value.class}"
|
227
|
+
raise ArgumentError, msg
|
230
228
|
end
|
231
|
-
|
232
|
-
class Collection < Aws::Resources::Collection; end
|
233
229
|
end
|
230
|
+
|
231
|
+
class Collection < Aws::Resources::Collection; end
|
234
232
|
end
|
235
233
|
end
|