aws-sdk-iam 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,744 @@
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
+ module Aws
9
+ module IAM
10
+ class User
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
26
+
27
+ # @!group Read-Only Attributes
28
+
29
+ # @return [String]
30
+ def name
31
+ @name
32
+ end
33
+ alias :user_name :name
34
+
35
+ # The path to the user. For more information about paths, see [IAM
36
+ # Identifiers][1] in the *Using IAM* guide.
37
+ #
38
+ #
39
+ #
40
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
41
+ # @return [String]
42
+ def path
43
+ data.path
44
+ end
45
+
46
+ # The stable and unique string identifying the user. For more
47
+ # information about IDs, see [IAM Identifiers][1] in the *Using IAM*
48
+ # guide.
49
+ #
50
+ #
51
+ #
52
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
53
+ # @return [String]
54
+ def user_id
55
+ data.user_id
56
+ end
57
+
58
+ # The Amazon Resource Name (ARN) that identifies the user. For more
59
+ # information about ARNs and how to use ARNs in policies, see [IAM
60
+ # Identifiers][1] in the *Using IAM* guide.
61
+ #
62
+ #
63
+ #
64
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
65
+ # @return [String]
66
+ def arn
67
+ data.arn
68
+ end
69
+
70
+ # The date and time, in [ISO 8601 date-time format][1], when the user
71
+ # was created.
72
+ #
73
+ #
74
+ #
75
+ # [1]: http://www.iso.org/iso/iso8601
76
+ # @return [Time]
77
+ def create_date
78
+ data.create_date
79
+ end
80
+
81
+ # The date and time, in [ISO 8601 date-time format][1], when the user's
82
+ # password was last used to sign in to an AWS website. For a list of AWS
83
+ # websites that capture a user's last sign-in time, see the [Credential
84
+ # Reports][2] topic in the *Using IAM* guide. If a password is used more
85
+ # than once in a five-minute span, only the first use is returned in
86
+ # this field. This field is null (not present) when:
87
+ #
88
+ # * The user does not have a password
89
+ #
90
+ # * The password exists but has never been used (at least not since IAM
91
+ # started tracking this information on October 20th, 2014
92
+ #
93
+ # * there is no sign-in data associated with the user
94
+ #
95
+ # This value is returned only in the GetUser and ListUsers actions.
96
+ #
97
+ #
98
+ #
99
+ # [1]: http://www.iso.org/iso/iso8601
100
+ # [2]: http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.html
101
+ # @return [Time]
102
+ def password_last_used
103
+ data.password_last_used
104
+ end
105
+
106
+ # @!endgroup
107
+
108
+ # @return [Client]
109
+ def client
110
+ @client
111
+ end
112
+
113
+ # Loads, or reloads {#data} for the current {User}.
114
+ # Returns `self` making it possible to chain methods.
115
+ #
116
+ # user.reload.data
117
+ #
118
+ # @return [self]
119
+ def load
120
+ resp = @client.get_user(user_name: @name)
121
+ @data = resp.user
122
+ self
123
+ end
124
+ alias :reload :load
125
+
126
+ # @return [Types::User]
127
+ # Returns the data for this {User}. Calls
128
+ # {Client#get_user} if {#data_loaded?} is `false`.
129
+ def data
130
+ load unless @data
131
+ @data
132
+ end
133
+
134
+ # @return [Boolean]
135
+ # Returns `true` if this resource is loaded. Accessing attributes or
136
+ # {#data} on an unloaded resource will trigger a call to {#load}.
137
+ def data_loaded?
138
+ !!@data
139
+ end
140
+
141
+ # @param [Hash] options ({})
142
+ # @return [Boolean]
143
+ # Returns `true` if the User exists.
144
+ def exists?(options = {})
145
+ begin
146
+ wait_until_exists(options.merge(max_attempts: 1))
147
+ true
148
+ rescue Aws::Waiters::Errors::UnexpectedError => e
149
+ raise e.error
150
+ rescue Aws::Waiters::Errors::WaiterFailed
151
+ false
152
+ end
153
+ end
154
+
155
+ # @param [Hash] options ({})
156
+ # @option options [Integer] :max_attempts (20)
157
+ # @option options [Float] :delay (1)
158
+ # @option options [Proc] :before_attempt
159
+ # @option options [Proc] :before_wait
160
+ # @return [User]
161
+ def wait_until_exists(options = {})
162
+ options, params = separate_params_and_options(options)
163
+ waiter = Waiters::UserExists.new(options)
164
+ yield_waiter_and_warn(waiter, &Proc.new) if block_given?
165
+ waiter.wait(params.merge(user_name: @name))
166
+ User.new({
167
+ name: @name,
168
+ client: @client
169
+ })
170
+ end
171
+
172
+ # @!group Actions
173
+
174
+ # @example Request syntax with placeholder values
175
+ #
176
+ # user.add_group({
177
+ # group_name: "groupNameType", # required
178
+ # })
179
+ # @param [Hash] options ({})
180
+ # @option options [required, String] :group_name
181
+ # The name of the group to update.
182
+ #
183
+ # The [regex pattern][1] for this parameter is a string of characters
184
+ # consisting of upper and lowercase alphanumeric characters with no
185
+ # spaces. You can also include any of the following characters: =,.@-
186
+ #
187
+ #
188
+ #
189
+ # [1]: http://wikipedia.org/wiki/regex
190
+ # @return [EmptyStructure]
191
+ def add_group(options = {})
192
+ options = options.merge(user_name: @name)
193
+ resp = @client.add_user_to_group(options)
194
+ resp.data
195
+ end
196
+
197
+ # @example Request syntax with placeholder values
198
+ #
199
+ # user.attach_policy({
200
+ # policy_arn: "arnType", # required
201
+ # })
202
+ # @param [Hash] options ({})
203
+ # @option options [required, String] :policy_arn
204
+ # The Amazon Resource Name (ARN) of the IAM policy you want to attach.
205
+ #
206
+ # For more information about ARNs, see [Amazon Resource Names (ARNs) and
207
+ # AWS Service Namespaces][1] in the *AWS General Reference*.
208
+ #
209
+ #
210
+ #
211
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
212
+ # @return [EmptyStructure]
213
+ def attach_policy(options = {})
214
+ options = options.merge(user_name: @name)
215
+ resp = @client.attach_user_policy(options)
216
+ resp.data
217
+ end
218
+
219
+ # @example Request syntax with placeholder values
220
+ #
221
+ # user = user.create({
222
+ # path: "pathType",
223
+ # })
224
+ # @param [Hash] options ({})
225
+ # @option options [String] :path
226
+ # The path for the user name. For more information about paths, see [IAM
227
+ # Identifiers][1] in the *IAM User Guide*.
228
+ #
229
+ # This parameter is optional. If it is not included, it defaults to a
230
+ # slash (/).
231
+ #
232
+ # The [regex pattern][2] for this parameter is a string of characters
233
+ # consisting of either a forward slash (/) by itself or a string that
234
+ # must begin and end with forward slashes, containing any ASCII
235
+ # character from the ! (\\u0021) thru the DEL character (\\u007F),
236
+ # including most punctuation characters, digits, and upper and
237
+ # lowercased letters.
238
+ #
239
+ #
240
+ #
241
+ # [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
242
+ # [2]: http://wikipedia.org/wiki/regex
243
+ # @return [User]
244
+ def create(options = {})
245
+ options = options.merge(user_name: @name)
246
+ resp = @client.create_user(options)
247
+ User.new(
248
+ name: options[:user_name],
249
+ data: resp.data.user,
250
+ client: @client
251
+ )
252
+ end
253
+
254
+ # @example Request syntax with placeholder values
255
+ #
256
+ # accesskeypair = user.create_access_key_pair()
257
+ # @param [Hash] options ({})
258
+ # @return [AccessKeyPair]
259
+ def create_access_key_pair(options = {})
260
+ options = options.merge(user_name: @name)
261
+ resp = @client.create_access_key(options)
262
+ AccessKeyPair.new(
263
+ user_name: @name,
264
+ id: resp.data.access_key.access_key_id,
265
+ secret: resp.data.access_key.secret_access_key,
266
+ data: resp.data.access_key,
267
+ client: @client
268
+ )
269
+ end
270
+
271
+ # @example Request syntax with placeholder values
272
+ #
273
+ # loginprofile = user.create_login_profile({
274
+ # password: "passwordType", # required
275
+ # password_reset_required: false,
276
+ # })
277
+ # @param [Hash] options ({})
278
+ # @option options [required, String] :password
279
+ # The new password for the user.
280
+ #
281
+ # The [regex pattern][1] for this parameter is a string of characters
282
+ # consisting of almost any printable ASCII character from the space
283
+ # (\\u0020) through the end of the ASCII character range (\\u00FF). You
284
+ # can also include the tab (\\u0009), line feed (\\u000A), and carriage
285
+ # return (\\u000D) characters. Although any of these characters are
286
+ # valid in a password, note that many tools, such as the AWS Management
287
+ # Console, might restrict the ability to enter certain characters
288
+ # because they have special meaning within that tool.
289
+ #
290
+ #
291
+ #
292
+ # [1]: http://wikipedia.org/wiki/regex
293
+ # @option options [Boolean] :password_reset_required
294
+ # Specifies whether the user is required to set a new password on next
295
+ # sign-in.
296
+ # @return [LoginProfile]
297
+ def create_login_profile(options = {})
298
+ options = options.merge(user_name: @name)
299
+ resp = @client.create_login_profile(options)
300
+ LoginProfile.new(
301
+ user_name: resp.data.login_profile.user_name,
302
+ data: resp.data.login_profile,
303
+ client: @client
304
+ )
305
+ end
306
+
307
+ # @example Request syntax with placeholder values
308
+ #
309
+ # userpolicy = user.create_policy({
310
+ # policy_name: "policyNameType", # required
311
+ # policy_document: "policyDocumentType", # required
312
+ # })
313
+ # @param [Hash] options ({})
314
+ # @option options [required, String] :policy_name
315
+ # The name of the policy document.
316
+ #
317
+ # The [regex pattern][1] for this parameter is a string of characters
318
+ # consisting of upper and lowercase alphanumeric characters with no
319
+ # spaces. You can also include any of the following characters: =,.@-
320
+ #
321
+ #
322
+ #
323
+ # [1]: http://wikipedia.org/wiki/regex
324
+ # @option options [required, String] :policy_document
325
+ # The policy document.
326
+ #
327
+ # The [regex pattern][1] for this parameter is a string of characters
328
+ # consisting of any printable ASCII character ranging from the space
329
+ # character (\\u0020) through end of the ASCII character range
330
+ # (\\u00FF). It also includes the special characters tab (\\u0009), line
331
+ # feed (\\u000A), and carriage return (\\u000D).
332
+ #
333
+ #
334
+ #
335
+ # [1]: http://wikipedia.org/wiki/regex
336
+ # @return [UserPolicy]
337
+ def create_policy(options = {})
338
+ options = options.merge(user_name: @name)
339
+ resp = @client.put_user_policy(options)
340
+ UserPolicy.new(
341
+ user_name: @name,
342
+ name: options[:policy_name],
343
+ client: @client
344
+ )
345
+ end
346
+
347
+ # @example Request syntax with placeholder values
348
+ #
349
+ # user.delete()
350
+ # @param [Hash] options ({})
351
+ # @return [EmptyStructure]
352
+ def delete(options = {})
353
+ options = options.merge(user_name: @name)
354
+ resp = @client.delete_user(options)
355
+ resp.data
356
+ end
357
+
358
+ # @example Request syntax with placeholder values
359
+ #
360
+ # user.detach_policy({
361
+ # policy_arn: "arnType", # required
362
+ # })
363
+ # @param [Hash] options ({})
364
+ # @option options [required, String] :policy_arn
365
+ # The Amazon Resource Name (ARN) of the IAM policy you want to detach.
366
+ #
367
+ # For more information about ARNs, see [Amazon Resource Names (ARNs) and
368
+ # AWS Service Namespaces][1] in the *AWS General Reference*.
369
+ #
370
+ #
371
+ #
372
+ # [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
373
+ # @return [EmptyStructure]
374
+ def detach_policy(options = {})
375
+ options = options.merge(user_name: @name)
376
+ resp = @client.detach_user_policy(options)
377
+ resp.data
378
+ end
379
+
380
+ # @example Request syntax with placeholder values
381
+ #
382
+ # mfadevice = user.enable_mfa({
383
+ # serial_number: "serialNumberType", # required
384
+ # authentication_code_1: "authenticationCodeType", # required
385
+ # authentication_code_2: "authenticationCodeType", # required
386
+ # })
387
+ # @param [Hash] options ({})
388
+ # @option options [required, String] :serial_number
389
+ # The serial number that uniquely identifies the MFA device. For virtual
390
+ # MFA devices, the serial number is the device ARN.
391
+ #
392
+ # The [regex pattern][1] for this parameter is a string of characters
393
+ # consisting of upper and lowercase alphanumeric characters with no
394
+ # spaces. You can also include any of the following characters: =/:,.@-
395
+ #
396
+ #
397
+ #
398
+ # [1]: http://wikipedia.org/wiki/regex
399
+ # @option options [required, String] :authentication_code_1
400
+ # An authentication code emitted by the device.
401
+ #
402
+ # The format for this parameter is a string of 6 digits.
403
+ # @option options [required, String] :authentication_code_2
404
+ # A subsequent authentication code emitted by the device.
405
+ #
406
+ # The format for this parameter is a string of 6 digits.
407
+ # @return [MfaDevice]
408
+ def enable_mfa(options = {})
409
+ options = options.merge(user_name: @name)
410
+ resp = @client.enable_mfa_device(options)
411
+ MfaDevice.new(
412
+ user_name: @name,
413
+ serial_number: options[:serial_number],
414
+ client: @client
415
+ )
416
+ end
417
+
418
+ # @example Request syntax with placeholder values
419
+ #
420
+ # user.remove_group({
421
+ # group_name: "groupNameType", # required
422
+ # })
423
+ # @param [Hash] options ({})
424
+ # @option options [required, String] :group_name
425
+ # The name of the group to update.
426
+ #
427
+ # The [regex pattern][1] for this parameter is a string of characters
428
+ # consisting of upper and lowercase alphanumeric characters with no
429
+ # spaces. You can also include any of the following characters: =,.@-
430
+ #
431
+ #
432
+ #
433
+ # [1]: http://wikipedia.org/wiki/regex
434
+ # @return [EmptyStructure]
435
+ def remove_group(options = {})
436
+ options = options.merge(user_name: @name)
437
+ resp = @client.remove_user_from_group(options)
438
+ resp.data
439
+ end
440
+
441
+ # @example Request syntax with placeholder values
442
+ #
443
+ # user = user.update({
444
+ # new_path: "pathType",
445
+ # new_user_name: "userNameType",
446
+ # })
447
+ # @param [Hash] options ({})
448
+ # @option options [String] :new_path
449
+ # New path for the IAM user. Include this parameter only if you're
450
+ # changing the user's path.
451
+ #
452
+ # The [regex pattern][1] for this parameter is a string of characters
453
+ # consisting of either a forward slash (/) by itself or a string that
454
+ # must begin and end with forward slashes, containing any ASCII
455
+ # character from the ! (\\u0021) thru the DEL character (\\u007F),
456
+ # including most punctuation characters, digits, and upper and
457
+ # lowercased letters.
458
+ #
459
+ #
460
+ #
461
+ # [1]: http://wikipedia.org/wiki/regex
462
+ # @option options [String] :new_user_name
463
+ # New name for the user. Include this parameter only if you're changing
464
+ # the user's name.
465
+ #
466
+ # The [regex pattern][1] for this parameter is a string of characters
467
+ # consisting of upper and lowercase alphanumeric characters with no
468
+ # spaces. You can also include any of the following characters: =,.@-
469
+ #
470
+ #
471
+ #
472
+ # [1]: http://wikipedia.org/wiki/regex
473
+ # @return [User]
474
+ def update(options = {})
475
+ options = options.merge(user_name: @name)
476
+ resp = @client.update_user(options)
477
+ User.new(
478
+ name: options[:new_user_name],
479
+ client: @client
480
+ )
481
+ end
482
+
483
+ # @!group Associations
484
+
485
+ # @param [String] id
486
+ # @return [AccessKey]
487
+ def access_key(id)
488
+ AccessKey.new(
489
+ user_name: @name,
490
+ id: id,
491
+ client: @client
492
+ )
493
+ end
494
+
495
+ # @example Request syntax with placeholder values
496
+ #
497
+ # accesskeys = user.access_keys()
498
+ # @param [Hash] options ({})
499
+ # @return [AccessKey::Collection]
500
+ def access_keys(options = {})
501
+ batches = Enumerator.new do |y|
502
+ options = options.merge(user_name: @name)
503
+ resp = @client.list_access_keys(options)
504
+ resp.each_page do |page|
505
+ batch = []
506
+ page.data.access_key_metadata.each do |a|
507
+ batch << AccessKey.new(
508
+ user_name: @name,
509
+ id: a.access_key_id,
510
+ data: a,
511
+ client: @client
512
+ )
513
+ end
514
+ y.yield(batch)
515
+ end
516
+ end
517
+ AccessKey::Collection.new(batches)
518
+ end
519
+
520
+ # @example Request syntax with placeholder values
521
+ #
522
+ # attachedpolicies = user.attached_policies({
523
+ # path_prefix: "policyPathType",
524
+ # })
525
+ # @param [Hash] options ({})
526
+ # @option options [String] :path_prefix
527
+ # The path prefix for filtering the results. This parameter is optional.
528
+ # If it is not included, it defaults to a slash (/), listing all
529
+ # policies.
530
+ #
531
+ # The [regex pattern][1] for this parameter is a string of characters
532
+ # consisting of either a forward slash (/) by itself or a string that
533
+ # must begin and end with forward slashes, containing any ASCII
534
+ # character from the ! (\\u0021) thru the DEL character (\\u007F),
535
+ # including most punctuation characters, digits, and upper and
536
+ # lowercased letters.
537
+ #
538
+ #
539
+ #
540
+ # [1]: http://wikipedia.org/wiki/regex
541
+ # @return [Policy::Collection]
542
+ def attached_policies(options = {})
543
+ batches = Enumerator.new do |y|
544
+ options = options.merge(user_name: @name)
545
+ resp = @client.list_attached_user_policies(options)
546
+ resp.each_page do |page|
547
+ batch = []
548
+ page.data.attached_policies.each do |a|
549
+ batch << Policy.new(
550
+ arn: a.policy_arn,
551
+ client: @client
552
+ )
553
+ end
554
+ y.yield(batch)
555
+ end
556
+ end
557
+ Policy::Collection.new(batches)
558
+ end
559
+
560
+ # @example Request syntax with placeholder values
561
+ #
562
+ # groups = user.groups()
563
+ # @param [Hash] options ({})
564
+ # @return [Group::Collection]
565
+ def groups(options = {})
566
+ batches = Enumerator.new do |y|
567
+ options = options.merge(user_name: @name)
568
+ resp = @client.list_groups_for_user(options)
569
+ resp.each_page do |page|
570
+ batch = []
571
+ page.data.groups.each do |g|
572
+ batch << Group.new(
573
+ name: g.group_name,
574
+ data: g,
575
+ client: @client
576
+ )
577
+ end
578
+ y.yield(batch)
579
+ end
580
+ end
581
+ Group::Collection.new(batches)
582
+ end
583
+
584
+ # @return [LoginProfile]
585
+ def login_profile
586
+ LoginProfile.new(
587
+ user_name: @name,
588
+ client: @client
589
+ )
590
+ end
591
+
592
+ # @param [String] serial_number
593
+ # @return [MfaDevice]
594
+ def mfa_device(serial_number)
595
+ MfaDevice.new(
596
+ user_name: @name,
597
+ serial_number: serial_number,
598
+ client: @client
599
+ )
600
+ end
601
+
602
+ # @example Request syntax with placeholder values
603
+ #
604
+ # mfadevices = user.mfa_devices()
605
+ # @param [Hash] options ({})
606
+ # @return [MfaDevice::Collection]
607
+ def mfa_devices(options = {})
608
+ batches = Enumerator.new do |y|
609
+ options = options.merge(user_name: @name)
610
+ resp = @client.list_mfa_devices(options)
611
+ resp.each_page do |page|
612
+ batch = []
613
+ page.data.mfa_devices.each do |m|
614
+ batch << MfaDevice.new(
615
+ user_name: @name,
616
+ serial_number: m.serial_number,
617
+ data: m,
618
+ client: @client
619
+ )
620
+ end
621
+ y.yield(batch)
622
+ end
623
+ end
624
+ MfaDevice::Collection.new(batches)
625
+ end
626
+
627
+ # @example Request syntax with placeholder values
628
+ #
629
+ # policies = user.policies()
630
+ # @param [Hash] options ({})
631
+ # @return [UserPolicy::Collection]
632
+ def policies(options = {})
633
+ batches = Enumerator.new do |y|
634
+ options = options.merge(user_name: @name)
635
+ resp = @client.list_user_policies(options)
636
+ resp.each_page do |page|
637
+ batch = []
638
+ page.data.policy_names.each do |p|
639
+ batch << UserPolicy.new(
640
+ user_name: @name,
641
+ name: p,
642
+ client: @client
643
+ )
644
+ end
645
+ y.yield(batch)
646
+ end
647
+ end
648
+ UserPolicy::Collection.new(batches)
649
+ end
650
+
651
+ # @param [String] name
652
+ # @return [UserPolicy]
653
+ def policy(name)
654
+ UserPolicy.new(
655
+ user_name: @name,
656
+ name: name,
657
+ client: @client
658
+ )
659
+ end
660
+
661
+ # @param [String] id
662
+ # @return [SigningCertificate]
663
+ def signing_certificate(id)
664
+ SigningCertificate.new(
665
+ user_name: @name,
666
+ id: id,
667
+ client: @client
668
+ )
669
+ end
670
+
671
+ # @example Request syntax with placeholder values
672
+ #
673
+ # signingcertificates = user.signing_certificates()
674
+ # @param [Hash] options ({})
675
+ # @return [SigningCertificate::Collection]
676
+ def signing_certificates(options = {})
677
+ batches = Enumerator.new do |y|
678
+ options = options.merge(user_name: @name)
679
+ resp = @client.list_signing_certificates(options)
680
+ resp.each_page do |page|
681
+ batch = []
682
+ page.data.certificates.each do |c|
683
+ batch << SigningCertificate.new(
684
+ user_name: @name,
685
+ id: c.certificate_id,
686
+ data: c,
687
+ client: @client
688
+ )
689
+ end
690
+ y.yield(batch)
691
+ end
692
+ end
693
+ SigningCertificate::Collection.new(batches)
694
+ end
695
+
696
+ # @deprecated
697
+ # @api private
698
+ def identifiers
699
+ { name: @name }
700
+ end
701
+ deprecated(:identifiers)
702
+
703
+ private
704
+
705
+ def extract_name(args, options)
706
+ value = args[0] || options.delete(:name)
707
+ case value
708
+ when String then value
709
+ when nil then raise ArgumentError, "missing required option :name"
710
+ else
711
+ msg = "expected :name to be a String, got #{value.class}"
712
+ raise ArgumentError, msg
713
+ end
714
+ end
715
+
716
+ def yield_waiter_and_warn(waiter, &block)
717
+ if !@waiter_block_warned
718
+ msg = "pass options to configure the waiter; "
719
+ msg << "yielding the waiter is deprecated"
720
+ warn(msg)
721
+ @waiter_block_warned = true
722
+ end
723
+ yield(waiter.waiter)
724
+ end
725
+
726
+ def separate_params_and_options(options)
727
+ opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
728
+ waiter_opts = {}
729
+ waiter_params = {}
730
+ options.each_pair do |key, value|
731
+ if opts.include?(key)
732
+ waiter_opts[key] = value
733
+ else
734
+ waiter_params[key] = value
735
+ end
736
+ end
737
+ waiter_opts[:client] ||= @client
738
+ [waiter_opts, waiter_params]
739
+ end
740
+
741
+ class Collection < Aws::Resources::Collection; end
742
+ end
743
+ end
744
+ end