aws-sdk-cloudwatch 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 768c8e2235c9fee3921c8ceca13c009e2c4e9d29
4
- data.tar.gz: 7a901c263a474f34d52ea667bdc832ddc66efc69
3
+ metadata.gz: b1320a76999cf9b13afb99256ecc500df2bda6d7
4
+ data.tar.gz: 73feb079d0b938d2e5255a6f994c49493a968d43
5
5
  SHA512:
6
- metadata.gz: 3c5027e27ca59ddb602d745f7bb857196c358e43816d329456a00b15434c37174dd3e3b63d794e98a4eaa2964322a7eb8cd4f49a31e788297a5751c0e2f7d472
7
- data.tar.gz: 7c0251b79e957a882637163509cb3fdcf610cb8b6dce1852a319dbaa2fea6bd91f969cfd4c3ba21da05eb715161c78f19260cd7dfa9f22a532b21f4a484710fb
6
+ metadata.gz: 9c016de4971ebbd09f2f8e9cb70624ecfb27188e65041702facf9766b9a028de6b0e4523ef48ab7fe977699b64a7b5cafebfd15e0a1a48a7957013865556b948
7
+ data.tar.gz: 9769b979d1284d0d8975b0d4b433a12c424dbb36a96e78890fd941a80e7c98f0d9e382df93a629547b68e3a9b9e0695736bf0fa6cde0cdab24bc3122ed92ab14
@@ -1,6 +1,6 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
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
@@ -45,6 +45,6 @@ require_relative 'aws-sdk-cloudwatch/customizations'
45
45
  # @service
46
46
  module Aws::CloudWatch
47
47
 
48
- GEM_VERSION = '1.0.0.rc1'
48
+ GEM_VERSION = '1.0.0.rc2'
49
49
 
50
50
  end
@@ -1,451 +1,450 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
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 CloudWatch
10
- class Alarm
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(name, options = {})
15
- # @param [String] name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @name = extract_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::CloudWatch
9
+ class Alarm
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(name, options = {})
14
+ # @param [String] name
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :name
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @name = extract_name(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def name
31
- @name
32
- end
33
- alias :alarm_name :name
28
+ # @return [String]
29
+ def name
30
+ @name
31
+ end
32
+ alias :alarm_name :name
34
33
 
35
- # The Amazon Resource Name (ARN) of the alarm.
36
- # @return [String]
37
- def alarm_arn
38
- data.alarm_arn
39
- end
34
+ # The Amazon Resource Name (ARN) of the alarm.
35
+ # @return [String]
36
+ def alarm_arn
37
+ data.alarm_arn
38
+ end
40
39
 
41
- # The description of the alarm.
42
- # @return [String]
43
- def alarm_description
44
- data.alarm_description
45
- end
40
+ # The description of the alarm.
41
+ # @return [String]
42
+ def alarm_description
43
+ data.alarm_description
44
+ end
46
45
 
47
- # The time stamp of the last update to the alarm configuration.
48
- # @return [Time]
49
- def alarm_configuration_updated_timestamp
50
- data.alarm_configuration_updated_timestamp
51
- end
46
+ # The time stamp of the last update to the alarm configuration.
47
+ # @return [Time]
48
+ def alarm_configuration_updated_timestamp
49
+ data.alarm_configuration_updated_timestamp
50
+ end
52
51
 
53
- # Indicates whether actions should be executed during any changes to the
54
- # alarm state.
55
- # @return [Boolean]
56
- def actions_enabled
57
- data.actions_enabled
58
- end
52
+ # Indicates whether actions should be executed during any changes to the
53
+ # alarm state.
54
+ # @return [Boolean]
55
+ def actions_enabled
56
+ data.actions_enabled
57
+ end
59
58
 
60
- # The actions to execute when this alarm transitions to the `OK` state
61
- # from any other state. Each action is specified as an Amazon Resource
62
- # Name (ARN).
63
- # @return [Array<String>]
64
- def ok_actions
65
- data.ok_actions
66
- end
59
+ # The actions to execute when this alarm transitions to the `OK` state
60
+ # from any other state. Each action is specified as an Amazon Resource
61
+ # Name (ARN).
62
+ # @return [Array<String>]
63
+ def ok_actions
64
+ data.ok_actions
65
+ end
67
66
 
68
- # The actions to execute when this alarm transitions to the `ALARM`
69
- # state from any other state. Each action is specified as an Amazon
70
- # Resource Name (ARN).
71
- # @return [Array<String>]
72
- def alarm_actions
73
- data.alarm_actions
74
- end
67
+ # The actions to execute when this alarm transitions to the `ALARM`
68
+ # state from any other state. Each action is specified as an Amazon
69
+ # Resource Name (ARN).
70
+ # @return [Array<String>]
71
+ def alarm_actions
72
+ data.alarm_actions
73
+ end
75
74
 
76
- # The actions to execute when this alarm transitions to the
77
- # `INSUFFICIENT_DATA` state from any other state. Each action is
78
- # specified as an Amazon Resource Name (ARN).
79
- # @return [Array<String>]
80
- def insufficient_data_actions
81
- data.insufficient_data_actions
82
- end
75
+ # The actions to execute when this alarm transitions to the
76
+ # `INSUFFICIENT_DATA` state from any other state. Each action is
77
+ # specified as an Amazon Resource Name (ARN).
78
+ # @return [Array<String>]
79
+ def insufficient_data_actions
80
+ data.insufficient_data_actions
81
+ end
83
82
 
84
- # The state value for the alarm.
85
- # @return [String]
86
- def state_value
87
- data.state_value
88
- end
83
+ # The state value for the alarm.
84
+ # @return [String]
85
+ def state_value
86
+ data.state_value
87
+ end
89
88
 
90
- # An explanation for the alarm state, in text format.
91
- # @return [String]
92
- def state_reason
93
- data.state_reason
94
- end
89
+ # An explanation for the alarm state, in text format.
90
+ # @return [String]
91
+ def state_reason
92
+ data.state_reason
93
+ end
95
94
 
96
- # An explanation for the alarm state, in JSON format.
97
- # @return [String]
98
- def state_reason_data
99
- data.state_reason_data
100
- end
95
+ # An explanation for the alarm state, in JSON format.
96
+ # @return [String]
97
+ def state_reason_data
98
+ data.state_reason_data
99
+ end
101
100
 
102
- # The time stamp of the last update to the alarm state.
103
- # @return [Time]
104
- def state_updated_timestamp
105
- data.state_updated_timestamp
106
- end
101
+ # The time stamp of the last update to the alarm state.
102
+ # @return [Time]
103
+ def state_updated_timestamp
104
+ data.state_updated_timestamp
105
+ end
107
106
 
108
- # The name of the metric associated with the alarm.
109
- # @return [String]
110
- def metric_name
111
- data.metric_name
112
- end
107
+ # The name of the metric associated with the alarm.
108
+ # @return [String]
109
+ def metric_name
110
+ data.metric_name
111
+ end
113
112
 
114
- # The namespace of the metric associated with the alarm.
115
- # @return [String]
116
- def namespace
117
- data.namespace
118
- end
113
+ # The namespace of the metric associated with the alarm.
114
+ # @return [String]
115
+ def namespace
116
+ data.namespace
117
+ end
119
118
 
120
- # The statistic for the metric associated with the alarm, other than
121
- # percentile. For percentile statistics, use `ExtendedStatistic`.
122
- # @return [String]
123
- def statistic
124
- data.statistic
125
- end
119
+ # The statistic for the metric associated with the alarm, other than
120
+ # percentile. For percentile statistics, use `ExtendedStatistic`.
121
+ # @return [String]
122
+ def statistic
123
+ data.statistic
124
+ end
126
125
 
127
- # The percentile statistic for the metric associated with the alarm.
128
- # Specify a value between p0.0 and p100.
129
- # @return [String]
130
- def extended_statistic
131
- data.extended_statistic
132
- end
126
+ # The percentile statistic for the metric associated with the alarm.
127
+ # Specify a value between p0.0 and p100.
128
+ # @return [String]
129
+ def extended_statistic
130
+ data.extended_statistic
131
+ end
133
132
 
134
- # The dimensions for the metric associated with the alarm.
135
- # @return [Array<Types::Dimension>]
136
- def dimensions
137
- data.dimensions
138
- end
133
+ # The dimensions for the metric associated with the alarm.
134
+ # @return [Array<Types::Dimension>]
135
+ def dimensions
136
+ data.dimensions
137
+ end
139
138
 
140
- # The period, in seconds, over which the statistic is applied.
141
- # @return [Integer]
142
- def period
143
- data.period
144
- end
139
+ # The period, in seconds, over which the statistic is applied.
140
+ # @return [Integer]
141
+ def period
142
+ data.period
143
+ end
145
144
 
146
- # The unit of the metric associated with the alarm.
147
- # @return [String]
148
- def unit
149
- data.unit
150
- end
145
+ # The unit of the metric associated with the alarm.
146
+ # @return [String]
147
+ def unit
148
+ data.unit
149
+ end
151
150
 
152
- # The number of periods over which data is compared to the specified
153
- # threshold.
154
- # @return [Integer]
155
- def evaluation_periods
156
- data.evaluation_periods
157
- end
151
+ # The number of periods over which data is compared to the specified
152
+ # threshold.
153
+ # @return [Integer]
154
+ def evaluation_periods
155
+ data.evaluation_periods
156
+ end
158
157
 
159
- # The value to compare with the specified statistic.
160
- # @return [Float]
161
- def threshold
162
- data.threshold
163
- end
158
+ # The value to compare with the specified statistic.
159
+ # @return [Float]
160
+ def threshold
161
+ data.threshold
162
+ end
164
163
 
165
- # The arithmetic operation to use when comparing the specified statistic
166
- # and threshold. The specified statistic value is used as the first
167
- # operand.
168
- # @return [String]
169
- def comparison_operator
170
- data.comparison_operator
171
- end
164
+ # The arithmetic operation to use when comparing the specified statistic
165
+ # and threshold. The specified statistic value is used as the first
166
+ # operand.
167
+ # @return [String]
168
+ def comparison_operator
169
+ data.comparison_operator
170
+ end
172
171
 
173
- # @!endgroup
172
+ # @return [String]
173
+ def treat_missing_data
174
+ data.treat_missing_data
175
+ end
174
176
 
175
- # @return [Client]
176
- def client
177
- @client
178
- end
177
+ # @return [String]
178
+ def evaluate_low_sample_count_percentile
179
+ data.evaluate_low_sample_count_percentile
180
+ end
179
181
 
180
- # Loads, or reloads {#data} for the current {Alarm}.
181
- # Returns `self` making it possible to chain methods.
182
- #
183
- # alarm.reload.data
184
- #
185
- # @return [self]
186
- def load
187
- resp = @client.describe_alarms(alarm_names: [@name])
188
- @data = resp.metricalarms[0]
189
- self
190
- end
191
- alias :reload :load
192
-
193
- # @return [Types::MetricAlarm]
194
- # Returns the data for this {Alarm}. Calls
195
- # {Client#describe_alarms} if {#data_loaded?} is `false`.
196
- def data
197
- load unless @data
198
- @data
199
- end
182
+ # @!endgroup
200
183
 
201
- # @return [Boolean]
202
- # Returns `true` if this resource is loaded. Accessing attributes or
203
- # {#data} on an unloaded resource will trigger a call to {#load}.
204
- def data_loaded?
205
- !!@data
206
- end
184
+ # @return [Client]
185
+ def client
186
+ @client
187
+ end
207
188
 
208
- # @param [Hash] options ({})
209
- # @return [Boolean]
210
- # Returns `true` if the Alarm exists.
211
- def exists?(options = {})
212
- begin
213
- wait_until_exists(options.merge(max_attempts: 1))
214
- true
215
- rescue Aws::Waiters::Errors::UnexpectedError => e
216
- raise e.error
217
- rescue Aws::Waiters::Errors::WaiterFailed
218
- false
219
- end
220
- end
189
+ # Loads, or reloads {#data} for the current {Alarm}.
190
+ # Returns `self` making it possible to chain methods.
191
+ #
192
+ # alarm.reload.data
193
+ #
194
+ # @return [self]
195
+ def load
196
+ resp = @client.describe_alarms(alarm_names: [@name])
197
+ @data = resp.metricalarms[0]
198
+ self
199
+ end
200
+ alias :reload :load
201
+
202
+ # @return [Types::MetricAlarm]
203
+ # Returns the data for this {Alarm}. Calls
204
+ # {Client#describe_alarms} if {#data_loaded?} is `false`.
205
+ def data
206
+ load unless @data
207
+ @data
208
+ end
221
209
 
222
- # @param [Hash] options ({})
223
- # @option options [Integer] :max_attempts (40)
224
- # @option options [Float] :delay (5)
225
- # @option options [Proc] :before_attempt
226
- # @option options [Proc] :before_wait
227
- # @return [Alarm]
228
- def wait_until_exists(options = {})
229
- options, params = separate_params_and_options(options)
230
- waiter = Waiters::AlarmExists.new(options)
231
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
232
- waiter.wait(params.merge(alarm_names: [@name]))
233
- Alarm.new({
234
- name: @name,
235
- client: @client
236
- })
237
- end
210
+ # @return [Boolean]
211
+ # Returns `true` if this resource is loaded. Accessing attributes or
212
+ # {#data} on an unloaded resource will trigger a call to {#load}.
213
+ def data_loaded?
214
+ !!@data
215
+ end
238
216
 
239
- # @!group Actions
240
-
241
- # @example Request syntax with placeholder values
242
- #
243
- # alarm.delete()
244
- # @param [Hash] options ({})
245
- # @return [EmptyStructure]
246
- def delete(options = {})
247
- options = Aws::Util.deep_merge(options, alarm_names: [@name])
248
- resp = @client.delete_alarms(options)
249
- resp.data
217
+ # @param [Hash] options ({})
218
+ # @return [Boolean]
219
+ # Returns `true` if the Alarm exists.
220
+ def exists?(options = {})
221
+ begin
222
+ wait_until_exists(options.merge(max_attempts: 1))
223
+ true
224
+ rescue Aws::Waiters::Errors::UnexpectedError => e
225
+ raise e.error
226
+ rescue Aws::Waiters::Errors::WaiterFailed
227
+ false
250
228
  end
229
+ end
251
230
 
252
- # @example Request syntax with placeholder values
253
- #
254
- # alarm.describe_history({
255
- # history_item_type: "ConfigurationUpdate", # accepts ConfigurationUpdate, StateUpdate, Action
256
- # start_date: Time.now,
257
- # end_date: Time.now,
258
- # max_records: 1,
259
- # next_token: "NextToken",
260
- # })
261
- # @param [Hash] options ({})
262
- # @option options [String] :history_item_type
263
- # The type of alarm histories to retrieve.
264
- # @option options [Time,DateTime,Date,Integer,String] :start_date
265
- # The starting date to retrieve alarm history.
266
- # @option options [Time,DateTime,Date,Integer,String] :end_date
267
- # The ending date to retrieve alarm history.
268
- # @option options [Integer] :max_records
269
- # The maximum number of alarm history records to retrieve.
270
- # @option options [String] :next_token
271
- # The token returned by a previous call to indicate that there is more
272
- # data available.
273
- # @return [Types::DescribeAlarmHistoryOutput]
274
- def describe_history(options = {})
275
- options = options.merge(alarm_name: @name)
276
- resp = @client.describe_alarm_history(options)
277
- resp.data
278
- end
231
+ # @param [Hash] options ({})
232
+ # @option options [Integer] :max_attempts (40)
233
+ # @option options [Float] :delay (5)
234
+ # @option options [Proc] :before_attempt
235
+ # @option options [Proc] :before_wait
236
+ # @return [Alarm]
237
+ def wait_until_exists(options = {})
238
+ options, params = separate_params_and_options(options)
239
+ waiter = Waiters::AlarmExists.new(options)
240
+ yield_waiter_and_warn(waiter, &Proc.new) if block_given?
241
+ waiter.wait(params.merge(alarm_names: [@name]))
242
+ Alarm.new({
243
+ name: @name,
244
+ client: @client
245
+ })
246
+ end
279
247
 
280
- # @example Request syntax with placeholder values
281
- #
282
- # alarm.disable_actions()
283
- # @param [Hash] options ({})
284
- # @return [EmptyStructure]
285
- def disable_actions(options = {})
286
- options = Aws::Util.deep_merge(options, alarm_names: [@name])
287
- resp = @client.disable_alarm_actions(options)
288
- resp.data
289
- end
248
+ # @!group Actions
249
+
250
+ # @example Request syntax with placeholder values
251
+ #
252
+ # alarm.delete()
253
+ # @param [Hash] options ({})
254
+ # @return [EmptyStructure]
255
+ def delete(options = {})
256
+ options = Aws::Util.deep_merge(options, alarm_names: [@name])
257
+ resp = @client.delete_alarms(options)
258
+ resp.data
259
+ end
290
260
 
291
- # @example Request syntax with placeholder values
292
- #
293
- # alarm.enable_actions()
294
- # @param [Hash] options ({})
295
- # @return [EmptyStructure]
296
- def enable_actions(options = {})
297
- options = Aws::Util.deep_merge(options, alarm_names: [@name])
298
- resp = @client.enable_alarm_actions(options)
299
- resp.data
300
- end
261
+ # @example Request syntax with placeholder values
262
+ #
263
+ # alarm.describe_history({
264
+ # history_item_type: "ConfigurationUpdate", # accepts ConfigurationUpdate, StateUpdate, Action
265
+ # start_date: Time.now,
266
+ # end_date: Time.now,
267
+ # max_records: 1,
268
+ # next_token: "NextToken",
269
+ # })
270
+ # @param [Hash] options ({})
271
+ # @option options [String] :history_item_type
272
+ # The type of alarm histories to retrieve.
273
+ # @option options [Time,DateTime,Date,Integer,String] :start_date
274
+ # The starting date to retrieve alarm history.
275
+ # @option options [Time,DateTime,Date,Integer,String] :end_date
276
+ # The ending date to retrieve alarm history.
277
+ # @option options [Integer] :max_records
278
+ # The maximum number of alarm history records to retrieve.
279
+ # @option options [String] :next_token
280
+ # The token returned by a previous call to indicate that there is more
281
+ # data available.
282
+ # @return [Types::DescribeAlarmHistoryOutput]
283
+ def describe_history(options = {})
284
+ options = options.merge(alarm_name: @name)
285
+ resp = @client.describe_alarm_history(options)
286
+ resp.data
287
+ end
301
288
 
302
- # @example Request syntax with placeholder values
303
- #
304
- # alarm.set_state({
305
- # state_value: "OK", # required, accepts OK, ALARM, INSUFFICIENT_DATA
306
- # state_reason: "StateReason", # required
307
- # state_reason_data: "StateReasonData",
308
- # })
309
- # @param [Hash] options ({})
310
- # @option options [required, String] :state_value
311
- # The value of the state.
312
- # @option options [required, String] :state_reason
313
- # The reason that this alarm is set to this specific state, in text
314
- # format.
315
- # @option options [String] :state_reason_data
316
- # The reason that this alarm is set to this specific state, in JSON
317
- # format.
318
- # @return [EmptyStructure]
319
- def set_state(options = {})
320
- options = options.merge(alarm_name: @name)
321
- resp = @client.set_alarm_state(options)
322
- resp.data
323
- end
289
+ # @example Request syntax with placeholder values
290
+ #
291
+ # alarm.disable_actions()
292
+ # @param [Hash] options ({})
293
+ # @return [EmptyStructure]
294
+ def disable_actions(options = {})
295
+ options = Aws::Util.deep_merge(options, alarm_names: [@name])
296
+ resp = @client.disable_alarm_actions(options)
297
+ resp.data
298
+ end
324
299
 
325
- # @!group Associations
300
+ # @example Request syntax with placeholder values
301
+ #
302
+ # alarm.enable_actions()
303
+ # @param [Hash] options ({})
304
+ # @return [EmptyStructure]
305
+ def enable_actions(options = {})
306
+ options = Aws::Util.deep_merge(options, alarm_names: [@name])
307
+ resp = @client.enable_alarm_actions(options)
308
+ resp.data
309
+ end
326
310
 
327
- # @return [Metric, nil]
328
- def metric
329
- if data.namespace && data.metric_name
330
- Metric.new(
331
- namespace: data.namespace,
332
- name: data.metric_name,
333
- client: @client
334
- )
335
- else
336
- nil
337
- end
338
- end
311
+ # @example Request syntax with placeholder values
312
+ #
313
+ # alarm.set_state({
314
+ # state_value: "OK", # required, accepts OK, ALARM, INSUFFICIENT_DATA
315
+ # state_reason: "StateReason", # required
316
+ # state_reason_data: "StateReasonData",
317
+ # })
318
+ # @param [Hash] options ({})
319
+ # @option options [required, String] :state_value
320
+ # The value of the state.
321
+ # @option options [required, String] :state_reason
322
+ # The reason that this alarm is set to this specific state, in text
323
+ # format.
324
+ # @option options [String] :state_reason_data
325
+ # The reason that this alarm is set to this specific state, in JSON
326
+ # format.
327
+ # @return [EmptyStructure]
328
+ def set_state(options = {})
329
+ options = options.merge(alarm_name: @name)
330
+ resp = @client.set_alarm_state(options)
331
+ resp.data
332
+ end
339
333
 
340
- # @deprecated
341
- # @api private
342
- def identifiers
343
- { name: @name }
334
+ # @!group Associations
335
+
336
+ # @return [Metric, nil]
337
+ def metric
338
+ if data.namespace && data.metric_name
339
+ Metric.new(
340
+ namespace: data.namespace,
341
+ name: data.metric_name,
342
+ client: @client
343
+ )
344
+ else
345
+ nil
344
346
  end
345
- deprecated(:identifiers)
347
+ end
346
348
 
347
- private
349
+ # @deprecated
350
+ # @api private
351
+ def identifiers
352
+ { name: @name }
353
+ end
354
+ deprecated(:identifiers)
348
355
 
349
- def extract_name(args, options)
350
- value = args[0] || options.delete(:name)
351
- case value
352
- when String then value
353
- when nil then raise ArgumentError, "missing required option :name"
354
- else
355
- msg = "expected :name to be a String, got #{value.class}"
356
- raise ArgumentError, msg
357
- end
356
+ private
357
+
358
+ def extract_name(args, options)
359
+ value = args[0] || options.delete(:name)
360
+ case value
361
+ when String then value
362
+ when nil then raise ArgumentError, "missing required option :name"
363
+ else
364
+ msg = "expected :name to be a String, got #{value.class}"
365
+ raise ArgumentError, msg
358
366
  end
367
+ end
359
368
 
360
- def yield_waiter_and_warn(waiter, &block)
361
- if !@waiter_block_warned
362
- msg = "pass options to configure the waiter; "
363
- msg << "yielding the waiter is deprecated"
364
- warn(msg)
365
- @waiter_block_warned = true
366
- end
367
- yield(waiter.waiter)
369
+ def yield_waiter_and_warn(waiter, &block)
370
+ if !@waiter_block_warned
371
+ msg = "pass options to configure the waiter; "
372
+ msg << "yielding the waiter is deprecated"
373
+ warn(msg)
374
+ @waiter_block_warned = true
368
375
  end
376
+ yield(waiter.waiter)
377
+ end
369
378
 
370
- def separate_params_and_options(options)
371
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
372
- waiter_opts = {}
373
- waiter_params = {}
374
- options.each_pair do |key, value|
375
- if opts.include?(key)
376
- waiter_opts[key] = value
377
- else
378
- waiter_params[key] = value
379
- end
379
+ def separate_params_and_options(options)
380
+ opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
381
+ waiter_opts = {}
382
+ waiter_params = {}
383
+ options.each_pair do |key, value|
384
+ if opts.include?(key)
385
+ waiter_opts[key] = value
386
+ else
387
+ waiter_params[key] = value
380
388
  end
381
- waiter_opts[:client] ||= @client
382
- [waiter_opts, waiter_params]
383
389
  end
390
+ waiter_opts[:client] ||= @client
391
+ [waiter_opts, waiter_params]
392
+ end
393
+
394
+ class Collection < Aws::Resources::Collection
395
+
396
+ # @!group Batch Actions
384
397
 
385
- class Collection < Aws::Resources::Collection
386
-
387
- # @!group Batch Actions
388
-
389
- # @example Request syntax with placeholder values
390
- #
391
- # alarm.batch_delete!()
392
- # @param options ({})
393
- # @return [void]
394
- def batch_delete!(options = {})
395
- batch_enum.each do |batch|
396
- params = Aws::Util.copy_hash(options)
397
- params[:alarm_names] ||= []
398
- batch.each do |item|
399
- params[:alarm_names] << {
400
- name: item.name
401
- }
402
- end
403
- batch[0].client.delete_alarms(params)
398
+ # @param options ({})
399
+ # @return [void]
400
+ def batch_delete!(options = {})
401
+ batch_enum.each do |batch|
402
+ params = Aws::Util.copy_hash(options)
403
+ params[:alarm_names] ||= []
404
+ batch.each do |item|
405
+ params[:alarm_names] << {
406
+ name: item.name
407
+ }
404
408
  end
405
- nil
409
+ batch[0].client.delete_alarms(params)
406
410
  end
407
-
408
- # @example Request syntax with placeholder values
409
- #
410
- # alarm.batch_disable_actions()
411
- # @param options ({})
412
- # @return [void]
413
- def batch_disable_actions(options = {})
414
- batch_enum.each do |batch|
415
- params = Aws::Util.copy_hash(options)
416
- params[:alarm_names] ||= []
417
- batch.each do |item|
418
- params[:alarm_names] << {
419
- name: item.name
420
- }
421
- end
422
- batch[0].client.disable_alarm_actions(params)
411
+ nil
412
+ end
413
+
414
+ # @param options ({})
415
+ # @return [void]
416
+ def batch_disable_actions(options = {})
417
+ batch_enum.each do |batch|
418
+ params = Aws::Util.copy_hash(options)
419
+ params[:alarm_names] ||= []
420
+ batch.each do |item|
421
+ params[:alarm_names] << {
422
+ name: item.name
423
+ }
423
424
  end
424
- nil
425
+ batch[0].client.disable_alarm_actions(params)
425
426
  end
426
-
427
- # @example Request syntax with placeholder values
428
- #
429
- # alarm.batch_enable_actions()
430
- # @param options ({})
431
- # @return [void]
432
- def batch_enable_actions(options = {})
433
- batch_enum.each do |batch|
434
- params = Aws::Util.copy_hash(options)
435
- params[:alarm_names] ||= []
436
- batch.each do |item|
437
- params[:alarm_names] << {
438
- name: item.name
439
- }
440
- end
441
- batch[0].client.enable_alarm_actions(params)
427
+ nil
428
+ end
429
+
430
+ # @param options ({})
431
+ # @return [void]
432
+ def batch_enable_actions(options = {})
433
+ batch_enum.each do |batch|
434
+ params = Aws::Util.copy_hash(options)
435
+ params[:alarm_names] ||= []
436
+ batch.each do |item|
437
+ params[:alarm_names] << {
438
+ name: item.name
439
+ }
442
440
  end
443
- nil
441
+ batch[0].client.enable_alarm_actions(params)
444
442
  end
443
+ nil
444
+ end
445
445
 
446
- # @!endgroup
446
+ # @!endgroup
447
447
 
448
- end
449
448
  end
450
449
  end
451
450
  end