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/resource.rb
CHANGED
@@ -1,185 +1,183 @@
|
|
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 Resource
|
8
|
+
module Aws::SNS
|
9
|
+
class Resource
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
# @param options ({})
|
12
|
+
# @option options [Client] :client
|
13
|
+
def initialize(options = {})
|
14
|
+
@client = options[:client] || Client.new(options)
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
# @return [Client]
|
18
|
+
def client
|
19
|
+
@client
|
20
|
+
end
|
22
21
|
|
23
|
-
|
22
|
+
# @!group Actions
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
24
|
+
# @example Request syntax with placeholder values
|
25
|
+
#
|
26
|
+
# platformapplication = sns.create_platform_application({
|
27
|
+
# name: "String", # required
|
28
|
+
# platform: "String", # required
|
29
|
+
# attributes: { # required
|
30
|
+
# "String" => "String",
|
31
|
+
# },
|
32
|
+
# })
|
33
|
+
# @param [Hash] options ({})
|
34
|
+
# @option options [required, String] :name
|
35
|
+
# Application names must be made up of only uppercase and lowercase
|
36
|
+
# ASCII letters, numbers, underscores, hyphens, and periods, and must be
|
37
|
+
# between 1 and 256 characters long.
|
38
|
+
# @option options [required, String] :platform
|
39
|
+
# The following platforms are supported: ADM (Amazon Device Messaging),
|
40
|
+
# APNS (Apple Push Notification Service), APNS\_SANDBOX, and GCM (Google
|
41
|
+
# Cloud Messaging).
|
42
|
+
# @option options [required, Hash<String,String>] :attributes
|
43
|
+
# For a list of attributes, see [SetPlatformApplicationAttributes][1]
|
44
|
+
#
|
45
|
+
#
|
46
|
+
#
|
47
|
+
# [1]: http://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html
|
48
|
+
# @return [PlatformApplication]
|
49
|
+
def create_platform_application(options = {})
|
50
|
+
resp = @client.create_platform_application(options)
|
51
|
+
PlatformApplication.new(
|
52
|
+
arn: resp.data.platform_application_arn,
|
53
|
+
client: @client
|
54
|
+
)
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
57
|
+
# @example Request syntax with placeholder values
|
58
|
+
#
|
59
|
+
# topic = sns.create_topic({
|
60
|
+
# name: "topicName", # required
|
61
|
+
# })
|
62
|
+
# @param [Hash] options ({})
|
63
|
+
# @option options [required, String] :name
|
64
|
+
# The name of the topic you want to create.
|
65
|
+
#
|
66
|
+
# Constraints: Topic names must be made up of only uppercase and
|
67
|
+
# lowercase ASCII letters, numbers, underscores, and hyphens, and must
|
68
|
+
# be between 1 and 256 characters long.
|
69
|
+
# @return [Topic]
|
70
|
+
def create_topic(options = {})
|
71
|
+
resp = @client.create_topic(options)
|
72
|
+
Topic.new(
|
73
|
+
arn: resp.data.topic_arn,
|
74
|
+
client: @client
|
75
|
+
)
|
76
|
+
end
|
78
77
|
|
79
|
-
|
78
|
+
# @!group Associations
|
80
79
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
80
|
+
# @param [String] arn
|
81
|
+
# @return [PlatformApplication]
|
82
|
+
def platform_application(arn)
|
83
|
+
PlatformApplication.new(
|
84
|
+
arn: arn,
|
85
|
+
client: @client
|
86
|
+
)
|
87
|
+
end
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
end
|
106
|
-
y.yield(batch)
|
89
|
+
# @example Request syntax with placeholder values
|
90
|
+
#
|
91
|
+
# sns.platform_applications()
|
92
|
+
# @param [Hash] options ({})
|
93
|
+
# @return [PlatformApplication::Collection]
|
94
|
+
def platform_applications(options = {})
|
95
|
+
batches = Enumerator.new do |y|
|
96
|
+
resp = @client.list_platform_applications(options)
|
97
|
+
resp.each_page do |page|
|
98
|
+
batch = []
|
99
|
+
page.data.platform_applications.each do |p|
|
100
|
+
batch << PlatformApplication.new(
|
101
|
+
arn: p.platform_application_arn,
|
102
|
+
client: @client
|
103
|
+
)
|
107
104
|
end
|
105
|
+
y.yield(batch)
|
108
106
|
end
|
109
|
-
PlatformApplication::Collection.new(batches)
|
110
107
|
end
|
108
|
+
PlatformApplication::Collection.new(batches)
|
109
|
+
end
|
111
110
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
111
|
+
# @param [String] arn
|
112
|
+
# @return [PlatformEndpoint]
|
113
|
+
def platform_endpoint(arn)
|
114
|
+
PlatformEndpoint.new(
|
115
|
+
arn: arn,
|
116
|
+
client: @client
|
117
|
+
)
|
118
|
+
end
|
120
119
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
120
|
+
# @param [String] arn
|
121
|
+
# @return [Subscription]
|
122
|
+
def subscription(arn)
|
123
|
+
Subscription.new(
|
124
|
+
arn: arn,
|
125
|
+
client: @client
|
126
|
+
)
|
127
|
+
end
|
129
128
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
end
|
146
|
-
y.yield(batch)
|
129
|
+
# @example Request syntax with placeholder values
|
130
|
+
#
|
131
|
+
# sns.subscriptions()
|
132
|
+
# @param [Hash] options ({})
|
133
|
+
# @return [Subscription::Collection]
|
134
|
+
def subscriptions(options = {})
|
135
|
+
batches = Enumerator.new do |y|
|
136
|
+
resp = @client.list_subscriptions(options)
|
137
|
+
resp.each_page do |page|
|
138
|
+
batch = []
|
139
|
+
page.data.subscriptions.each do |s|
|
140
|
+
batch << Subscription.new(
|
141
|
+
arn: s.subscription_arn,
|
142
|
+
client: @client
|
143
|
+
)
|
147
144
|
end
|
145
|
+
y.yield(batch)
|
148
146
|
end
|
149
|
-
Subscription::Collection.new(batches)
|
150
147
|
end
|
148
|
+
Subscription::Collection.new(batches)
|
149
|
+
end
|
151
150
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
151
|
+
# @param [String] arn
|
152
|
+
# @return [Topic]
|
153
|
+
def topic(arn)
|
154
|
+
Topic.new(
|
155
|
+
arn: arn,
|
156
|
+
client: @client
|
157
|
+
)
|
158
|
+
end
|
160
159
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
end
|
177
|
-
y.yield(batch)
|
160
|
+
# @example Request syntax with placeholder values
|
161
|
+
#
|
162
|
+
# sns.topics()
|
163
|
+
# @param [Hash] options ({})
|
164
|
+
# @return [Topic::Collection]
|
165
|
+
def topics(options = {})
|
166
|
+
batches = Enumerator.new do |y|
|
167
|
+
resp = @client.list_topics(options)
|
168
|
+
resp.each_page do |page|
|
169
|
+
batch = []
|
170
|
+
page.data.topics.each do |t|
|
171
|
+
batch << Topic.new(
|
172
|
+
arn: t.topic_arn,
|
173
|
+
client: @client
|
174
|
+
)
|
178
175
|
end
|
176
|
+
y.yield(batch)
|
179
177
|
end
|
180
|
-
Topic::Collection.new(batches)
|
181
178
|
end
|
182
|
-
|
179
|
+
Topic::Collection.new(batches)
|
183
180
|
end
|
181
|
+
|
184
182
|
end
|
185
183
|
end
|
@@ -1,149 +1,147 @@
|
|
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 Subscription
|
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
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
33
|
+
# A map of the subscription's attributes. Attributes in this map
|
34
|
+
# include the following:
|
35
|
+
#
|
36
|
+
# * `SubscriptionArn` -- the subscription's ARN
|
37
|
+
#
|
38
|
+
# * `TopicArn` -- the topic ARN that the subscription is associated with
|
39
|
+
#
|
40
|
+
# * `Owner` -- the AWS account ID of the subscription's owner
|
41
|
+
#
|
42
|
+
# * `ConfirmationWasAuthenticated` -- true if the subscription
|
43
|
+
# confirmation request was authenticated
|
44
|
+
#
|
45
|
+
# * `DeliveryPolicy` -- the JSON serialization of the subscription's
|
46
|
+
# delivery policy
|
47
|
+
#
|
48
|
+
# * `EffectiveDeliveryPolicy` -- the JSON serialization of the effective
|
49
|
+
# delivery policy that takes into account the topic delivery policy
|
50
|
+
# and account system defaults
|
51
|
+
# @return [Hash<String,String>]
|
52
|
+
def attributes
|
53
|
+
data.attributes
|
54
|
+
end
|
56
55
|
|
57
|
-
|
56
|
+
# @!endgroup
|
58
57
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
# @return [Client]
|
59
|
+
def client
|
60
|
+
@client
|
61
|
+
end
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
63
|
+
# Loads, or reloads {#data} for the current {Subscription}.
|
64
|
+
# Returns `self` making it possible to chain methods.
|
65
|
+
#
|
66
|
+
# subscription.reload.data
|
67
|
+
#
|
68
|
+
# @return [self]
|
69
|
+
def load
|
70
|
+
resp = @client.get_subscription_attributes(subscription_arn: @arn)
|
71
|
+
@data = resp.data
|
72
|
+
self
|
73
|
+
end
|
74
|
+
alias :reload :load
|
75
|
+
|
76
|
+
# @return [Types::GetSubscriptionAttributesResponse]
|
77
|
+
# Returns the data for this {Subscription}. Calls
|
78
|
+
# {Client#get_subscription_attributes} if {#data_loaded?} is `false`.
|
79
|
+
def data
|
80
|
+
load unless @data
|
81
|
+
@data
|
82
|
+
end
|
84
83
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
84
|
+
# @return [Boolean]
|
85
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
86
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
87
|
+
def data_loaded?
|
88
|
+
!!@data
|
89
|
+
end
|
91
90
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
91
|
+
# @!group Actions
|
92
|
+
|
93
|
+
# @example Request syntax with placeholder values
|
94
|
+
#
|
95
|
+
# subscription.delete()
|
96
|
+
# @param [Hash] options ({})
|
97
|
+
# @return [EmptyStructure]
|
98
|
+
def delete(options = {})
|
99
|
+
options = options.merge(subscription_arn: @arn)
|
100
|
+
resp = @client.unsubscribe(options)
|
101
|
+
resp.data
|
102
|
+
end
|
104
103
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
104
|
+
# @example Request syntax with placeholder values
|
105
|
+
#
|
106
|
+
# subscription.set_attributes({
|
107
|
+
# attribute_name: "attributeName", # required
|
108
|
+
# attribute_value: "attributeValue",
|
109
|
+
# })
|
110
|
+
# @param [Hash] options ({})
|
111
|
+
# @option options [required, String] :attribute_name
|
112
|
+
# The name of the attribute you want to set. Only a subset of the
|
113
|
+
# subscriptions attributes are mutable.
|
114
|
+
#
|
115
|
+
# Valid values: `DeliveryPolicy` \| `RawMessageDelivery`
|
116
|
+
# @option options [String] :attribute_value
|
117
|
+
# The new value for the attribute in JSON format.
|
118
|
+
# @return [EmptyStructure]
|
119
|
+
def set_attributes(options = {})
|
120
|
+
options = options.merge(subscription_arn: @arn)
|
121
|
+
resp = @client.set_subscription_attributes(options)
|
122
|
+
resp.data
|
123
|
+
end
|
125
124
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
end
|
125
|
+
# @deprecated
|
126
|
+
# @api private
|
127
|
+
def identifiers
|
128
|
+
{ arn: @arn }
|
129
|
+
end
|
130
|
+
deprecated(:identifiers)
|
131
|
+
|
132
|
+
private
|
133
|
+
|
134
|
+
def extract_arn(args, options)
|
135
|
+
value = args[0] || options.delete(:arn)
|
136
|
+
case value
|
137
|
+
when String then value
|
138
|
+
when nil then raise ArgumentError, "missing required option :arn"
|
139
|
+
else
|
140
|
+
msg = "expected :arn to be a String, got #{value.class}"
|
141
|
+
raise ArgumentError, msg
|
144
142
|
end
|
145
|
-
|
146
|
-
class Collection < Aws::Resources::Collection; end
|
147
143
|
end
|
144
|
+
|
145
|
+
class Collection < Aws::Resources::Collection; end
|
148
146
|
end
|
149
147
|
end
|