aws-sdk-s3 1.3.0 → 1.4.0

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: 76d0991769b92dae1959f3004710b47cdc5e3ff8
4
- data.tar.gz: 1a811e7e066a2f3ae5f771b6e305a4e9eed31f25
3
+ metadata.gz: 2233a38a3bebfab713215b28bebb8608ea3a3f46
4
+ data.tar.gz: c3f50420ace3d6b13126723024d1150e2f1bd949
5
5
  SHA512:
6
- metadata.gz: d276652896ce7673a5a530d0e44beca6143310127864c77f21a17cb79e52ba0962e9fbc025df0f5dfd0cbebdfd37b2915cc7e4e58538fa86447894b93741a6b0
7
- data.tar.gz: bb905e70c8ed09ab22284c64ceff68c22b9c5d42860578611f924e5650f7b1aa5ac51e68314c453d5c997cc8c7c90903a7b4ba9503d147173d1fc77bdaf72ee1
6
+ metadata.gz: 53bc8f859973fa58ac70ae03ed897563ebe77a29c7a8bbacc77d704c207e87c207982bfb1d1b826ab47cbd7e217d82ff9a527e043e711483e7f1968750eb878e
7
+ data.tar.gz: 47f44ffc526d61950c6dc72cadfa988df8ac5c9ad355c9e41ee51e532e6f1cced2570102806c063b1b2de0d6361a549857ff41c40fae1bda4229ddb33c853071
@@ -61,6 +61,6 @@ require_relative 'aws-sdk-s3/customizations'
61
61
  # @service
62
62
  module Aws::S3
63
63
 
64
- GEM_VERSION = '1.3.0'
64
+ GEM_VERSION = '1.4.0'
65
65
 
66
66
  end
@@ -33,7 +33,7 @@ module Aws::S3
33
33
  # Date the bucket was created.
34
34
  # @return [Time]
35
35
  def creation_date
36
- data.creation_date
36
+ data[:creation_date]
37
37
  end
38
38
 
39
39
  # @!endgroup
@@ -114,6 +114,101 @@ module Aws::S3
114
114
  })
115
115
  end
116
116
 
117
+ # @deprecated Use [Aws::S3::Client] #wait_until instead
118
+ #
119
+ # Waiter polls an API operation until a resource enters a desired
120
+ # state.
121
+ #
122
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
123
+ #
124
+ # ## Basic Usage
125
+ #
126
+ # Waiter will polls until it is successful, it fails by
127
+ # entering a terminal state, or until a maximum number of attempts
128
+ # are made.
129
+ #
130
+ # # polls in a loop until condition is true
131
+ # resource.wait_until(options) {|resource| condition}
132
+ #
133
+ # ## Example
134
+ #
135
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
136
+ #
137
+ # ## Configuration
138
+ #
139
+ # You can configure the maximum number of polling attempts, and the
140
+ # delay (in seconds) between each polling attempt. The waiting condition is set
141
+ # by passing a block to {#wait_until}:
142
+ #
143
+ # # poll for ~25 seconds
144
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
145
+ #
146
+ # ## Callbacks
147
+ #
148
+ # You can be notified before each polling attempt and before each
149
+ # delay. If you throw `:success` or `:failure` from these callbacks,
150
+ # it will terminate the waiter.
151
+ #
152
+ # started_at = Time.now
153
+ # # poll for 1 hour, instead of a number of attempts
154
+ # proc = Proc.new do |attempts, response|
155
+ # throw :failure if Time.now - started_at > 3600
156
+ # end
157
+ #
158
+ # # disable max attempts
159
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
160
+ #
161
+ # ## Handling Errors
162
+ #
163
+ # When a waiter is successful, it returns the Resource. When a waiter
164
+ # fails, it raises an error.
165
+ #
166
+ # begin
167
+ # resource.wait_until(...)
168
+ # rescue Aws::Waiters::Errors::WaiterFailed
169
+ # # resource did not enter the desired state in time
170
+ # end
171
+ #
172
+ #
173
+ # @yield param [Resource] resource to be used in the waiting condition
174
+ #
175
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
176
+ # because the waiter has entered a state that it will not transition
177
+ # out of, preventing success.
178
+ #
179
+ # yet successful.
180
+ #
181
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
182
+ # while polling for a resource that is not expected.
183
+ #
184
+ # @raise [NotImplementedError] Raised when the resource does not
185
+ #
186
+ # @option options [Integer] :max_attempts (10) Maximum number of
187
+ # attempts
188
+ # @option options [Integer] :delay (10) Delay between each
189
+ # attempt in seconds
190
+ # @option options [Proc] :before_attempt (nil) Callback
191
+ # invoked before each attempt
192
+ # @option options [Proc] :before_wait (nil) Callback
193
+ # invoked before each wait
194
+ # @return [Resource] if the waiter was successful
195
+ def wait_until(options = {}, &block)
196
+ self_copy = self.dup
197
+ attempts = 0
198
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
199
+ options[:delay] ||= 10
200
+ options[:poller] = Proc.new do
201
+ attempts += 1
202
+ if block.call(self_copy)
203
+ [:success, self_copy]
204
+ else
205
+ self_copy.reload unless attempts == options[:max_attempts]
206
+ :retry
207
+ end
208
+ end
209
+ Aws::Waiters::Waiter.new(options).wait({})
210
+ end
211
+
117
212
  # @!group Actions
118
213
 
119
214
  # @example Request syntax with placeholder values
@@ -32,13 +32,13 @@ module Aws::S3
32
32
 
33
33
  # @return [Types::Owner]
34
34
  def owner
35
- data.owner
35
+ data[:owner]
36
36
  end
37
37
 
38
38
  # A list of grants.
39
39
  # @return [Array<Types::Grant>]
40
40
  def grants
41
- data.grants
41
+ data[:grants]
42
42
  end
43
43
 
44
44
  # @!endgroup
@@ -76,6 +76,101 @@ module Aws::S3
76
76
  !!@data
77
77
  end
78
78
 
79
+ # @deprecated Use [Aws::S3::Client] #wait_until instead
80
+ #
81
+ # Waiter polls an API operation until a resource enters a desired
82
+ # state.
83
+ #
84
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
85
+ #
86
+ # ## Basic Usage
87
+ #
88
+ # Waiter will polls until it is successful, it fails by
89
+ # entering a terminal state, or until a maximum number of attempts
90
+ # are made.
91
+ #
92
+ # # polls in a loop until condition is true
93
+ # resource.wait_until(options) {|resource| condition}
94
+ #
95
+ # ## Example
96
+ #
97
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
98
+ #
99
+ # ## Configuration
100
+ #
101
+ # You can configure the maximum number of polling attempts, and the
102
+ # delay (in seconds) between each polling attempt. The waiting condition is set
103
+ # by passing a block to {#wait_until}:
104
+ #
105
+ # # poll for ~25 seconds
106
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
107
+ #
108
+ # ## Callbacks
109
+ #
110
+ # You can be notified before each polling attempt and before each
111
+ # delay. If you throw `:success` or `:failure` from these callbacks,
112
+ # it will terminate the waiter.
113
+ #
114
+ # started_at = Time.now
115
+ # # poll for 1 hour, instead of a number of attempts
116
+ # proc = Proc.new do |attempts, response|
117
+ # throw :failure if Time.now - started_at > 3600
118
+ # end
119
+ #
120
+ # # disable max attempts
121
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
122
+ #
123
+ # ## Handling Errors
124
+ #
125
+ # When a waiter is successful, it returns the Resource. When a waiter
126
+ # fails, it raises an error.
127
+ #
128
+ # begin
129
+ # resource.wait_until(...)
130
+ # rescue Aws::Waiters::Errors::WaiterFailed
131
+ # # resource did not enter the desired state in time
132
+ # end
133
+ #
134
+ #
135
+ # @yield param [Resource] resource to be used in the waiting condition
136
+ #
137
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
138
+ # because the waiter has entered a state that it will not transition
139
+ # out of, preventing success.
140
+ #
141
+ # yet successful.
142
+ #
143
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
144
+ # while polling for a resource that is not expected.
145
+ #
146
+ # @raise [NotImplementedError] Raised when the resource does not
147
+ #
148
+ # @option options [Integer] :max_attempts (10) Maximum number of
149
+ # attempts
150
+ # @option options [Integer] :delay (10) Delay between each
151
+ # attempt in seconds
152
+ # @option options [Proc] :before_attempt (nil) Callback
153
+ # invoked before each attempt
154
+ # @option options [Proc] :before_wait (nil) Callback
155
+ # invoked before each wait
156
+ # @return [Resource] if the waiter was successful
157
+ def wait_until(options = {}, &block)
158
+ self_copy = self.dup
159
+ attempts = 0
160
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
161
+ options[:delay] ||= 10
162
+ options[:poller] = Proc.new do
163
+ attempts += 1
164
+ if block.call(self_copy)
165
+ [:success, self_copy]
166
+ else
167
+ self_copy.reload unless attempts == options[:max_attempts]
168
+ :retry
169
+ end
170
+ end
171
+ Aws::Waiters::Waiter.new(options).wait({})
172
+ end
173
+
79
174
  # @!group Actions
80
175
 
81
176
  # @example Request syntax with placeholder values
@@ -32,7 +32,7 @@ module Aws::S3
32
32
 
33
33
  # @return [Array<Types::CORSRule>]
34
34
  def cors_rules
35
- data.cors_rules
35
+ data[:cors_rules]
36
36
  end
37
37
 
38
38
  # @!endgroup
@@ -70,6 +70,101 @@ module Aws::S3
70
70
  !!@data
71
71
  end
72
72
 
73
+ # @deprecated Use [Aws::S3::Client] #wait_until instead
74
+ #
75
+ # Waiter polls an API operation until a resource enters a desired
76
+ # state.
77
+ #
78
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
79
+ #
80
+ # ## Basic Usage
81
+ #
82
+ # Waiter will polls until it is successful, it fails by
83
+ # entering a terminal state, or until a maximum number of attempts
84
+ # are made.
85
+ #
86
+ # # polls in a loop until condition is true
87
+ # resource.wait_until(options) {|resource| condition}
88
+ #
89
+ # ## Example
90
+ #
91
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
92
+ #
93
+ # ## Configuration
94
+ #
95
+ # You can configure the maximum number of polling attempts, and the
96
+ # delay (in seconds) between each polling attempt. The waiting condition is set
97
+ # by passing a block to {#wait_until}:
98
+ #
99
+ # # poll for ~25 seconds
100
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
101
+ #
102
+ # ## Callbacks
103
+ #
104
+ # You can be notified before each polling attempt and before each
105
+ # delay. If you throw `:success` or `:failure` from these callbacks,
106
+ # it will terminate the waiter.
107
+ #
108
+ # started_at = Time.now
109
+ # # poll for 1 hour, instead of a number of attempts
110
+ # proc = Proc.new do |attempts, response|
111
+ # throw :failure if Time.now - started_at > 3600
112
+ # end
113
+ #
114
+ # # disable max attempts
115
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
116
+ #
117
+ # ## Handling Errors
118
+ #
119
+ # When a waiter is successful, it returns the Resource. When a waiter
120
+ # fails, it raises an error.
121
+ #
122
+ # begin
123
+ # resource.wait_until(...)
124
+ # rescue Aws::Waiters::Errors::WaiterFailed
125
+ # # resource did not enter the desired state in time
126
+ # end
127
+ #
128
+ #
129
+ # @yield param [Resource] resource to be used in the waiting condition
130
+ #
131
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
132
+ # because the waiter has entered a state that it will not transition
133
+ # out of, preventing success.
134
+ #
135
+ # yet successful.
136
+ #
137
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
138
+ # while polling for a resource that is not expected.
139
+ #
140
+ # @raise [NotImplementedError] Raised when the resource does not
141
+ #
142
+ # @option options [Integer] :max_attempts (10) Maximum number of
143
+ # attempts
144
+ # @option options [Integer] :delay (10) Delay between each
145
+ # attempt in seconds
146
+ # @option options [Proc] :before_attempt (nil) Callback
147
+ # invoked before each attempt
148
+ # @option options [Proc] :before_wait (nil) Callback
149
+ # invoked before each wait
150
+ # @return [Resource] if the waiter was successful
151
+ def wait_until(options = {}, &block)
152
+ self_copy = self.dup
153
+ attempts = 0
154
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
155
+ options[:delay] ||= 10
156
+ options[:poller] = Proc.new do
157
+ attempts += 1
158
+ if block.call(self_copy)
159
+ [:success, self_copy]
160
+ else
161
+ self_copy.reload unless attempts == options[:max_attempts]
162
+ :retry
163
+ end
164
+ end
165
+ Aws::Waiters::Waiter.new(options).wait({})
166
+ end
167
+
73
168
  # @!group Actions
74
169
 
75
170
  # @example Request syntax with placeholder values
@@ -32,7 +32,7 @@ module Aws::S3
32
32
 
33
33
  # @return [Array<Types::Rule>]
34
34
  def rules
35
- data.rules
35
+ data[:rules]
36
36
  end
37
37
 
38
38
  # @!endgroup
@@ -70,6 +70,101 @@ module Aws::S3
70
70
  !!@data
71
71
  end
72
72
 
73
+ # @deprecated Use [Aws::S3::Client] #wait_until instead
74
+ #
75
+ # Waiter polls an API operation until a resource enters a desired
76
+ # state.
77
+ #
78
+ # @note The waiting operation is performed on a copy. The original resource remains unchanged
79
+ #
80
+ # ## Basic Usage
81
+ #
82
+ # Waiter will polls until it is successful, it fails by
83
+ # entering a terminal state, or until a maximum number of attempts
84
+ # are made.
85
+ #
86
+ # # polls in a loop until condition is true
87
+ # resource.wait_until(options) {|resource| condition}
88
+ #
89
+ # ## Example
90
+ #
91
+ # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
92
+ #
93
+ # ## Configuration
94
+ #
95
+ # You can configure the maximum number of polling attempts, and the
96
+ # delay (in seconds) between each polling attempt. The waiting condition is set
97
+ # by passing a block to {#wait_until}:
98
+ #
99
+ # # poll for ~25 seconds
100
+ # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
101
+ #
102
+ # ## Callbacks
103
+ #
104
+ # You can be notified before each polling attempt and before each
105
+ # delay. If you throw `:success` or `:failure` from these callbacks,
106
+ # it will terminate the waiter.
107
+ #
108
+ # started_at = Time.now
109
+ # # poll for 1 hour, instead of a number of attempts
110
+ # proc = Proc.new do |attempts, response|
111
+ # throw :failure if Time.now - started_at > 3600
112
+ # end
113
+ #
114
+ # # disable max attempts
115
+ # instance.wait_until(before_wait:proc, max_attempts:nil) {...}
116
+ #
117
+ # ## Handling Errors
118
+ #
119
+ # When a waiter is successful, it returns the Resource. When a waiter
120
+ # fails, it raises an error.
121
+ #
122
+ # begin
123
+ # resource.wait_until(...)
124
+ # rescue Aws::Waiters::Errors::WaiterFailed
125
+ # # resource did not enter the desired state in time
126
+ # end
127
+ #
128
+ #
129
+ # @yield param [Resource] resource to be used in the waiting condition
130
+ #
131
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
132
+ # because the waiter has entered a state that it will not transition
133
+ # out of, preventing success.
134
+ #
135
+ # yet successful.
136
+ #
137
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
138
+ # while polling for a resource that is not expected.
139
+ #
140
+ # @raise [NotImplementedError] Raised when the resource does not
141
+ #
142
+ # @option options [Integer] :max_attempts (10) Maximum number of
143
+ # attempts
144
+ # @option options [Integer] :delay (10) Delay between each
145
+ # attempt in seconds
146
+ # @option options [Proc] :before_attempt (nil) Callback
147
+ # invoked before each attempt
148
+ # @option options [Proc] :before_wait (nil) Callback
149
+ # invoked before each wait
150
+ # @return [Resource] if the waiter was successful
151
+ def wait_until(options = {}, &block)
152
+ self_copy = self.dup
153
+ attempts = 0
154
+ options[:max_attempts] = 10 unless options.key?(:max_attempts)
155
+ options[:delay] ||= 10
156
+ options[:poller] = Proc.new do
157
+ attempts += 1
158
+ if block.call(self_copy)
159
+ [:success, self_copy]
160
+ else
161
+ self_copy.reload unless attempts == options[:max_attempts]
162
+ :retry
163
+ end
164
+ end
165
+ Aws::Waiters::Waiter.new(options).wait({})
166
+ end
167
+
73
168
  # @!group Actions
74
169
 
75
170
  # @example Request syntax with placeholder values