aws-sdk-s3 1.61.1 → 1.61.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -407,7 +407,8 @@ module Aws::S3
407
407
  # Waiter polls an API operation until a resource enters a desired
408
408
  # state.
409
409
  #
410
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
410
+ # @note The waiting operation is performed on a copy. The original resource
411
+ # remains unchanged.
411
412
  #
412
413
  # ## Basic Usage
413
414
  #
@@ -420,13 +421,15 @@ module Aws::S3
420
421
  #
421
422
  # ## Example
422
423
  #
423
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
424
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
425
+ # instance.state.name == 'running'
426
+ # end
424
427
  #
425
428
  # ## Configuration
426
429
  #
427
430
  # You can configure the maximum number of polling attempts, and the
428
- # delay (in seconds) between each polling attempt. The waiting condition is set
429
- # by passing a block to {#wait_until}:
431
+ # delay (in seconds) between each polling attempt. The waiting condition is
432
+ # set by passing a block to {#wait_until}:
430
433
  #
431
434
  # # poll for ~25 seconds
432
435
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -457,17 +460,16 @@ module Aws::S3
457
460
  # # resource did not enter the desired state in time
458
461
  # end
459
462
  #
463
+ # @yieldparam [Resource] resource to be used in the waiting condition.
460
464
  #
461
- # @yield param [Resource] resource to be used in the waiting condition
462
- #
463
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
464
- # because the waiter has entered a state that it will not transition
465
- # out of, preventing success.
465
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
466
+ # terminates because the waiter has entered a state that it will not
467
+ # transition out of, preventing success.
466
468
  #
467
469
  # yet successful.
468
470
  #
469
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
470
- # while polling for a resource that is not expected.
471
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
472
+ # encountered while polling for a resource that is not expected.
471
473
  #
472
474
  # @raise [NotImplementedError] Raised when the resource does not
473
475
  #
@@ -1337,7 +1339,9 @@ module Aws::S3
1337
1339
  end
1338
1340
 
1339
1341
  def separate_params_and_options(options)
1340
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
1342
+ opts = Set.new(
1343
+ [:client, :max_attempts, :delay, :before_attempt, :before_wait]
1344
+ )
1341
1345
  waiter_opts = {}
1342
1346
  waiter_params = {}
1343
1347
  options.each_pair do |key, value|
@@ -102,7 +102,8 @@ module Aws::S3
102
102
  # Waiter polls an API operation until a resource enters a desired
103
103
  # state.
104
104
  #
105
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
105
+ # @note The waiting operation is performed on a copy. The original resource
106
+ # remains unchanged.
106
107
  #
107
108
  # ## Basic Usage
108
109
  #
@@ -115,13 +116,15 @@ module Aws::S3
115
116
  #
116
117
  # ## Example
117
118
  #
118
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
119
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
120
+ # instance.state.name == 'running'
121
+ # end
119
122
  #
120
123
  # ## Configuration
121
124
  #
122
125
  # You can configure the maximum number of polling attempts, and the
123
- # delay (in seconds) between each polling attempt. The waiting condition is set
124
- # by passing a block to {#wait_until}:
126
+ # delay (in seconds) between each polling attempt. The waiting condition is
127
+ # set by passing a block to {#wait_until}:
125
128
  #
126
129
  # # poll for ~25 seconds
127
130
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -152,17 +155,16 @@ module Aws::S3
152
155
  # # resource did not enter the desired state in time
153
156
  # end
154
157
  #
158
+ # @yieldparam [Resource] resource to be used in the waiting condition.
155
159
  #
156
- # @yield param [Resource] resource to be used in the waiting condition
157
- #
158
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
159
- # because the waiter has entered a state that it will not transition
160
- # out of, preventing success.
160
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
161
+ # terminates because the waiter has entered a state that it will not
162
+ # transition out of, preventing success.
161
163
  #
162
164
  # yet successful.
163
165
  #
164
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
165
- # while polling for a resource that is not expected.
166
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
167
+ # encountered while polling for a resource that is not expected.
166
168
  #
167
169
  # @raise [NotImplementedError] Raised when the resource does not
168
170
  #
@@ -158,7 +158,8 @@ module Aws::S3
158
158
  # Waiter polls an API operation until a resource enters a desired
159
159
  # state.
160
160
  #
161
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
161
+ # @note The waiting operation is performed on a copy. The original resource
162
+ # remains unchanged.
162
163
  #
163
164
  # ## Basic Usage
164
165
  #
@@ -171,13 +172,15 @@ module Aws::S3
171
172
  #
172
173
  # ## Example
173
174
  #
174
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
175
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
176
+ # instance.state.name == 'running'
177
+ # end
175
178
  #
176
179
  # ## Configuration
177
180
  #
178
181
  # You can configure the maximum number of polling attempts, and the
179
- # delay (in seconds) between each polling attempt. The waiting condition is set
180
- # by passing a block to {#wait_until}:
182
+ # delay (in seconds) between each polling attempt. The waiting condition is
183
+ # set by passing a block to {#wait_until}:
181
184
  #
182
185
  # # poll for ~25 seconds
183
186
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -208,17 +211,16 @@ module Aws::S3
208
211
  # # resource did not enter the desired state in time
209
212
  # end
210
213
  #
214
+ # @yieldparam [Resource] resource to be used in the waiting condition.
211
215
  #
212
- # @yield param [Resource] resource to be used in the waiting condition
213
- #
214
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
215
- # because the waiter has entered a state that it will not transition
216
- # out of, preventing success.
216
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
217
+ # terminates because the waiter has entered a state that it will not
218
+ # transition out of, preventing success.
217
219
  #
218
220
  # yet successful.
219
221
  #
220
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
221
- # while polling for a resource that is not expected.
222
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
223
+ # encountered while polling for a resource that is not expected.
222
224
  #
223
225
  # @raise [NotImplementedError] Raised when the resource does not
224
226
  #
@@ -1097,7 +1099,9 @@ module Aws::S3
1097
1099
  end
1098
1100
 
1099
1101
  def separate_params_and_options(options)
1100
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
1102
+ opts = Set.new(
1103
+ [:client, :max_attempts, :delay, :before_attempt, :before_wait]
1104
+ )
1101
1105
  waiter_opts = {}
1102
1106
  waiter_params = {}
1103
1107
  options.each_pair do |key, value|
@@ -132,7 +132,8 @@ module Aws::S3
132
132
  # Waiter polls an API operation until a resource enters a desired
133
133
  # state.
134
134
  #
135
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
135
+ # @note The waiting operation is performed on a copy. The original resource
136
+ # remains unchanged.
136
137
  #
137
138
  # ## Basic Usage
138
139
  #
@@ -145,13 +146,15 @@ module Aws::S3
145
146
  #
146
147
  # ## Example
147
148
  #
148
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
149
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
150
+ # instance.state.name == 'running'
151
+ # end
149
152
  #
150
153
  # ## Configuration
151
154
  #
152
155
  # You can configure the maximum number of polling attempts, and the
153
- # delay (in seconds) between each polling attempt. The waiting condition is set
154
- # by passing a block to {#wait_until}:
156
+ # delay (in seconds) between each polling attempt. The waiting condition is
157
+ # set by passing a block to {#wait_until}:
155
158
  #
156
159
  # # poll for ~25 seconds
157
160
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -182,17 +185,16 @@ module Aws::S3
182
185
  # # resource did not enter the desired state in time
183
186
  # end
184
187
  #
188
+ # @yieldparam [Resource] resource to be used in the waiting condition.
185
189
  #
186
- # @yield param [Resource] resource to be used in the waiting condition
187
- #
188
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
189
- # because the waiter has entered a state that it will not transition
190
- # out of, preventing success.
190
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
191
+ # terminates because the waiter has entered a state that it will not
192
+ # transition out of, preventing success.
191
193
  #
192
194
  # yet successful.
193
195
  #
194
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
195
- # while polling for a resource that is not expected.
196
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
197
+ # encountered while polling for a resource that is not expected.
196
198
  #
197
199
  # @raise [NotImplementedError] Raised when the resource does not
198
200
  #
@@ -10,7 +10,9 @@ module Aws
10
10
  :delete_objects,
11
11
  :put_bucket_cors,
12
12
  :put_bucket_lifecycle,
13
+ :put_bucket_lifecycle_configuration,
13
14
  :put_bucket_policy,
15
+ :put_bucket_replication,
14
16
  :put_bucket_tagging,
15
17
  :put_object_legal_hold,
16
18
  :put_object_lock_configuration,
@@ -6,13 +6,18 @@
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
8
  module Aws::S3
9
+
9
10
  # This class provides a resource oriented interface for S3.
10
11
  # To create a resource object:
12
+ #
11
13
  # resource = Aws::S3::Resource.new(region: 'us-west-2')
14
+ #
12
15
  # You can supply a client object with custom configuration that will be used for all resource operations.
13
- # If you do not pass +:client+, a default client will be constructed.
16
+ # If you do not pass `:client`, a default client will be constructed.
17
+ #
14
18
  # client = Aws::S3::Client.new(region: 'us-west-2')
15
19
  # resource = Aws::S3::Resource.new(client: client)
20
+ #
16
21
  class Resource
17
22
 
18
23
  # @param options ({})
@@ -8,6 +8,70 @@
8
8
  require 'aws-sdk-core/waiters'
9
9
 
10
10
  module Aws::S3
11
+ # Waiters are utility methods that poll for a particular state to occur
12
+ # on a client. Waiters can fail after a number of attempts at a polling
13
+ # interval defined for the service client.
14
+ #
15
+ # For a list of operations that can be waited for and the
16
+ # client methods called for each operation, see the table below or the
17
+ # {Client#wait_until} field documentation for the {Client}.
18
+ #
19
+ # # Invoking a Waiter
20
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
21
+ # is the waiter name, which is specific to the service client and indicates
22
+ # which operation is being waited for. The second parameter is a hash of
23
+ # parameters that are passed to the client method called by the waiter,
24
+ # which varies according to the waiter name.
25
+ #
26
+ # # Wait Failures
27
+ # To catch errors in a waiter, use WaiterFailed,
28
+ # as shown in the following example.
29
+ #
30
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
31
+ # puts "failed waiting for instance running: #{error.message}
32
+ # end
33
+ #
34
+ # # Configuring a Waiter
35
+ # Each waiter has a default polling interval and a maximum number of
36
+ # attempts it will make before returning control to your program.
37
+ # To set these values, use the `max_attempts` and `delay` parameters
38
+ # in your `#wait_until` call.
39
+ # The following example waits for up to 25 seconds, polling every five seconds.
40
+ #
41
+ # client.wait_until(...) do |w|
42
+ # w.max_attempts = 5
43
+ # w.delay = 5
44
+ # end
45
+ #
46
+ # To disable wait failures, set the value of either of these parameters
47
+ # to `nil`.
48
+ #
49
+ # # Extending a Waiter
50
+ # To modify the behavior of waiters, you can register callbacks that are
51
+ # triggered before each polling attempt and before waiting.
52
+ #
53
+ # The following example implements an exponential backoff in a waiter
54
+ # by doubling the amount of time to wait on every attempt.
55
+ #
56
+ # client.wait_until(...) do |w|
57
+ # w.interval = 0 # disable normal sleep
58
+ # w.before_wait do |n, resp|
59
+ # sleep(n ** 2)
60
+ # end
61
+ # end
62
+ #
63
+ # # Available Waiters
64
+ #
65
+ # The following table lists the valid waiter names, the operations they call,
66
+ # and the default `:delay` and `:max_attempts` values.
67
+ #
68
+ # | waiter_name | params | :delay | :max_attempts |
69
+ # | ----------------- | -------------------- | -------- | ------------- |
70
+ # | bucket_exists | {Client#head_bucket} | 5 | 20 |
71
+ # | bucket_not_exists | {Client#head_bucket} | 5 | 20 |
72
+ # | object_exists | {Client#head_object} | 5 | 20 |
73
+ # | object_not_exists | {Client#head_object} | 5 | 20 |
74
+ #
11
75
  module Waiters
12
76
 
13
77
  class BucketExists
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.61.1
4
+ version: 1.61.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms
@@ -161,7 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  requirements: []
164
- rubygems_version: 3.0.3
164
+ rubyforge_project:
165
+ rubygems_version: 2.5.2.3
165
166
  signing_key:
166
167
  specification_version: 4
167
168
  summary: AWS SDK for Ruby - Amazon S3