aws-sdk-glacier 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 +4 -4
- data/lib/aws-sdk-glacier.rb +1 -1
- data/lib/aws-sdk-glacier/account.rb +95 -0
- data/lib/aws-sdk-glacier/archive.rb +95 -0
- data/lib/aws-sdk-glacier/client.rb +1 -1
- data/lib/aws-sdk-glacier/job.rb +112 -17
- data/lib/aws-sdk-glacier/multipart_upload.rb +99 -4
- data/lib/aws-sdk-glacier/notification.rb +97 -2
- data/lib/aws-sdk-glacier/vault.rb +100 -5
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 84d45c295529fceba697ef874bc8bbb324fbed3f
         | 
| 4 | 
            +
              data.tar.gz: af82813b68db23f6b3c2f6d9d06ebf3edbb2796d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 3c084c8ce9ccc9f5eeced377dba0b85ed02312dbdc7251818b055022b500fe6837b0d010f201e29ecd5afbc301c78ab45a17f03361e9759b0f7518e6b08b0c9d
         | 
| 7 | 
            +
              data.tar.gz: 86284fb974112ae3d79b443b26e5e6767a3557b1093bbb1fce337d412430f517c3ad6009671665bd79e329456f2edc4a21c0f9f7f3e8c9b34992a761f1a2dcd0
         | 
    
        data/lib/aws-sdk-glacier.rb
    CHANGED
    
    
| @@ -58,6 +58,101 @@ module Aws::Glacier | |
| 58 58 | 
             
                  !!@data
         | 
| 59 59 | 
             
                end
         | 
| 60 60 |  | 
| 61 | 
            +
                # @deprecated Use [Aws::Glacier::Client] #wait_until instead
         | 
| 62 | 
            +
                #
         | 
| 63 | 
            +
                # Waiter polls an API operation until a resource enters a desired
         | 
| 64 | 
            +
                # state.
         | 
| 65 | 
            +
                #
         | 
| 66 | 
            +
                # @note The waiting operation is performed on a copy. The original resource remains unchanged
         | 
| 67 | 
            +
                #
         | 
| 68 | 
            +
                # ## Basic Usage
         | 
| 69 | 
            +
                #
         | 
| 70 | 
            +
                # Waiter will polls until it is successful, it fails by
         | 
| 71 | 
            +
                # entering a terminal state, or until a maximum number of attempts
         | 
| 72 | 
            +
                # are made.
         | 
| 73 | 
            +
                #
         | 
| 74 | 
            +
                #     # polls in a loop until condition is true
         | 
| 75 | 
            +
                #     resource.wait_until(options) {|resource| condition}
         | 
| 76 | 
            +
                #
         | 
| 77 | 
            +
                # ## Example
         | 
| 78 | 
            +
                #
         | 
| 79 | 
            +
                #     instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
         | 
| 80 | 
            +
                #
         | 
| 81 | 
            +
                # ## Configuration
         | 
| 82 | 
            +
                #
         | 
| 83 | 
            +
                # You can configure the maximum number of polling attempts, and the
         | 
| 84 | 
            +
                # delay (in seconds) between each polling attempt. The waiting condition is set
         | 
| 85 | 
            +
                # by passing a block to {#wait_until}:
         | 
| 86 | 
            +
                #
         | 
| 87 | 
            +
                #     # poll for ~25 seconds
         | 
| 88 | 
            +
                #     resource.wait_until(max_attempts:5,delay:5) {|resource|...}
         | 
| 89 | 
            +
                #
         | 
| 90 | 
            +
                # ## Callbacks
         | 
| 91 | 
            +
                #
         | 
| 92 | 
            +
                # You can be notified before each polling attempt and before each
         | 
| 93 | 
            +
                # delay. If you throw `:success` or `:failure` from these callbacks,
         | 
| 94 | 
            +
                # it will terminate the waiter.
         | 
| 95 | 
            +
                #
         | 
| 96 | 
            +
                #     started_at = Time.now
         | 
| 97 | 
            +
                #     # poll for 1 hour, instead of a number of attempts
         | 
| 98 | 
            +
                #     proc = Proc.new do |attempts, response|
         | 
| 99 | 
            +
                #       throw :failure if Time.now - started_at > 3600
         | 
| 100 | 
            +
                #     end
         | 
| 101 | 
            +
                #
         | 
| 102 | 
            +
                #       # disable max attempts
         | 
| 103 | 
            +
                #     instance.wait_until(before_wait:proc, max_attempts:nil) {...}
         | 
| 104 | 
            +
                #
         | 
| 105 | 
            +
                # ## Handling Errors
         | 
| 106 | 
            +
                #
         | 
| 107 | 
            +
                # When a waiter is successful, it returns the Resource. When a waiter
         | 
| 108 | 
            +
                # fails, it raises an error.
         | 
| 109 | 
            +
                #
         | 
| 110 | 
            +
                #     begin
         | 
| 111 | 
            +
                #       resource.wait_until(...)
         | 
| 112 | 
            +
                #     rescue Aws::Waiters::Errors::WaiterFailed
         | 
| 113 | 
            +
                #       # resource did not enter the desired state in time
         | 
| 114 | 
            +
                #     end
         | 
| 115 | 
            +
                #
         | 
| 116 | 
            +
                #
         | 
| 117 | 
            +
                # @yield param [Resource] resource to be used in the waiting condition
         | 
| 118 | 
            +
                #
         | 
| 119 | 
            +
                # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
         | 
| 120 | 
            +
                #   because the waiter has entered a state that it will not transition
         | 
| 121 | 
            +
                #   out of, preventing success.
         | 
| 122 | 
            +
                #
         | 
| 123 | 
            +
                #   yet successful.
         | 
| 124 | 
            +
                #
         | 
| 125 | 
            +
                # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
         | 
| 126 | 
            +
                #   while polling for a resource that is not expected.
         | 
| 127 | 
            +
                #
         | 
| 128 | 
            +
                # @raise [NotImplementedError] Raised when the resource does not
         | 
| 129 | 
            +
                #
         | 
| 130 | 
            +
                # @option options [Integer] :max_attempts (10) Maximum number of
         | 
| 131 | 
            +
                # attempts
         | 
| 132 | 
            +
                # @option options [Integer] :delay (10) Delay between each
         | 
| 133 | 
            +
                # attempt in seconds
         | 
| 134 | 
            +
                # @option options [Proc] :before_attempt (nil) Callback
         | 
| 135 | 
            +
                # invoked before each attempt
         | 
| 136 | 
            +
                # @option options [Proc] :before_wait (nil) Callback
         | 
| 137 | 
            +
                # invoked before each wait
         | 
| 138 | 
            +
                # @return [Resource] if the waiter was successful
         | 
| 139 | 
            +
                def wait_until(options = {}, &block)
         | 
| 140 | 
            +
                  self_copy = self.dup
         | 
| 141 | 
            +
                  attempts = 0
         | 
| 142 | 
            +
                  options[:max_attempts] = 10 unless options.key?(:max_attempts)
         | 
| 143 | 
            +
                  options[:delay] ||= 10
         | 
| 144 | 
            +
                  options[:poller] = Proc.new do
         | 
| 145 | 
            +
                    attempts += 1
         | 
| 146 | 
            +
                    if block.call(self_copy)
         | 
| 147 | 
            +
                      [:success, self_copy]
         | 
| 148 | 
            +
                    else
         | 
| 149 | 
            +
                      self_copy.reload unless attempts == options[:max_attempts]
         | 
| 150 | 
            +
                      :retry
         | 
| 151 | 
            +
                    end
         | 
| 152 | 
            +
                  end
         | 
| 153 | 
            +
                  Aws::Waiters::Waiter.new(options).wait({})
         | 
| 154 | 
            +
                end
         | 
| 155 | 
            +
             | 
| 61 156 | 
             
                # @!group Actions
         | 
| 62 157 |  | 
| 63 158 | 
             
                # @example Request syntax with placeholder values
         | 
| @@ -74,6 +74,101 @@ module Aws::Glacier | |
| 74 74 | 
             
                  !!@data
         | 
| 75 75 | 
             
                end
         | 
| 76 76 |  | 
| 77 | 
            +
                # @deprecated Use [Aws::Glacier::Client] #wait_until instead
         | 
| 78 | 
            +
                #
         | 
| 79 | 
            +
                # Waiter polls an API operation until a resource enters a desired
         | 
| 80 | 
            +
                # state.
         | 
| 81 | 
            +
                #
         | 
| 82 | 
            +
                # @note The waiting operation is performed on a copy. The original resource remains unchanged
         | 
| 83 | 
            +
                #
         | 
| 84 | 
            +
                # ## Basic Usage
         | 
| 85 | 
            +
                #
         | 
| 86 | 
            +
                # Waiter will polls until it is successful, it fails by
         | 
| 87 | 
            +
                # entering a terminal state, or until a maximum number of attempts
         | 
| 88 | 
            +
                # are made.
         | 
| 89 | 
            +
                #
         | 
| 90 | 
            +
                #     # polls in a loop until condition is true
         | 
| 91 | 
            +
                #     resource.wait_until(options) {|resource| condition}
         | 
| 92 | 
            +
                #
         | 
| 93 | 
            +
                # ## Example
         | 
| 94 | 
            +
                #
         | 
| 95 | 
            +
                #     instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
         | 
| 96 | 
            +
                #
         | 
| 97 | 
            +
                # ## Configuration
         | 
| 98 | 
            +
                #
         | 
| 99 | 
            +
                # You can configure the maximum number of polling attempts, and the
         | 
| 100 | 
            +
                # delay (in seconds) between each polling attempt. The waiting condition is set
         | 
| 101 | 
            +
                # by passing a block to {#wait_until}:
         | 
| 102 | 
            +
                #
         | 
| 103 | 
            +
                #     # poll for ~25 seconds
         | 
| 104 | 
            +
                #     resource.wait_until(max_attempts:5,delay:5) {|resource|...}
         | 
| 105 | 
            +
                #
         | 
| 106 | 
            +
                # ## Callbacks
         | 
| 107 | 
            +
                #
         | 
| 108 | 
            +
                # You can be notified before each polling attempt and before each
         | 
| 109 | 
            +
                # delay. If you throw `:success` or `:failure` from these callbacks,
         | 
| 110 | 
            +
                # it will terminate the waiter.
         | 
| 111 | 
            +
                #
         | 
| 112 | 
            +
                #     started_at = Time.now
         | 
| 113 | 
            +
                #     # poll for 1 hour, instead of a number of attempts
         | 
| 114 | 
            +
                #     proc = Proc.new do |attempts, response|
         | 
| 115 | 
            +
                #       throw :failure if Time.now - started_at > 3600
         | 
| 116 | 
            +
                #     end
         | 
| 117 | 
            +
                #
         | 
| 118 | 
            +
                #       # disable max attempts
         | 
| 119 | 
            +
                #     instance.wait_until(before_wait:proc, max_attempts:nil) {...}
         | 
| 120 | 
            +
                #
         | 
| 121 | 
            +
                # ## Handling Errors
         | 
| 122 | 
            +
                #
         | 
| 123 | 
            +
                # When a waiter is successful, it returns the Resource. When a waiter
         | 
| 124 | 
            +
                # fails, it raises an error.
         | 
| 125 | 
            +
                #
         | 
| 126 | 
            +
                #     begin
         | 
| 127 | 
            +
                #       resource.wait_until(...)
         | 
| 128 | 
            +
                #     rescue Aws::Waiters::Errors::WaiterFailed
         | 
| 129 | 
            +
                #       # resource did not enter the desired state in time
         | 
| 130 | 
            +
                #     end
         | 
| 131 | 
            +
                #
         | 
| 132 | 
            +
                #
         | 
| 133 | 
            +
                # @yield param [Resource] resource to be used in the waiting condition
         | 
| 134 | 
            +
                #
         | 
| 135 | 
            +
                # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
         | 
| 136 | 
            +
                #   because the waiter has entered a state that it will not transition
         | 
| 137 | 
            +
                #   out of, preventing success.
         | 
| 138 | 
            +
                #
         | 
| 139 | 
            +
                #   yet successful.
         | 
| 140 | 
            +
                #
         | 
| 141 | 
            +
                # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
         | 
| 142 | 
            +
                #   while polling for a resource that is not expected.
         | 
| 143 | 
            +
                #
         | 
| 144 | 
            +
                # @raise [NotImplementedError] Raised when the resource does not
         | 
| 145 | 
            +
                #
         | 
| 146 | 
            +
                # @option options [Integer] :max_attempts (10) Maximum number of
         | 
| 147 | 
            +
                # attempts
         | 
| 148 | 
            +
                # @option options [Integer] :delay (10) Delay between each
         | 
| 149 | 
            +
                # attempt in seconds
         | 
| 150 | 
            +
                # @option options [Proc] :before_attempt (nil) Callback
         | 
| 151 | 
            +
                # invoked before each attempt
         | 
| 152 | 
            +
                # @option options [Proc] :before_wait (nil) Callback
         | 
| 153 | 
            +
                # invoked before each wait
         | 
| 154 | 
            +
                # @return [Resource] if the waiter was successful
         | 
| 155 | 
            +
                def wait_until(options = {}, &block)
         | 
| 156 | 
            +
                  self_copy = self.dup
         | 
| 157 | 
            +
                  attempts = 0
         | 
| 158 | 
            +
                  options[:max_attempts] = 10 unless options.key?(:max_attempts)
         | 
| 159 | 
            +
                  options[:delay] ||= 10
         | 
| 160 | 
            +
                  options[:poller] = Proc.new do
         | 
| 161 | 
            +
                    attempts += 1
         | 
| 162 | 
            +
                    if block.call(self_copy)
         | 
| 163 | 
            +
                      [:success, self_copy]
         | 
| 164 | 
            +
                    else
         | 
| 165 | 
            +
                      self_copy.reload unless attempts == options[:max_attempts]
         | 
| 166 | 
            +
                      :retry
         | 
| 167 | 
            +
                    end
         | 
| 168 | 
            +
                  end
         | 
| 169 | 
            +
                  Aws::Waiters::Waiter.new(options).wait({})
         | 
| 170 | 
            +
                end
         | 
| 171 | 
            +
             | 
| 77 172 | 
             
                # @!group Actions
         | 
| 78 173 |  | 
| 79 174 | 
             
                # @example Request syntax with placeholder values
         | 
| @@ -3213,7 +3213,7 @@ module Aws::Glacier | |
| 3213 3213 | 
             
                    params: params,
         | 
| 3214 3214 | 
             
                    config: config)
         | 
| 3215 3215 | 
             
                  context[:gem_name] = 'aws-sdk-glacier'
         | 
| 3216 | 
            -
                  context[:gem_version] = '1. | 
| 3216 | 
            +
                  context[:gem_version] = '1.4.0'
         | 
| 3217 3217 | 
             
                  Seahorse::Client::Request.new(handlers, context)
         | 
| 3218 3218 | 
             
                end
         | 
| 3219 3219 |  | 
    
        data/lib/aws-sdk-glacier/job.rb
    CHANGED
    
    | @@ -50,53 +50,53 @@ module Aws::Glacier | |
| 50 50 | 
             
                # The job description you provided when you initiated the job.
         | 
| 51 51 | 
             
                # @return [String]
         | 
| 52 52 | 
             
                def job_description
         | 
| 53 | 
            -
                  data | 
| 53 | 
            +
                  data[:job_description]
         | 
| 54 54 | 
             
                end
         | 
| 55 55 |  | 
| 56 56 | 
             
                # The job type. It is either ArchiveRetrieval or InventoryRetrieval.
         | 
| 57 57 | 
             
                # @return [String]
         | 
| 58 58 | 
             
                def action
         | 
| 59 | 
            -
                  data | 
| 59 | 
            +
                  data[:action]
         | 
| 60 60 | 
             
                end
         | 
| 61 61 |  | 
| 62 62 | 
             
                # For an ArchiveRetrieval job, this is the archive ID requested for
         | 
| 63 63 | 
             
                # download. Otherwise, this field is null.
         | 
| 64 64 | 
             
                # @return [String]
         | 
| 65 65 | 
             
                def archive_id
         | 
| 66 | 
            -
                  data | 
| 66 | 
            +
                  data[:archive_id]
         | 
| 67 67 | 
             
                end
         | 
| 68 68 |  | 
| 69 69 | 
             
                # The Amazon Resource Name (ARN) of the vault from which the archive
         | 
| 70 70 | 
             
                # retrieval was requested.
         | 
| 71 71 | 
             
                # @return [String]
         | 
| 72 72 | 
             
                def vault_arn
         | 
| 73 | 
            -
                  data | 
| 73 | 
            +
                  data[:vault_arn]
         | 
| 74 74 | 
             
                end
         | 
| 75 75 |  | 
| 76 76 | 
             
                # The UTC date when the job was created. A string representation of ISO
         | 
| 77 77 | 
             
                # 8601 date format, for example, "2012-03-20T17:03:43.221Z".
         | 
| 78 78 | 
             
                # @return [Time]
         | 
| 79 79 | 
             
                def creation_date
         | 
| 80 | 
            -
                  data | 
| 80 | 
            +
                  data[:creation_date]
         | 
| 81 81 | 
             
                end
         | 
| 82 82 |  | 
| 83 83 | 
             
                # The job status. When a job is completed, you get the job's output.
         | 
| 84 84 | 
             
                # @return [Boolean]
         | 
| 85 85 | 
             
                def completed
         | 
| 86 | 
            -
                  data | 
| 86 | 
            +
                  data[:completed]
         | 
| 87 87 | 
             
                end
         | 
| 88 88 |  | 
| 89 89 | 
             
                # The status code can be InProgress, Succeeded, or Failed, and indicates
         | 
| 90 90 | 
             
                # the status of the job.
         | 
| 91 91 | 
             
                # @return [String]
         | 
| 92 92 | 
             
                def status_code
         | 
| 93 | 
            -
                  data | 
| 93 | 
            +
                  data[:status_code]
         | 
| 94 94 | 
             
                end
         | 
| 95 95 |  | 
| 96 96 | 
             
                # A friendly message that describes the job status.
         | 
| 97 97 | 
             
                # @return [String]
         | 
| 98 98 | 
             
                def status_message
         | 
| 99 | 
            -
                  data | 
| 99 | 
            +
                  data[:status_message]
         | 
| 100 100 | 
             
                end
         | 
| 101 101 |  | 
| 102 102 | 
             
                # For an ArchiveRetrieval job, this is the size in bytes of the archive
         | 
| @@ -104,7 +104,7 @@ module Aws::Glacier | |
| 104 104 | 
             
                # value is null.
         | 
| 105 105 | 
             
                # @return [Integer]
         | 
| 106 106 | 
             
                def archive_size_in_bytes
         | 
| 107 | 
            -
                  data | 
| 107 | 
            +
                  data[:archive_size_in_bytes]
         | 
| 108 108 | 
             
                end
         | 
| 109 109 |  | 
| 110 110 | 
             
                # For an InventoryRetrieval job, this is the size in bytes of the
         | 
| @@ -112,21 +112,21 @@ module Aws::Glacier | |
| 112 112 | 
             
                # value is null.
         | 
| 113 113 | 
             
                # @return [Integer]
         | 
| 114 114 | 
             
                def inventory_size_in_bytes
         | 
| 115 | 
            -
                  data | 
| 115 | 
            +
                  data[:inventory_size_in_bytes]
         | 
| 116 116 | 
             
                end
         | 
| 117 117 |  | 
| 118 118 | 
             
                # An Amazon Simple Notification Service (Amazon SNS) topic that receives
         | 
| 119 119 | 
             
                # notification.
         | 
| 120 120 | 
             
                # @return [String]
         | 
| 121 121 | 
             
                def sns_topic
         | 
| 122 | 
            -
                  data | 
| 122 | 
            +
                  data[:sns_topic]
         | 
| 123 123 | 
             
                end
         | 
| 124 124 |  | 
| 125 125 | 
             
                # The UTC time that the archive retrieval request completed. While the
         | 
| 126 126 | 
             
                # job is in progress, the value will be null.
         | 
| 127 127 | 
             
                # @return [Time]
         | 
| 128 128 | 
             
                def completion_date
         | 
| 129 | 
            -
                  data | 
| 129 | 
            +
                  data[:completion_date]
         | 
| 130 130 | 
             
                end
         | 
| 131 131 |  | 
| 132 132 | 
             
                # For an ArchiveRetrieval job, it is the checksum of the archive.
         | 
| @@ -158,14 +158,14 @@ module Aws::Glacier | |
| 158 158 | 
             
                # ^
         | 
| 159 159 | 
             
                # @return [String]
         | 
| 160 160 | 
             
                def sha256_tree_hash
         | 
| 161 | 
            -
                  data | 
| 161 | 
            +
                  data[:sha256_tree_hash]
         | 
| 162 162 | 
             
                end
         | 
| 163 163 |  | 
| 164 164 | 
             
                # The SHA256 tree hash of the entire archive for an archive retrieval.
         | 
| 165 165 | 
             
                # For inventory retrieval jobs, this field is null.
         | 
| 166 166 | 
             
                # @return [String]
         | 
| 167 167 | 
             
                def archive_sha256_tree_hash
         | 
| 168 | 
            -
                  data | 
| 168 | 
            +
                  data[:archive_sha256_tree_hash]
         | 
| 169 169 | 
             
                end
         | 
| 170 170 |  | 
| 171 171 | 
             
                # The retrieved byte range for archive retrieval jobs in the form
         | 
| @@ -175,20 +175,20 @@ module Aws::Glacier | |
| 175 175 | 
             
                # archive minus 1. For inventory retrieval jobs this field is null.
         | 
| 176 176 | 
             
                # @return [String]
         | 
| 177 177 | 
             
                def retrieval_byte_range
         | 
| 178 | 
            -
                  data | 
| 178 | 
            +
                  data[:retrieval_byte_range]
         | 
| 179 179 | 
             
                end
         | 
| 180 180 |  | 
| 181 181 | 
             
                # The retrieval option to use for the archive retrieval. Valid values
         | 
| 182 182 | 
             
                # are `Expedited`, `Standard`, or `Bulk`. `Standard` is the default.
         | 
| 183 183 | 
             
                # @return [String]
         | 
| 184 184 | 
             
                def tier
         | 
| 185 | 
            -
                  data | 
| 185 | 
            +
                  data[:tier]
         | 
| 186 186 | 
             
                end
         | 
| 187 187 |  | 
| 188 188 | 
             
                # Parameters used for range inventory retrieval.
         | 
| 189 189 | 
             
                # @return [Types::InventoryRetrievalJobDescription]
         | 
| 190 190 | 
             
                def inventory_retrieval_parameters
         | 
| 191 | 
            -
                  data | 
| 191 | 
            +
                  data[:inventory_retrieval_parameters]
         | 
| 192 192 | 
             
                end
         | 
| 193 193 |  | 
| 194 194 | 
             
                # @!endgroup
         | 
| @@ -230,6 +230,101 @@ module Aws::Glacier | |
| 230 230 | 
             
                  !!@data
         | 
| 231 231 | 
             
                end
         | 
| 232 232 |  | 
| 233 | 
            +
                # @deprecated Use [Aws::Glacier::Client] #wait_until instead
         | 
| 234 | 
            +
                #
         | 
| 235 | 
            +
                # Waiter polls an API operation until a resource enters a desired
         | 
| 236 | 
            +
                # state.
         | 
| 237 | 
            +
                #
         | 
| 238 | 
            +
                # @note The waiting operation is performed on a copy. The original resource remains unchanged
         | 
| 239 | 
            +
                #
         | 
| 240 | 
            +
                # ## Basic Usage
         | 
| 241 | 
            +
                #
         | 
| 242 | 
            +
                # Waiter will polls until it is successful, it fails by
         | 
| 243 | 
            +
                # entering a terminal state, or until a maximum number of attempts
         | 
| 244 | 
            +
                # are made.
         | 
| 245 | 
            +
                #
         | 
| 246 | 
            +
                #     # polls in a loop until condition is true
         | 
| 247 | 
            +
                #     resource.wait_until(options) {|resource| condition}
         | 
| 248 | 
            +
                #
         | 
| 249 | 
            +
                # ## Example
         | 
| 250 | 
            +
                #
         | 
| 251 | 
            +
                #     instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
         | 
| 252 | 
            +
                #
         | 
| 253 | 
            +
                # ## Configuration
         | 
| 254 | 
            +
                #
         | 
| 255 | 
            +
                # You can configure the maximum number of polling attempts, and the
         | 
| 256 | 
            +
                # delay (in seconds) between each polling attempt. The waiting condition is set
         | 
| 257 | 
            +
                # by passing a block to {#wait_until}:
         | 
| 258 | 
            +
                #
         | 
| 259 | 
            +
                #     # poll for ~25 seconds
         | 
| 260 | 
            +
                #     resource.wait_until(max_attempts:5,delay:5) {|resource|...}
         | 
| 261 | 
            +
                #
         | 
| 262 | 
            +
                # ## Callbacks
         | 
| 263 | 
            +
                #
         | 
| 264 | 
            +
                # You can be notified before each polling attempt and before each
         | 
| 265 | 
            +
                # delay. If you throw `:success` or `:failure` from these callbacks,
         | 
| 266 | 
            +
                # it will terminate the waiter.
         | 
| 267 | 
            +
                #
         | 
| 268 | 
            +
                #     started_at = Time.now
         | 
| 269 | 
            +
                #     # poll for 1 hour, instead of a number of attempts
         | 
| 270 | 
            +
                #     proc = Proc.new do |attempts, response|
         | 
| 271 | 
            +
                #       throw :failure if Time.now - started_at > 3600
         | 
| 272 | 
            +
                #     end
         | 
| 273 | 
            +
                #
         | 
| 274 | 
            +
                #       # disable max attempts
         | 
| 275 | 
            +
                #     instance.wait_until(before_wait:proc, max_attempts:nil) {...}
         | 
| 276 | 
            +
                #
         | 
| 277 | 
            +
                # ## Handling Errors
         | 
| 278 | 
            +
                #
         | 
| 279 | 
            +
                # When a waiter is successful, it returns the Resource. When a waiter
         | 
| 280 | 
            +
                # fails, it raises an error.
         | 
| 281 | 
            +
                #
         | 
| 282 | 
            +
                #     begin
         | 
| 283 | 
            +
                #       resource.wait_until(...)
         | 
| 284 | 
            +
                #     rescue Aws::Waiters::Errors::WaiterFailed
         | 
| 285 | 
            +
                #       # resource did not enter the desired state in time
         | 
| 286 | 
            +
                #     end
         | 
| 287 | 
            +
                #
         | 
| 288 | 
            +
                #
         | 
| 289 | 
            +
                # @yield param [Resource] resource to be used in the waiting condition
         | 
| 290 | 
            +
                #
         | 
| 291 | 
            +
                # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
         | 
| 292 | 
            +
                #   because the waiter has entered a state that it will not transition
         | 
| 293 | 
            +
                #   out of, preventing success.
         | 
| 294 | 
            +
                #
         | 
| 295 | 
            +
                #   yet successful.
         | 
| 296 | 
            +
                #
         | 
| 297 | 
            +
                # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
         | 
| 298 | 
            +
                #   while polling for a resource that is not expected.
         | 
| 299 | 
            +
                #
         | 
| 300 | 
            +
                # @raise [NotImplementedError] Raised when the resource does not
         | 
| 301 | 
            +
                #
         | 
| 302 | 
            +
                # @option options [Integer] :max_attempts (10) Maximum number of
         | 
| 303 | 
            +
                # attempts
         | 
| 304 | 
            +
                # @option options [Integer] :delay (10) Delay between each
         | 
| 305 | 
            +
                # attempt in seconds
         | 
| 306 | 
            +
                # @option options [Proc] :before_attempt (nil) Callback
         | 
| 307 | 
            +
                # invoked before each attempt
         | 
| 308 | 
            +
                # @option options [Proc] :before_wait (nil) Callback
         | 
| 309 | 
            +
                # invoked before each wait
         | 
| 310 | 
            +
                # @return [Resource] if the waiter was successful
         | 
| 311 | 
            +
                def wait_until(options = {}, &block)
         | 
| 312 | 
            +
                  self_copy = self.dup
         | 
| 313 | 
            +
                  attempts = 0
         | 
| 314 | 
            +
                  options[:max_attempts] = 10 unless options.key?(:max_attempts)
         | 
| 315 | 
            +
                  options[:delay] ||= 10
         | 
| 316 | 
            +
                  options[:poller] = Proc.new do
         | 
| 317 | 
            +
                    attempts += 1
         | 
| 318 | 
            +
                    if block.call(self_copy)
         | 
| 319 | 
            +
                      [:success, self_copy]
         | 
| 320 | 
            +
                    else
         | 
| 321 | 
            +
                      self_copy.reload unless attempts == options[:max_attempts]
         | 
| 322 | 
            +
                      :retry
         | 
| 323 | 
            +
                    end
         | 
| 324 | 
            +
                  end
         | 
| 325 | 
            +
                  Aws::Waiters::Waiter.new(options).wait({})
         | 
| 326 | 
            +
                end
         | 
| 327 | 
            +
             | 
| 233 328 | 
             
                # @!group Actions
         | 
| 234 329 |  | 
| 235 330 | 
             
                # @example Request syntax with placeholder values
         | 
| @@ -50,14 +50,14 @@ module Aws::Glacier | |
| 50 50 | 
             
                # The Amazon Resource Name (ARN) of the vault that contains the archive.
         | 
| 51 51 | 
             
                # @return [String]
         | 
| 52 52 | 
             
                def vault_arn
         | 
| 53 | 
            -
                  data | 
| 53 | 
            +
                  data[:vault_arn]
         | 
| 54 54 | 
             
                end
         | 
| 55 55 |  | 
| 56 56 | 
             
                # The description of the archive that was specified in the Initiate
         | 
| 57 57 | 
             
                # Multipart Upload request.
         | 
| 58 58 | 
             
                # @return [String]
         | 
| 59 59 | 
             
                def archive_description
         | 
| 60 | 
            -
                  data | 
| 60 | 
            +
                  data[:archive_description]
         | 
| 61 61 | 
             
                end
         | 
| 62 62 |  | 
| 63 63 | 
             
                # The part size, in bytes, specified in the Initiate Multipart Upload
         | 
| @@ -65,13 +65,13 @@ module Aws::Glacier | |
| 65 65 | 
             
                # last part, which may be smaller than this size.
         | 
| 66 66 | 
             
                # @return [Integer]
         | 
| 67 67 | 
             
                def part_size_in_bytes
         | 
| 68 | 
            -
                  data | 
| 68 | 
            +
                  data[:part_size_in_bytes]
         | 
| 69 69 | 
             
                end
         | 
| 70 70 |  | 
| 71 71 | 
             
                # The UTC time at which the multipart upload was initiated.
         | 
| 72 72 | 
             
                # @return [Time]
         | 
| 73 73 | 
             
                def creation_date
         | 
| 74 | 
            -
                  data | 
| 74 | 
            +
                  data[:creation_date]
         | 
| 75 75 | 
             
                end
         | 
| 76 76 |  | 
| 77 77 | 
             
                # @!endgroup
         | 
| @@ -104,6 +104,101 @@ module Aws::Glacier | |
| 104 104 | 
             
                  !!@data
         | 
| 105 105 | 
             
                end
         | 
| 106 106 |  | 
| 107 | 
            +
                # @deprecated Use [Aws::Glacier::Client] #wait_until instead
         | 
| 108 | 
            +
                #
         | 
| 109 | 
            +
                # Waiter polls an API operation until a resource enters a desired
         | 
| 110 | 
            +
                # state.
         | 
| 111 | 
            +
                #
         | 
| 112 | 
            +
                # @note The waiting operation is performed on a copy. The original resource remains unchanged
         | 
| 113 | 
            +
                #
         | 
| 114 | 
            +
                # ## Basic Usage
         | 
| 115 | 
            +
                #
         | 
| 116 | 
            +
                # Waiter will polls until it is successful, it fails by
         | 
| 117 | 
            +
                # entering a terminal state, or until a maximum number of attempts
         | 
| 118 | 
            +
                # are made.
         | 
| 119 | 
            +
                #
         | 
| 120 | 
            +
                #     # polls in a loop until condition is true
         | 
| 121 | 
            +
                #     resource.wait_until(options) {|resource| condition}
         | 
| 122 | 
            +
                #
         | 
| 123 | 
            +
                # ## Example
         | 
| 124 | 
            +
                #
         | 
| 125 | 
            +
                #     instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
         | 
| 126 | 
            +
                #
         | 
| 127 | 
            +
                # ## Configuration
         | 
| 128 | 
            +
                #
         | 
| 129 | 
            +
                # You can configure the maximum number of polling attempts, and the
         | 
| 130 | 
            +
                # delay (in seconds) between each polling attempt. The waiting condition is set
         | 
| 131 | 
            +
                # by passing a block to {#wait_until}:
         | 
| 132 | 
            +
                #
         | 
| 133 | 
            +
                #     # poll for ~25 seconds
         | 
| 134 | 
            +
                #     resource.wait_until(max_attempts:5,delay:5) {|resource|...}
         | 
| 135 | 
            +
                #
         | 
| 136 | 
            +
                # ## Callbacks
         | 
| 137 | 
            +
                #
         | 
| 138 | 
            +
                # You can be notified before each polling attempt and before each
         | 
| 139 | 
            +
                # delay. If you throw `:success` or `:failure` from these callbacks,
         | 
| 140 | 
            +
                # it will terminate the waiter.
         | 
| 141 | 
            +
                #
         | 
| 142 | 
            +
                #     started_at = Time.now
         | 
| 143 | 
            +
                #     # poll for 1 hour, instead of a number of attempts
         | 
| 144 | 
            +
                #     proc = Proc.new do |attempts, response|
         | 
| 145 | 
            +
                #       throw :failure if Time.now - started_at > 3600
         | 
| 146 | 
            +
                #     end
         | 
| 147 | 
            +
                #
         | 
| 148 | 
            +
                #       # disable max attempts
         | 
| 149 | 
            +
                #     instance.wait_until(before_wait:proc, max_attempts:nil) {...}
         | 
| 150 | 
            +
                #
         | 
| 151 | 
            +
                # ## Handling Errors
         | 
| 152 | 
            +
                #
         | 
| 153 | 
            +
                # When a waiter is successful, it returns the Resource. When a waiter
         | 
| 154 | 
            +
                # fails, it raises an error.
         | 
| 155 | 
            +
                #
         | 
| 156 | 
            +
                #     begin
         | 
| 157 | 
            +
                #       resource.wait_until(...)
         | 
| 158 | 
            +
                #     rescue Aws::Waiters::Errors::WaiterFailed
         | 
| 159 | 
            +
                #       # resource did not enter the desired state in time
         | 
| 160 | 
            +
                #     end
         | 
| 161 | 
            +
                #
         | 
| 162 | 
            +
                #
         | 
| 163 | 
            +
                # @yield param [Resource] resource to be used in the waiting condition
         | 
| 164 | 
            +
                #
         | 
| 165 | 
            +
                # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
         | 
| 166 | 
            +
                #   because the waiter has entered a state that it will not transition
         | 
| 167 | 
            +
                #   out of, preventing success.
         | 
| 168 | 
            +
                #
         | 
| 169 | 
            +
                #   yet successful.
         | 
| 170 | 
            +
                #
         | 
| 171 | 
            +
                # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
         | 
| 172 | 
            +
                #   while polling for a resource that is not expected.
         | 
| 173 | 
            +
                #
         | 
| 174 | 
            +
                # @raise [NotImplementedError] Raised when the resource does not
         | 
| 175 | 
            +
                #
         | 
| 176 | 
            +
                # @option options [Integer] :max_attempts (10) Maximum number of
         | 
| 177 | 
            +
                # attempts
         | 
| 178 | 
            +
                # @option options [Integer] :delay (10) Delay between each
         | 
| 179 | 
            +
                # attempt in seconds
         | 
| 180 | 
            +
                # @option options [Proc] :before_attempt (nil) Callback
         | 
| 181 | 
            +
                # invoked before each attempt
         | 
| 182 | 
            +
                # @option options [Proc] :before_wait (nil) Callback
         | 
| 183 | 
            +
                # invoked before each wait
         | 
| 184 | 
            +
                # @return [Resource] if the waiter was successful
         | 
| 185 | 
            +
                def wait_until(options = {}, &block)
         | 
| 186 | 
            +
                  self_copy = self.dup
         | 
| 187 | 
            +
                  attempts = 0
         | 
| 188 | 
            +
                  options[:max_attempts] = 10 unless options.key?(:max_attempts)
         | 
| 189 | 
            +
                  options[:delay] ||= 10
         | 
| 190 | 
            +
                  options[:poller] = Proc.new do
         | 
| 191 | 
            +
                    attempts += 1
         | 
| 192 | 
            +
                    if block.call(self_copy)
         | 
| 193 | 
            +
                      [:success, self_copy]
         | 
| 194 | 
            +
                    else
         | 
| 195 | 
            +
                      self_copy.reload unless attempts == options[:max_attempts]
         | 
| 196 | 
            +
                      :retry
         | 
| 197 | 
            +
                    end
         | 
| 198 | 
            +
                  end
         | 
| 199 | 
            +
                  Aws::Waiters::Waiter.new(options).wait({})
         | 
| 200 | 
            +
                end
         | 
| 201 | 
            +
             | 
| 107 202 | 
             
                # @!group Actions
         | 
| 108 203 |  | 
| 109 204 | 
             
                # @example Request syntax with placeholder values
         | 
| @@ -42,14 +42,14 @@ module Aws::Glacier | |
| 42 42 | 
             
                # Resource Name (ARN).
         | 
| 43 43 | 
             
                # @return [String]
         | 
| 44 44 | 
             
                def sns_topic
         | 
| 45 | 
            -
                  data | 
| 45 | 
            +
                  data[:sns_topic]
         | 
| 46 46 | 
             
                end
         | 
| 47 47 |  | 
| 48 48 | 
             
                # A list of one or more events for which Amazon Glacier will send a
         | 
| 49 49 | 
             
                # notification to the specified Amazon SNS topic.
         | 
| 50 50 | 
             
                # @return [Array<String>]
         | 
| 51 51 | 
             
                def events
         | 
| 52 | 
            -
                  data | 
| 52 | 
            +
                  data[:events]
         | 
| 53 53 | 
             
                end
         | 
| 54 54 |  | 
| 55 55 | 
             
                # @!endgroup
         | 
| @@ -90,6 +90,101 @@ module Aws::Glacier | |
| 90 90 | 
             
                  !!@data
         | 
| 91 91 | 
             
                end
         | 
| 92 92 |  | 
| 93 | 
            +
                # @deprecated Use [Aws::Glacier::Client] #wait_until instead
         | 
| 94 | 
            +
                #
         | 
| 95 | 
            +
                # Waiter polls an API operation until a resource enters a desired
         | 
| 96 | 
            +
                # state.
         | 
| 97 | 
            +
                #
         | 
| 98 | 
            +
                # @note The waiting operation is performed on a copy. The original resource remains unchanged
         | 
| 99 | 
            +
                #
         | 
| 100 | 
            +
                # ## Basic Usage
         | 
| 101 | 
            +
                #
         | 
| 102 | 
            +
                # Waiter will polls until it is successful, it fails by
         | 
| 103 | 
            +
                # entering a terminal state, or until a maximum number of attempts
         | 
| 104 | 
            +
                # are made.
         | 
| 105 | 
            +
                #
         | 
| 106 | 
            +
                #     # polls in a loop until condition is true
         | 
| 107 | 
            +
                #     resource.wait_until(options) {|resource| condition}
         | 
| 108 | 
            +
                #
         | 
| 109 | 
            +
                # ## Example
         | 
| 110 | 
            +
                #
         | 
| 111 | 
            +
                #     instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
         | 
| 112 | 
            +
                #
         | 
| 113 | 
            +
                # ## Configuration
         | 
| 114 | 
            +
                #
         | 
| 115 | 
            +
                # You can configure the maximum number of polling attempts, and the
         | 
| 116 | 
            +
                # delay (in seconds) between each polling attempt. The waiting condition is set
         | 
| 117 | 
            +
                # by passing a block to {#wait_until}:
         | 
| 118 | 
            +
                #
         | 
| 119 | 
            +
                #     # poll for ~25 seconds
         | 
| 120 | 
            +
                #     resource.wait_until(max_attempts:5,delay:5) {|resource|...}
         | 
| 121 | 
            +
                #
         | 
| 122 | 
            +
                # ## Callbacks
         | 
| 123 | 
            +
                #
         | 
| 124 | 
            +
                # You can be notified before each polling attempt and before each
         | 
| 125 | 
            +
                # delay. If you throw `:success` or `:failure` from these callbacks,
         | 
| 126 | 
            +
                # it will terminate the waiter.
         | 
| 127 | 
            +
                #
         | 
| 128 | 
            +
                #     started_at = Time.now
         | 
| 129 | 
            +
                #     # poll for 1 hour, instead of a number of attempts
         | 
| 130 | 
            +
                #     proc = Proc.new do |attempts, response|
         | 
| 131 | 
            +
                #       throw :failure if Time.now - started_at > 3600
         | 
| 132 | 
            +
                #     end
         | 
| 133 | 
            +
                #
         | 
| 134 | 
            +
                #       # disable max attempts
         | 
| 135 | 
            +
                #     instance.wait_until(before_wait:proc, max_attempts:nil) {...}
         | 
| 136 | 
            +
                #
         | 
| 137 | 
            +
                # ## Handling Errors
         | 
| 138 | 
            +
                #
         | 
| 139 | 
            +
                # When a waiter is successful, it returns the Resource. When a waiter
         | 
| 140 | 
            +
                # fails, it raises an error.
         | 
| 141 | 
            +
                #
         | 
| 142 | 
            +
                #     begin
         | 
| 143 | 
            +
                #       resource.wait_until(...)
         | 
| 144 | 
            +
                #     rescue Aws::Waiters::Errors::WaiterFailed
         | 
| 145 | 
            +
                #       # resource did not enter the desired state in time
         | 
| 146 | 
            +
                #     end
         | 
| 147 | 
            +
                #
         | 
| 148 | 
            +
                #
         | 
| 149 | 
            +
                # @yield param [Resource] resource to be used in the waiting condition
         | 
| 150 | 
            +
                #
         | 
| 151 | 
            +
                # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
         | 
| 152 | 
            +
                #   because the waiter has entered a state that it will not transition
         | 
| 153 | 
            +
                #   out of, preventing success.
         | 
| 154 | 
            +
                #
         | 
| 155 | 
            +
                #   yet successful.
         | 
| 156 | 
            +
                #
         | 
| 157 | 
            +
                # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
         | 
| 158 | 
            +
                #   while polling for a resource that is not expected.
         | 
| 159 | 
            +
                #
         | 
| 160 | 
            +
                # @raise [NotImplementedError] Raised when the resource does not
         | 
| 161 | 
            +
                #
         | 
| 162 | 
            +
                # @option options [Integer] :max_attempts (10) Maximum number of
         | 
| 163 | 
            +
                # attempts
         | 
| 164 | 
            +
                # @option options [Integer] :delay (10) Delay between each
         | 
| 165 | 
            +
                # attempt in seconds
         | 
| 166 | 
            +
                # @option options [Proc] :before_attempt (nil) Callback
         | 
| 167 | 
            +
                # invoked before each attempt
         | 
| 168 | 
            +
                # @option options [Proc] :before_wait (nil) Callback
         | 
| 169 | 
            +
                # invoked before each wait
         | 
| 170 | 
            +
                # @return [Resource] if the waiter was successful
         | 
| 171 | 
            +
                def wait_until(options = {}, &block)
         | 
| 172 | 
            +
                  self_copy = self.dup
         | 
| 173 | 
            +
                  attempts = 0
         | 
| 174 | 
            +
                  options[:max_attempts] = 10 unless options.key?(:max_attempts)
         | 
| 175 | 
            +
                  options[:delay] ||= 10
         | 
| 176 | 
            +
                  options[:poller] = Proc.new do
         | 
| 177 | 
            +
                    attempts += 1
         | 
| 178 | 
            +
                    if block.call(self_copy)
         | 
| 179 | 
            +
                      [:success, self_copy]
         | 
| 180 | 
            +
                    else
         | 
| 181 | 
            +
                      self_copy.reload unless attempts == options[:max_attempts]
         | 
| 182 | 
            +
                      :retry
         | 
| 183 | 
            +
                    end
         | 
| 184 | 
            +
                  end
         | 
| 185 | 
            +
                  Aws::Waiters::Waiter.new(options).wait({})
         | 
| 186 | 
            +
                end
         | 
| 187 | 
            +
             | 
| 93 188 | 
             
                # @!group Actions
         | 
| 94 189 |  | 
| 95 190 | 
             
                # @example Request syntax with placeholder values
         | 
| @@ -42,7 +42,7 @@ module Aws::Glacier | |
| 42 42 | 
             
                # The Amazon Resource Name (ARN) of the vault.
         | 
| 43 43 | 
             
                # @return [String]
         | 
| 44 44 | 
             
                def vault_arn
         | 
| 45 | 
            -
                  data | 
| 45 | 
            +
                  data[:vault_arn]
         | 
| 46 46 | 
             
                end
         | 
| 47 47 |  | 
| 48 48 | 
             
                # The Universal Coordinated Time (UTC) date when the vault was created.
         | 
| @@ -50,7 +50,7 @@ module Aws::Glacier | |
| 50 50 | 
             
                # `2012-03-20T17:03:43.221Z`.
         | 
| 51 51 | 
             
                # @return [Time]
         | 
| 52 52 | 
             
                def creation_date
         | 
| 53 | 
            -
                  data | 
| 53 | 
            +
                  data[:creation_date]
         | 
| 54 54 | 
             
                end
         | 
| 55 55 |  | 
| 56 56 | 
             
                # The Universal Coordinated Time (UTC) date when Amazon Glacier
         | 
| @@ -58,7 +58,7 @@ module Aws::Glacier | |
| 58 58 | 
             
                # the ISO 8601 date format, for example `2012-03-20T17:03:43.221Z`.
         | 
| 59 59 | 
             
                # @return [Time]
         | 
| 60 60 | 
             
                def last_inventory_date
         | 
| 61 | 
            -
                  data | 
| 61 | 
            +
                  data[:last_inventory_date]
         | 
| 62 62 | 
             
                end
         | 
| 63 63 |  | 
| 64 64 | 
             
                # The number of archives in the vault as of the last inventory date.
         | 
| @@ -66,7 +66,7 @@ module Aws::Glacier | |
| 66 66 | 
             
                # vault, for example if you just created the vault.
         | 
| 67 67 | 
             
                # @return [Integer]
         | 
| 68 68 | 
             
                def number_of_archives
         | 
| 69 | 
            -
                  data | 
| 69 | 
            +
                  data[:number_of_archives]
         | 
| 70 70 | 
             
                end
         | 
| 71 71 |  | 
| 72 72 | 
             
                # Total size, in bytes, of the archives in the vault as of the last
         | 
| @@ -74,7 +74,7 @@ module Aws::Glacier | |
| 74 74 | 
             
                # yet run on the vault, for example if you just created the vault.
         | 
| 75 75 | 
             
                # @return [Integer]
         | 
| 76 76 | 
             
                def size_in_bytes
         | 
| 77 | 
            -
                  data | 
| 77 | 
            +
                  data[:size_in_bytes]
         | 
| 78 78 | 
             
                end
         | 
| 79 79 |  | 
| 80 80 | 
             
                # @!endgroup
         | 
| @@ -115,6 +115,101 @@ module Aws::Glacier | |
| 115 115 | 
             
                  !!@data
         | 
| 116 116 | 
             
                end
         | 
| 117 117 |  | 
| 118 | 
            +
                # @deprecated Use [Aws::Glacier::Client] #wait_until instead
         | 
| 119 | 
            +
                #
         | 
| 120 | 
            +
                # Waiter polls an API operation until a resource enters a desired
         | 
| 121 | 
            +
                # state.
         | 
| 122 | 
            +
                #
         | 
| 123 | 
            +
                # @note The waiting operation is performed on a copy. The original resource remains unchanged
         | 
| 124 | 
            +
                #
         | 
| 125 | 
            +
                # ## Basic Usage
         | 
| 126 | 
            +
                #
         | 
| 127 | 
            +
                # Waiter will polls until it is successful, it fails by
         | 
| 128 | 
            +
                # entering a terminal state, or until a maximum number of attempts
         | 
| 129 | 
            +
                # are made.
         | 
| 130 | 
            +
                #
         | 
| 131 | 
            +
                #     # polls in a loop until condition is true
         | 
| 132 | 
            +
                #     resource.wait_until(options) {|resource| condition}
         | 
| 133 | 
            +
                #
         | 
| 134 | 
            +
                # ## Example
         | 
| 135 | 
            +
                #
         | 
| 136 | 
            +
                #     instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
         | 
| 137 | 
            +
                #
         | 
| 138 | 
            +
                # ## Configuration
         | 
| 139 | 
            +
                #
         | 
| 140 | 
            +
                # You can configure the maximum number of polling attempts, and the
         | 
| 141 | 
            +
                # delay (in seconds) between each polling attempt. The waiting condition is set
         | 
| 142 | 
            +
                # by passing a block to {#wait_until}:
         | 
| 143 | 
            +
                #
         | 
| 144 | 
            +
                #     # poll for ~25 seconds
         | 
| 145 | 
            +
                #     resource.wait_until(max_attempts:5,delay:5) {|resource|...}
         | 
| 146 | 
            +
                #
         | 
| 147 | 
            +
                # ## Callbacks
         | 
| 148 | 
            +
                #
         | 
| 149 | 
            +
                # You can be notified before each polling attempt and before each
         | 
| 150 | 
            +
                # delay. If you throw `:success` or `:failure` from these callbacks,
         | 
| 151 | 
            +
                # it will terminate the waiter.
         | 
| 152 | 
            +
                #
         | 
| 153 | 
            +
                #     started_at = Time.now
         | 
| 154 | 
            +
                #     # poll for 1 hour, instead of a number of attempts
         | 
| 155 | 
            +
                #     proc = Proc.new do |attempts, response|
         | 
| 156 | 
            +
                #       throw :failure if Time.now - started_at > 3600
         | 
| 157 | 
            +
                #     end
         | 
| 158 | 
            +
                #
         | 
| 159 | 
            +
                #       # disable max attempts
         | 
| 160 | 
            +
                #     instance.wait_until(before_wait:proc, max_attempts:nil) {...}
         | 
| 161 | 
            +
                #
         | 
| 162 | 
            +
                # ## Handling Errors
         | 
| 163 | 
            +
                #
         | 
| 164 | 
            +
                # When a waiter is successful, it returns the Resource. When a waiter
         | 
| 165 | 
            +
                # fails, it raises an error.
         | 
| 166 | 
            +
                #
         | 
| 167 | 
            +
                #     begin
         | 
| 168 | 
            +
                #       resource.wait_until(...)
         | 
| 169 | 
            +
                #     rescue Aws::Waiters::Errors::WaiterFailed
         | 
| 170 | 
            +
                #       # resource did not enter the desired state in time
         | 
| 171 | 
            +
                #     end
         | 
| 172 | 
            +
                #
         | 
| 173 | 
            +
                #
         | 
| 174 | 
            +
                # @yield param [Resource] resource to be used in the waiting condition
         | 
| 175 | 
            +
                #
         | 
| 176 | 
            +
                # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
         | 
| 177 | 
            +
                #   because the waiter has entered a state that it will not transition
         | 
| 178 | 
            +
                #   out of, preventing success.
         | 
| 179 | 
            +
                #
         | 
| 180 | 
            +
                #   yet successful.
         | 
| 181 | 
            +
                #
         | 
| 182 | 
            +
                # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
         | 
| 183 | 
            +
                #   while polling for a resource that is not expected.
         | 
| 184 | 
            +
                #
         | 
| 185 | 
            +
                # @raise [NotImplementedError] Raised when the resource does not
         | 
| 186 | 
            +
                #
         | 
| 187 | 
            +
                # @option options [Integer] :max_attempts (10) Maximum number of
         | 
| 188 | 
            +
                # attempts
         | 
| 189 | 
            +
                # @option options [Integer] :delay (10) Delay between each
         | 
| 190 | 
            +
                # attempt in seconds
         | 
| 191 | 
            +
                # @option options [Proc] :before_attempt (nil) Callback
         | 
| 192 | 
            +
                # invoked before each attempt
         | 
| 193 | 
            +
                # @option options [Proc] :before_wait (nil) Callback
         | 
| 194 | 
            +
                # invoked before each wait
         | 
| 195 | 
            +
                # @return [Resource] if the waiter was successful
         | 
| 196 | 
            +
                def wait_until(options = {}, &block)
         | 
| 197 | 
            +
                  self_copy = self.dup
         | 
| 198 | 
            +
                  attempts = 0
         | 
| 199 | 
            +
                  options[:max_attempts] = 10 unless options.key?(:max_attempts)
         | 
| 200 | 
            +
                  options[:delay] ||= 10
         | 
| 201 | 
            +
                  options[:poller] = Proc.new do
         | 
| 202 | 
            +
                    attempts += 1
         | 
| 203 | 
            +
                    if block.call(self_copy)
         | 
| 204 | 
            +
                      [:success, self_copy]
         | 
| 205 | 
            +
                    else
         | 
| 206 | 
            +
                      self_copy.reload unless attempts == options[:max_attempts]
         | 
| 207 | 
            +
                      :retry
         | 
| 208 | 
            +
                    end
         | 
| 209 | 
            +
                  end
         | 
| 210 | 
            +
                  Aws::Waiters::Waiter.new(options).wait({})
         | 
| 211 | 
            +
                end
         | 
| 212 | 
            +
             | 
| 118 213 | 
             
                # @!group Actions
         | 
| 119 214 |  | 
| 120 215 | 
             
                # @example Request syntax with placeholder values
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: aws-sdk-glacier
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.4.0
         | 
| 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: 2017-09- | 
| 11 | 
            +
            date: 2017-09-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: aws-sdk-core
         |