aws-sdk-s3-1.48.0/0000755000004100000410000000000013536452011013530 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/0000755000004100000410000000000013536452011014276 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/aws-sdk-s3/0000755000004100000410000000000013536452011016172 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb0000644000004100000410000002054213536452011024745 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketLifecycleConfiguration extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Array] def rules data[:rules] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketLifecycleConfiguration}. # Returns `self` making it possible to chain methods. # # bucket_lifecycle_configuration.reload.data # # @return [self] def load resp = @client.get_bucket_lifecycle_configuration(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketLifecycleConfigurationOutput] # Returns the data for this {BucketLifecycleConfiguration}. Calls # {Client#get_bucket_lifecycle_configuration} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_lifecycle_configuration.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.delete_bucket_lifecycle(options) resp.data end # @example Request syntax with placeholder values # # bucket_lifecycle_configuration.put({ # lifecycle_configuration: { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # transitions: [ # { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_transitions: [ # { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # }, # }) # @param [Hash] options ({}) # @option options [Types::BucketLifecycleConfiguration] :lifecycle_configuration # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_lifecycle_configuration(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_versioning.rb0000644000004100000410000002074213536452011022244 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketVersioning extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # The versioning state of the bucket. # @return [String] def status data[:status] end # Specifies whether MFA delete is enabled in the bucket versioning # configuration. This element is only returned if the bucket has been # configured with MFA delete. If the bucket has never been so # configured, this element is not returned. # @return [String] def mfa_delete data[:mfa_delete] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketVersioning}. # Returns `self` making it possible to chain methods. # # bucket_versioning.reload.data # # @return [self] def load resp = @client.get_bucket_versioning(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketVersioningOutput] # Returns the data for this {BucketVersioning}. Calls # {Client#get_bucket_versioning} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_versioning.enable({ # content_md5: "ContentMD5", # mfa: "MFA", # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @return [EmptyStructure] def enable(options = {}) options = Aws::Util.deep_merge(options, bucket: @bucket_name, versioning_configuration: { status: "Enabled" } ) resp = @client.put_bucket_versioning(options) resp.data end # @example Request syntax with placeholder values # # bucket_versioning.put({ # content_md5: "ContentMD5", # mfa: "MFA", # versioning_configuration: { # required # mfa_delete: "Enabled", # accepts Enabled, Disabled # status: "Enabled", # accepts Enabled, Suspended # }, # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [required, Types::VersioningConfiguration] :versioning_configuration # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_versioning(options) resp.data end # @example Request syntax with placeholder values # # bucket_versioning.suspend({ # content_md5: "ContentMD5", # mfa: "MFA", # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @return [EmptyStructure] def suspend(options = {}) options = Aws::Util.deep_merge(options, bucket: @bucket_name, versioning_configuration: { status: "Suspended" } ) resp = @client.put_bucket_versioning(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/multipart_file_uploader.rb0000644000004100000410000001200613536452011023431 0ustar www-datawww-datarequire 'pathname' require 'thread' require 'set' module Aws module S3 # @api private class MultipartFileUploader MIN_PART_SIZE = 5 * 1024 * 1024 # 5MB FILE_TOO_SMALL = "unable to multipart upload files smaller than 5MB" MAX_PARTS = 10_000 THREAD_COUNT = 10 # @api private CREATE_OPTIONS = Set.new(Client.api.operation(:create_multipart_upload).input.shape.member_names) # @api private UPLOAD_PART_OPTIONS = Set.new(Client.api.operation(:upload_part).input.shape.member_names) # @option options [Client] :client def initialize(options = {}) @client = options[:client] || Client.new @thread_count = options[:thread_count] || THREAD_COUNT end # @return [Client] attr_reader :client # @param [String,Pathname,File,Tempfile] source # @option options [required,String] :bucket # @option options [required,String] :key # @return [void] def upload(source, options = {}) if File.size(source) < MIN_PART_SIZE raise ArgumentError, FILE_TOO_SMALL else upload_id = initiate_upload(options) parts = upload_parts(upload_id, source, options) complete_upload(upload_id, parts, options) end end private def initiate_upload(options) @client.create_multipart_upload(create_opts(options)).upload_id end def complete_upload(upload_id, parts, options) @client.complete_multipart_upload( bucket: options[:bucket], key: options[:key], upload_id: upload_id, multipart_upload: { parts: parts }) end def upload_parts(upload_id, source, options) pending = PartList.new(compute_parts(upload_id, source, options)) completed = PartList.new errors = upload_in_threads(pending, completed) if errors.empty? completed.to_a.sort_by { |part| part[:part_number] } else abort_upload(upload_id, options, errors) end end def abort_upload(upload_id, options, errors) @client.abort_multipart_upload( bucket: options[:bucket], key: options[:key], upload_id: upload_id ) msg = "multipart upload failed: #{errors.map(&:message).join("; ")}" raise MultipartUploadError.new(msg, errors) rescue MultipartUploadError => error raise error rescue => error msg = "failed to abort multipart upload: #{error.message}" raise MultipartUploadError.new(msg, errors + [error]) end def compute_parts(upload_id, source, options) size = File.size(source) default_part_size = compute_default_part_size(size) offset = 0 part_number = 1 parts = [] while offset < size parts << upload_part_opts(options).merge({ upload_id: upload_id, part_number: part_number, body: FilePart.new( source: source, offset: offset, size: part_size(size, default_part_size, offset) ) }) part_number += 1 offset += default_part_size end parts end def create_opts(options) CREATE_OPTIONS.inject({}) do |hash, key| hash[key] = options[key] if options.key?(key) hash end end def upload_part_opts(options) UPLOAD_PART_OPTIONS.inject({}) do |hash, key| hash[key] = options[key] if options.key?(key) hash end end def upload_in_threads(pending, completed) threads = [] @thread_count.times do thread = Thread.new do begin while part = pending.shift resp = @client.upload_part(part) part[:body].close completed.push(etag: resp.etag, part_number: part[:part_number]) end nil rescue => error # keep other threads from uploading other parts pending.clear! error end end thread.abort_on_exception = true threads << thread end threads.map(&:value).compact end def compute_default_part_size(source_size) [(source_size.to_f / MAX_PARTS).ceil, MIN_PART_SIZE].max.to_i end def part_size(total_size, part_size, offset) if offset + part_size > total_size total_size - offset else part_size end end # @api private class PartList def initialize(parts = []) @parts = parts @mutex = Mutex.new end def push(part) @mutex.synchronize { @parts.push(part) } end def shift @mutex.synchronize { @parts.shift } end def clear! @mutex.synchronize { @parts.clear } end def to_a @mutex.synchronize { @parts.dup } end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/object_acl.rb0000644000004100000410000002307413536452011020612 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class ObjectAcl extend Aws::Deprecations # @overload def initialize(bucket_name, object_key, options = {}) # @param [String] bucket_name # @param [String] object_key # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [required, String] :object_key # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @object_key = extract_object_key(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [String] def object_key @object_key end # @return [Types::Owner] def owner data[:owner] end # A list of grants. # @return [Array] def grants data[:grants] end # If present, indicates that the requester was successfully charged for # the request. # @return [String] def request_charged data[:request_charged] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {ObjectAcl}. # Returns `self` making it possible to chain methods. # # object_acl.reload.data # # @return [self] def load resp = @client.get_object_acl( bucket: @bucket_name, key: @object_key ) @data = resp.data self end alias :reload :load # @return [Types::GetObjectAclOutput] # Returns the data for this {ObjectAcl}. Calls # {Client#get_object_acl} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # object_acl.put({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_policy: { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # }, # content_md5: "ContentMD5", # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [Types::AccessControlPolicy] :access_control_policy # Contains the elements that set the ACL permissions for an object per # grantee. # @option options [String] :content_md5 # @option options [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # @option options [String] :grant_read # Allows grantee to list the objects in the bucket. # @option options [String] :grant_read_acp # Allows grantee to read the bucket ACL. # @option options [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :version_id # VersionId used to reference a specific version of the object. # @return [Types::PutObjectAclOutput] def put(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key ) resp = @client.put_object_acl(options) resp.data end # @!group Associations # @return [Object] def object Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name, object_key: @object_key } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_object_key(args, options) value = args[1] || options.delete(:object_key) case value when String then value when nil then raise ArgumentError, "missing required option :object_key" else msg = "expected :object_key to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/0000755000004100000410000000000013536452011021265 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/types/0000755000004100000410000000000013536452011022431 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb0000644000004100000410000000050413536452011030626 0ustar www-datawww-dataclass Aws::S3::Types::ListObjectVersionsOutput # TODO : Remove this customization once the resource code # generator correct handles the JMESPath || expression. # Only used by the Bucket#object_versions collection. # @api private def versions_delete_markers versions + delete_markers end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/bucket.rb0000644000004100000410000000664713536452011023104 0ustar www-datawww-datarequire 'uri' module Aws module S3 class Bucket # Deletes all objects and versioned objects from this bucket # # @example # # bucket.clear! # # @return [void] def clear! object_versions.batch_delete! end # Deletes all objects and versioned objects from this bucket and # then deletes the bucket. # # @example # # bucket.delete! # # @option options [Integer] :max_attempts (3) Maximum number of times to # attempt to delete the empty bucket before raising # `Aws::S3::Errors::BucketNotEmpty`. # # @option options [Float] :initial_wait (1.3) Seconds to wait before # retrying the call to delete the bucket, exponentially increased for # each attempt. # # @return [void] def delete! options = { } options = { initial_wait: 1.3, max_attempts: 3, }.merge(options) attempts = 0 begin clear! delete rescue Errors::BucketNotEmpty attempts += 1 if attempts >= options[:max_attempts] raise else Kernel.sleep(options[:initial_wait] ** attempts) retry end end end # Returns a public URL for this bucket. # # bucket = s3.bucket('bucket-name') # bucket.url # #=> "https://bucket-name.s3.amazonaws.com" # # You can pass `virtual_host: true` to use the bucket name as the # host name. # # bucket = s3.bucket('my.bucket.com') # bucket.url(virtual_host: true) # #=> "http://my.bucket.com" # # @option options [Boolean] :virtual_host (false) When `true`, # the bucket name will be used as the host name. This is useful # when you have a CNAME configured for this bucket. # # @return [String] the URL for this bucket. def url(options = {}) if options[:virtual_host] "http://#{name}" else s3_bucket_url end end # Creates a {PresignedPost} that makes it easy to upload a file from # a web browser direct to Amazon S3 using an HTML post form with # a file field. # # See the {PresignedPost} documentation for more information. # @note You must specify `:key` or `:key_starts_with`. All other options # are optional. # @option (see PresignedPost#initialize) # @return [PresignedPost] # @see PresignedPost def presigned_post(options = {}) PresignedPost.new( client.config.credentials, client.config.region, name, {url: url}.merge(options) ) end # @api private def load @data = client.list_buckets.buckets.find { |b| b.name == name } raise "unable to load bucket #{name}" if @data.nil? self end private def s3_bucket_url url = client.config.endpoint.dup if bucket_as_hostname?(url.scheme == 'https') url.host = "#{name}.#{url.host}" else url.path += '/' unless url.path[-1] == '/' url.path += Seahorse::Util.uri_escape(name) end url.to_s end def bucket_as_hostname?(https) Plugins::BucketDns.dns_compatible?(name, https) && !client.config.force_path_style end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/object_summary.rb0000644000004100000410000000441513536452011024641 0ustar www-datawww-datamodule Aws module S3 class ObjectSummary alias content_length size # @param (see Object#copy_from) # @options (see Object#copy_from) # @return (see Object#copy_from) # @see Object#copy_from def copy_from(source, options = {}) object.copy_from(source, options) end # @param (see Object#copy_to) # @options (see Object#copy_to) # @return (see Object#copy_to) # @see Object#copy_to def copy_to(target, options = {}) object.copy_to(target, options) end # @param (see Object#move_to) # @options (see Object#move_to) # @return (see Object#move_to) # @see Object#move_to def move_to(target, options = {}) object.move_to(target, options) end # @param (see Object#presigned_post) # @options (see Object#presigned_post) # @return (see Object#presigned_post) # @see Object#presigned_post def presigned_post(options = {}) object.presigned_post(options) end # @param (see Object#presigned_url) # @options (see Object#presigned_url) # @return (see Object#presigned_url) # @see Object#presigned_url def presigned_url(http_method, params = {}) object.presigned_url(http_method, params) end # @param (see Object#public_url) # @options (see Object#public_url) # @return (see Object#public_url) # @see Object#public_url def public_url(options = {}) object.public_url(options) end # @param (see Object#upload_file) # @options (see Object#upload_file) # @return (see Object#upload_file) # @see Object#upload_file def upload_file(source, options = {}) object.upload_file(source, options) end # @options (see Object#upload_stream) # @return (see Object#upload_stream) # @see Object#upload_stream def upload_stream(options = {}, &block) object.upload_stream(options, &block) end # @param (see Object#download_file) # @options (see Object#download_file) # @return (see Object#download_file) # @see Object#download_file def download_file(destination, options = {}) object.download_file(destination, options) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/object.rb0000644000004100000410000003376713536452011023100 0ustar www-datawww-datamodule Aws module S3 class Object alias size content_length # Copies another object to this object. Use `multipart_copy: true` # for large objects. This is required for objects that exceed 5GB. # # @param [S3::Object, S3::ObjectVersion, S3::ObjectSummary, String, Hash] source # Where to copy object data from. `source` must be one of the following: # # * {Aws::S3::Object} # * {Aws::S3::ObjectSummary} # * {Aws::S3::ObjectVersion} # * Hash - with `:bucket` and `:key` and optional `:version_id` # * String - formatted like `"source-bucket-name/uri-escaped-key"` # or `"source-bucket-name/uri-escaped-key?versionId=version-id"` # # @option options [Boolean] :multipart_copy (false) When `true`, # the object will be copied using the multipart APIs. This is # necessary for objects larger than 5GB and can provide # performance improvements on large objects. Amazon S3 does # not accept multipart copies for objects smaller than 5MB. # # @option options [Integer] :content_length Only used when # `:multipart_copy` is `true`. Passing this options avoids a HEAD # request to query the source object size. # # @option options [S3::Client] :copy_source_client Only used when # `:multipart_copy` is `true` and the source object is in a # different region. You do not need to specify this option # if you have provided `:content_length`. # # @option options [String] :copy_source_region Only used when # `:multipart_copy` is `true` and the source object is in a # different region. You do not need to specify this option # if you have provided a `:source_client` or a `:content_length`. # # @example Basic object copy # # bucket = Aws::S3::Bucket.new('target-bucket') # object = bucket.object('target-key') # # # source as String # object.copy_from('source-bucket/source-key') # # # source as Hash # object.copy_from(bucket:'source-bucket', key:'source-key') # # # source as Aws::S3::Object # object.copy_from(bucket.object('source-key')) # # @example Managed copy of large objects # # # uses multipart upload APIs to copy object # object.copy_from('src-bucket/src-key', multipart_copy: true) # # @see #copy_to # def copy_from(source, options = {}) if Hash === source && source[:copy_source] # for backwards compatibility @client.copy_object(source.merge(bucket: bucket_name, key: key)) else ObjectCopier.new(self, options).copy_from(source, options) end end # Copies this object to another object. Use `multipart_copy: true` # for large objects. This is required for objects that exceed 5GB. # # @note If you need to copy to a bucket in a different region, use # {#copy_from}. # # @param [S3::Object, String, Hash] target Where to copy the object # data to. `target` must be one of the following: # # * {Aws::S3::Object} # * Hash - with `:bucket` and `:key` # * String - formatted like `"target-bucket-name/target-key"` # # @example Basic object copy # # bucket = Aws::S3::Bucket.new('source-bucket') # object = bucket.object('source-key') # # # target as String # object.copy_to('target-bucket/target-key') # # # target as Hash # object.copy_to(bucket: 'target-bucket', key: 'target-key') # # # target as Aws::S3::Object # object.copy_to(bucket.object('target-key')) # # @example Managed copy of large objects # # # uses multipart upload APIs to copy object # object.copy_to('src-bucket/src-key', multipart_copy: true) # def copy_to(target, options = {}) ObjectCopier.new(self, options).copy_to(target, options) end # Copies and deletes the current object. The object will only be # deleted if the copy operation succeeds. # @param (see Object#copy_to) # @option (see Object#copy_to) # @return [void] # @see Object#copy_to # @see Object#delete def move_to(target, options = {}) copy_to(target, options) delete end # Creates a {PresignedPost} that makes it easy to upload a file from # a web browser direct to Amazon S3 using an HTML post form with # a file field. # # See the {PresignedPost} documentation for more information. # # @option (see PresignedPost#initialize) # @return [PresignedPost] # @see PresignedPost def presigned_post(options = {}) PresignedPost.new( client.config.credentials, client.config.region, bucket_name, { key: key, url: bucket.url, }.merge(options) ) end # Generates a pre-signed URL for this object. # # @example Pre-signed GET URL, valid for one hour # # obj.presigned_url(:get, expires_in: 3600) # #=> "https://bucket-name.s3.amazonaws.com/object-key?..." # # @example Pre-signed PUT with a canned ACL # # # the object uploaded using this URL will be publicly accessible # obj.presigned_url(:put, acl: 'public-read') # #=> "https://bucket-name.s3.amazonaws.com/object-key?..." # # @param [Symbol] http_method # The HTTP method to generate a presigned URL for. Valid values # are `:get`, `:put`, `:head`, and `:delete`. # # @param [Hash] params # Additional request parameters to use when generating the pre-signed # URL. See the related documentation in {Client} for accepted # params. # # | HTTP Method | Client Method | # |---------------|------------------------| # | `:get` | {Client#get_object} | # | `:put` | {Client#put_object} | # | `:head` | {Client#head_object} | # | `:delete` | {Client#delete_object} | # # @option params [Boolean] :virtual_host (false) When `true` the # presigned URL will use the bucket name as a virtual host. # # bucket = Aws::S3::Bucket.new('my.bucket.com') # bucket.object('key').presigned_url(virtual_host: true) # #=> "http://my.bucket.com/key?..." # # @option params [Integer] :expires_in (900) Number of seconds before # the pre-signed URL expires. This may not exceed one week (604800 # seconds). Note that the pre-signed URL is also only valid as long as # credentials used to sign it are. For example, when using IAM roles, # temporary tokens generated for signing also have a default expiration # which will affect the effective expiration of the pre-signed URL. # # @raise [ArgumentError] Raised if `:expires_in` exceeds one week # (604800 seconds). # # @return [String] # def presigned_url(http_method, params = {}) presigner = Presigner.new(client: client) presigner.presigned_url("#{http_method.downcase}_object", params.merge( bucket: bucket_name, key: key, )) end # Returns the public (un-signed) URL for this object. # # s3.bucket('bucket-name').object('obj-key').public_url # #=> "https://bucket-name.s3.amazonaws.com/obj-key" # # To use virtual hosted bucket url (disables https): # # s3.bucket('my.bucket.com').object('key').public_url(virtual_host: true) # #=> "http://my.bucket.com/key" # # @option options [Boolean] :virtual_host (false) When `true`, the bucket # name will be used as the host name. This is useful when you have # a CNAME configured for the bucket. # # @return [String] def public_url(options = {}) url = URI.parse(bucket.url(options)) url.path += '/' unless url.path[-1] == '/' url.path += key.gsub(/[^\/]+/) { |s| Seahorse::Util.uri_escape(s) } url.to_s end # Uploads a stream in a streaming fashion to the current object in S3. # # # Passed chunks automatically split into multipart upload parts # # and the parts are uploaded in parallel. This allows for streaming uploads # # that never touch the disk. # # Note that this is known to have issues in JRuby until jruby-9.1.15.0, so avoid using this with older versions of JRuby. # # @example Streaming chunks of data # obj.upload_stream do |write_stream| # 10.times { write_stream << 'foo' } # end # @example Streaming chunks of data # obj.upload_stream do |write_stream| # IO.copy_stream(IO.popen('ls'), write_stream) # end # @example Streaming chunks of data # obj.upload_stream do |write_stream| # IO.copy_stream(STDIN, write_stream) # end # # @option options [Integer] :thread_count # The number of parallel multipart uploads # Default `:thread_count` is `10`. # # @option options [Boolean] :tempfile # Normally read data is stored in memory when building the parts in order to complete # the underlying multipart upload. By passing `:tempfile => true` data read will be # temporarily stored on disk reducing the memory footprint vastly. # Default `:tempfile` is `false`. # # @option options [Integer] :part_size # Define how big each part size but the last should be. # Default `:part_size` is `5 * 1024 * 1024`. # # @raise [MultipartUploadError] If an object is being uploaded in # parts, and the upload can not be completed, then the upload is # aborted and this error is raised. The raised error has a `#errors` # method that returns the failures that caused the upload to be # aborted. # # @return [Boolean] Returns `true` when the object is uploaded # without any errors. # def upload_stream(options = {}, &block) uploading_options = options.dup uploader = MultipartStreamUploader.new( client: client, thread_count: uploading_options.delete(:thread_count), tempfile: uploading_options.delete(:tempfile), part_size: uploading_options.delete(:part_size), ) uploader.upload(uploading_options.merge(bucket: bucket_name, key: key), &block) true end # Uploads a file from disk to the current object in S3. # # # small files are uploaded in a single API call # obj.upload_file('/path/to/file') # # Files larger than `:multipart_threshold` are uploaded using the # Amazon S3 multipart upload APIs. # # # large files are automatically split into parts # # and the parts are uploaded in parallel # obj.upload_file('/path/to/very_large_file') # # @param [String,Pathname,File,Tempfile] source A file or path to a file # on the local file system that should be uploaded to this object. # If you pass an open file object, then it is your responsibility # to close the file object once the upload completes. # # @option options [Integer] :multipart_threshold (15728640) Files larger # than `:multipart_threshold` are uploaded using the S3 multipart APIs. # Default threshold is 15MB. # # @raise [MultipartUploadError] If an object is being uploaded in # parts, and the upload can not be completed, then the upload is # aborted and this error is raised. The raised error has a `#errors` # method that returns the failures that caused the upload to be # aborted. # # @return [Boolean] Returns `true` when the object is uploaded # without any errors. # def upload_file(source, options = {}) uploading_options = options.dup uploader = FileUploader.new( multipart_threshold: uploading_options.delete(:multipart_threshold), client: client) uploader.upload(source, uploading_options.merge(bucket: bucket_name, key: key)) true end # Downloads a file in S3 to a path on disk. # # # small files (< 5MB) are downloaded in a single API call # obj.download_file('/path/to/file') # # Files larger than 5MB are downloaded using multipart method # # # large files are split into parts # # and the parts are downloaded in parallel # obj.download_file('/path/to/very_large_file') # # @param [String] destination Where to download the file to # # @option options [String] mode `auto`, `single_request`, `get_range` # `single_request` mode forces only 1 GET request is made in download, # `get_range` mode allows `chunk_size` parameter to configured in # customizing each range size in multipart_download, # By default, `auto` mode is enabled, which performs multipart_download # # @option options [String] chunk_size required in get_range mode # # @option options [String] thread_count Customize threads used in multipart # download, if not provided, 10 is default value # # @option options [String] version_id The object version id used to retrieve # the object, to know more about object versioning, see: # https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectVersioning.html # # @return [Boolean] Returns `true` when the file is downloaded # without any errors. def download_file(destination, options = {}) downloader = FileDownloader.new(client: client) downloader.download( destination, options.merge(bucket: bucket_name, key: key)) true end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations/multipart_upload.rb0000644000004100000410000000240513536452011025200 0ustar www-datawww-datamodule Aws module S3 class MultipartUpload alias_method :basic_complete, :complete # Completes the upload, requires a list of completed parts. You can # provide the list of parts with `:part_number` and `:etag` values. # # upload.complete(multipart_upload: { parts: [ # { part_number: 1, etag:'etag1' }, # { part_number: 2, etag:'etag2' }, # ... # ]}) # # Alternatively, you can pass **`compute_parts: true`** and the part # list will be computed by calling {Client#list_parts}. # # upload.complete(compute_parts: true) # # @option options [Boolean] :compute_parts (false) When `true`, # the {Client#list_parts} method will be called to determine # the list of required part numbers and their ETags. # def complete(options = {}) if options.delete(:compute_parts) options[:multipart_upload] = { parts: compute_parts } end basic_complete(options) end private def compute_parts parts.sort_by(&:part_number).each.with_object([]) do |part, part_list| part_list << { part_number: part.part_number, etag: part.etag } end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_policy.rb0000644000004100000410000001563213536452011021362 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketPolicy extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # The bucket policy as a JSON document. # @return [IO] def policy data[:policy] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketPolicy}. # Returns `self` making it possible to chain methods. # # bucket_policy.reload.data # # @return [self] def load resp = @client.get_bucket_policy(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketPolicyOutput] # Returns the data for this {BucketPolicy}. Calls # {Client#get_bucket_policy} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_policy.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.delete_bucket_policy(options) resp.data end # @example Request syntax with placeholder values # # bucket_policy.put({ # content_md5: "ContentMD5", # confirm_remove_self_bucket_access: false, # policy: "Policy", # required # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [Boolean] :confirm_remove_self_bucket_access # Set this parameter to true to confirm that you want to remove your # permissions to change this bucket policy in the future. # @option options [required, String] :policy # The bucket policy as a JSON document. # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_policy(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_request_payment.rb0000644000004100000410000001505313536452011023305 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketRequestPayment extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # Specifies who pays for the download and request fees. # @return [String] def payer data[:payer] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketRequestPayment}. # Returns `self` making it possible to chain methods. # # bucket_request_payment.reload.data # # @return [self] def load resp = @client.get_bucket_request_payment(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketRequestPaymentOutput] # Returns the data for this {BucketRequestPayment}. Calls # {Client#get_bucket_request_payment} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_request_payment.put({ # content_md5: "ContentMD5", # request_payment_configuration: { # required # payer: "Requester", # required, accepts Requester, BucketOwner # }, # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [required, Types::RequestPaymentConfiguration] :request_payment_configuration # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_request_payment(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/customizations.rb0000644000004100000410000000210513536452011021610 0ustar www-datawww-data# utility classes require 'aws-sdk-s3/bucket_region_cache' require 'aws-sdk-s3/encryption' require 'aws-sdk-s3/file_part' require 'aws-sdk-s3/file_uploader' require 'aws-sdk-s3/file_downloader' require 'aws-sdk-s3/legacy_signer' require 'aws-sdk-s3/multipart_file_uploader' require 'aws-sdk-s3/multipart_stream_uploader' require 'aws-sdk-s3/multipart_upload_error' require 'aws-sdk-s3/object_copier' require 'aws-sdk-s3/object_multipart_copier' require 'aws-sdk-s3/presigned_post' require 'aws-sdk-s3/presigner' # customizations to generated classes require 'aws-sdk-s3/customizations/bucket' require 'aws-sdk-s3/customizations/object' require 'aws-sdk-s3/customizations/object_summary' require 'aws-sdk-s3/customizations/multipart_upload' require 'aws-sdk-s3/customizations/types/list_object_versions_output' [ Aws::S3::Object::Collection, Aws::S3::ObjectSummary::Collection, Aws::S3::ObjectVersion::Collection, ].each do |klass| klass.send(:alias_method, :delete, :batch_delete!) klass.send(:extend, Aws::Deprecations) klass.send(:deprecated, :delete, use: :batch_delete!) end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/0000755000004100000410000000000013536452011020364 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb0000644000004100000410000000320313536452011024420 0ustar www-datawww-datamodule Aws module S3 module Encryption # @api private class IOAuthDecrypter # @option options [required, IO#write] :io # An IO-like object that responds to {#write}. # @option options [required, Integer] :encrypted_content_length # The number of bytes to decrypt from the `:io` object. # This should be the total size of `:io` minus the length of # the cipher auth tag. # @option options [required, OpenSSL::Cipher] :cipher An initialized # cipher that can be used to decrypt the bytes as they are # written to the `:io` object. The cipher should already have # its `#auth_tag` set. def initialize(options = {}) @decrypter = IODecrypter.new(options[:cipher], options[:io]) @max_bytes = options[:encrypted_content_length] @bytes_written = 0 end def write(chunk) chunk = truncate_chunk(chunk) if chunk.bytesize > 0 @bytes_written += chunk.bytesize @decrypter.write(chunk) end end def finalize @decrypter.finalize end def io @decrypter.io end private def truncate_chunk(chunk) if chunk.bytesize + @bytes_written <= @max_bytes chunk elsif @bytes_written < @max_bytes chunk[0..(@max_bytes - @bytes_written - 1)] else # If the tag was sent over after the full body has been read, # we don't want to accidentally append it. "" end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/key_provider.rb0000644000004100000410000000153313536452011023415 0ustar www-datawww-datamodule Aws module S3 module Encryption # This module defines the interface required for a {Client#key_provider}. # A key provider is any object that: # # * Responds to {#encryption_materials} with an {Materials} object. # # * Responds to {#key_for}, receiving a JSON document String, # returning an encryption key. The returned encryption key # must be one of: # # * `OpenSSL::PKey::RSA` - for asymmetric encryption # * `String` - 32, 24, or 16 bytes long, for symmetric encryption # module KeyProvider # @return [Materials] def encryption_materials; end # @param [String] materials_description # @return [OpenSSL::PKey::RSA, String] encryption_key def key_for(materials_description); end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/default_key_provider.rb0000644000004100000410000000220313536452011025114 0ustar www-datawww-datamodule Aws module S3 module Encryption # The default key provider is constructed with a single key # that is used for both encryption and decryption, ignoring # the possible per-object envelope encryption materials description. # @api private class DefaultKeyProvider include KeyProvider # @option options [required, OpenSSL::PKey::RSA, String] :encryption_key # The master key to use for encrypting objects. # @option options [String] :materials_description ('{}') # A description of the encryption key. def initialize(options = {}) @encryption_materials = Materials.new( key: options[:encryption_key], description: options[:materials_description] || '{}' ) end # @return [Materials] def encryption_materials @encryption_materials end # @param [String] materials_description # @return Returns the key given in the constructor. def key_for(materials_description) @encryption_materials.key end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/io_decrypter.rb0000644000004100000410000000107113536452011023400 0ustar www-datawww-datamodule Aws module S3 module Encryption # @api private class IODecrypter # @param [OpenSSL::Cipher] cipher # @param [IO#write] io An IO-like object that responds to `#write`. def initialize(cipher, io) @cipher = cipher.clone @io = io end # @return [#write] attr_reader :io def write(chunk) # decrypt and write @io.write(@cipher.update(chunk)) end def finalize @io.write(@cipher.final) end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/decrypt_handler.rb0000644000004100000410000001411413536452011024061 0ustar www-datawww-datarequire 'base64' module Aws module S3 module Encryption # @api private class DecryptHandler < Seahorse::Client::Handler V1_ENVELOPE_KEYS = %w( x-amz-key x-amz-iv x-amz-matdesc ) V2_ENVELOPE_KEYS = %w( x-amz-key-v2 x-amz-iv x-amz-cek-alg x-amz-wrap-alg x-amz-matdesc ) POSSIBLE_ENVELOPE_KEYS = (V1_ENVELOPE_KEYS + V2_ENVELOPE_KEYS).uniq POSSIBLE_ENCRYPTION_FORMATS = %w( AES/GCM/NoPadding AES/CBC/PKCS5Padding AES/CBC/PKCS7Padding ) def call(context) attach_http_event_listeners(context) @handler.call(context) end private def attach_http_event_listeners(context) context.http_response.on_headers(200) do cipher = decryption_cipher(context) decrypter = body_contains_auth_tag?(context) ? authenticated_decrypter(context, cipher) : IODecrypter.new(cipher, context.http_response.body) context.http_response.body = decrypter end context.http_response.on_success(200) do decrypter = context.http_response.body decrypter.finalize decrypter.io.rewind if decrypter.io.respond_to?(:rewind) context.http_response.body = decrypter.io end context.http_response.on_error do if context.http_response.body.respond_to?(:io) context.http_response.body = context.http_response.body.io end end end def decryption_cipher(context) if envelope = get_encryption_envelope(context) context[:encryption][:cipher_provider].decryption_cipher(envelope) else raise Errors::DecryptionError, "unable to locate encryption envelope" end end def get_encryption_envelope(context) if context[:encryption][:envelope_location] == :metadata envelope_from_metadata(context) || envelope_from_instr_file(context) else envelope_from_instr_file(context) || envelope_from_metadata(context) end end def envelope_from_metadata(context) possible_envelope = {} POSSIBLE_ENVELOPE_KEYS.each do |suffix| if value = context.http_response.headers["x-amz-meta-#{suffix}"] possible_envelope[suffix] = value end end extract_envelope(possible_envelope) end def envelope_from_instr_file(context) suffix = context[:encryption][:instruction_file_suffix] possible_envelope = Json.load(context.client.get_object( bucket: context.params[:bucket], key: context.params[:key] + suffix ).body.read) extract_envelope(possible_envelope) rescue S3::Errors::ServiceError, Json::ParseError nil end def extract_envelope(hash) return v1_envelope(hash) if hash.key?('x-amz-key') return v2_envelope(hash) if hash.key?('x-amz-key-v2') if hash.keys.any? { |key| key.match(/^x-amz-key-(.+)$/) } msg = "unsupported envelope encryption version #{$1}" raise Errors::DecryptionError, msg else nil # no envelope found end end def v1_envelope(envelope) envelope end def v2_envelope(envelope) unless POSSIBLE_ENCRYPTION_FORMATS.include? envelope['x-amz-cek-alg'] alg = envelope['x-amz-cek-alg'].inspect msg = "unsupported content encrypting key (cek) format: #{alg}" raise Errors::DecryptionError, msg end unless envelope['x-amz-wrap-alg'] == 'kms' # possible to support # RSA/ECB/OAEPWithSHA-256AndMGF1Padding alg = envelope['x-amz-wrap-alg'].inspect msg = "unsupported key wrapping algorithm: #{alg}" raise Errors::DecryptionError, msg end unless V2_ENVELOPE_KEYS.sort == envelope.keys.sort msg = "incomplete v2 encryption envelope:\n" msg += " expected: #{V2_ENVELOPE_KEYS.join(',')}\n" msg += " got: #{envelope_keys.join(', ')}" raise Errors::DecryptionError, msg end envelope end # When the x-amz-meta-x-amz-tag-len header is present, it indicates # that the body of this object has a trailing auth tag. The header # indicates the length of that tag. # # This method fetches the tag from the end of the object by # making a GET Object w/range request. This auth tag is used # to initialize the cipher, and the decrypter truncates the # auth tag from the body when writing the final bytes. def authenticated_decrypter(context, cipher) if RUBY_VERSION.match(/1.9/) raise "authenticated decryption not supported by OpeenSSL in Ruby version ~> 1.9" raise Aws::Errors::NonSupportedRubyVersionError, msg end http_resp = context.http_response content_length = http_resp.headers['content-length'].to_i auth_tag_length = http_resp.headers['x-amz-meta-x-amz-tag-len'] auth_tag_length = auth_tag_length.to_i / 8 auth_tag = context.client.get_object( bucket: context.params[:bucket], key: context.params[:key], range: "bytes=-#{auth_tag_length}" ).body.read cipher.auth_tag = auth_tag cipher.auth_data = '' # The encrypted object contains both the cipher text # plus a trailing auth tag. This decrypter will the body # expect for the trailing auth tag. IOAuthDecrypter.new( io: http_resp.body, encrypted_content_length: content_length - auth_tag_length, cipher: cipher) end def body_contains_auth_tag?(context) context.http_response.headers['x-amz-meta-x-amz-tag-len'] end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/default_cipher_provider.rb0000644000004100000410000000317313536452011025605 0ustar www-datawww-datarequire 'base64' module Aws module S3 module Encryption # @api private class DefaultCipherProvider def initialize(options = {}) @key_provider = options[:key_provider] end # @return [Array] Creates an returns a new encryption # envelope and encryption cipher. def encryption_cipher cipher = Utils.aes_encryption_cipher(:CBC) envelope = { 'x-amz-key' => encode64(encrypt(envelope_key(cipher))), 'x-amz-iv' => encode64(envelope_iv(cipher)), 'x-amz-matdesc' => materials_description, } [envelope, cipher] end # @return [Cipher] Given an encryption envelope, returns a # decryption cipher. def decryption_cipher(envelope) master_key = @key_provider.key_for(envelope['x-amz-matdesc']) key = Utils.decrypt(master_key, decode64(envelope['x-amz-key'])) iv = decode64(envelope['x-amz-iv']) Utils.aes_decryption_cipher(:CBC, key, iv) end private def envelope_key(cipher) cipher.key = cipher.random_key end def envelope_iv(cipher) cipher.iv = cipher.random_iv end def encrypt(data) Utils.encrypt(@key_provider.encryption_materials.key, data) end def materials_description @key_provider.encryption_materials.description end def encode64(str) Base64.encode64(str).split("\n") * "" end def decode64(str) Base64.decode64(str) end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/errors.rb0000644000004100000410000000030413536452011022222 0ustar www-datawww-datamodule Aws module S3 module Encryption module Errors class DecryptionError < RuntimeError; end class EncryptionError < RuntimeError; end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/client.rb0000644000004100000410000003356213536452011022200 0ustar www-datawww-datamodule Aws module S3 # Provides an encryption client that encrypts and decrypts data client-side, # storing the encrypted data in Amazon S3. # # This client uses a process called "envelope encryption". Your private # encryption keys and your data's plain-text are **never** sent to # Amazon S3. **If you lose you encryption keys, you will not be able to # decrypt your data.** # # ## Envelope Encryption Overview # # The goal of envelope encryption is to combine the performance of # fast symmetric encryption while maintaining the secure key management # that asymmetric keys provide. # # A one-time-use symmetric key (envelope key) is generated client-side. # This is used to encrypt the data client-side. This key is then # encrypted by your master key and stored alongside your data in Amazon # S3. # # When accessing your encrypted data with the encryption client, # the encrypted envelope key is retrieved and decrypted client-side # with your master key. The envelope key is then used to decrypt the # data client-side. # # One of the benefits of envelope encryption is that if your master key # is compromised, you have the option of just re-encrypting the stored # envelope symmetric keys, instead of re-encrypting all of the # data in your account. # # ## Basic Usage # # The encryption client requires an {Aws::S3::Client}. If you do not # provide a `:client`, then a client will be constructed for you. # # require 'openssl' # key = OpenSSL::PKey::RSA.new(1024) # # # encryption client # s3 = Aws::S3::Encryption::Client.new(encryption_key: key) # # # round-trip an object, encrypted/decrypted locally # s3.put_object(bucket:'aws-sdk', key:'secret', body:'handshake') # s3.get_object(bucket:'aws-sdk', key:'secret').body.read # #=> 'handshake' # # # reading encrypted object without the encryption client # # results in the getting the cipher text # Aws::S3::Client.new.get_object(bucket:'aws-sdk', key:'secret').body.read # #=> "... cipher text ..." # # ## Keys # # For client-side encryption to work, you must provide one of the following: # # * An encryption key # * A {KeyProvider} # * A KMS encryption key id # # ### An Encryption Key # # You can pass a single encryption key. This is used as a master key # encrypting and decrypting all object keys. # # key = OpenSSL::Cipher.new("AES-256-ECB").random_key # symmetric key # key = OpenSSL::PKey::RSA.new(1024) # asymmetric key pair # # s3 = Aws::S3::Encryption::Client.new(encryption_key: key) # # ### Key Provider # # Alternatively, you can use a {KeyProvider}. A key provider makes # it easy to work with multiple keys and simplifies key rotation. # # ### KMS Encryption Key Id # # If you pass the id to an AWS Key Management Service (KMS) key, # then KMS will be used to generate, encrypt and decrypt object keys. # # # keep track of the kms key id # kms = Aws::KMS::Client.new # key_id = kms.create_key.key_metadata.key_id # # Aws::S3::Encryption::Client.new( # kms_key_id: key_id, # kms_client: kms, # ) # # ## Custom Key Providers # # A {KeyProvider} is any object that responds to: # # * `#encryption_materials` # * `#key_for(materials_description)` # # Here is a trivial implementation of an in-memory key provider. # This is provided as a demonstration of the key provider interface, # and should not be used in production: # # class KeyProvider # # def initialize(default_key_name, keys) # @keys = keys # @encryption_materials = Aws::S3::Encryption::Materials.new( # key: @keys[default_key_name], # description: JSON.dump(key: default_key_name), # ) # end # # attr_reader :encryption_materials # # def key_for(matdesc) # key_name = JSON.load(matdesc)['key'] # if key = @keys[key_name] # key # else # raise "encryption key not found for: #{matdesc.inspect}" # end # end # end # # Given the above key provider, you can create an encryption client that # chooses the key to use based on the materials description stored with # the encrypted object. This makes it possible to use multiple keys # and simplifies key rotation. # # # uses "new-key" for encrypting objects, uses either for decrypting # keys = KeyProvider.new('new-key', { # "old-key" => Base64.decode64("kM5UVbhE/4rtMZJfsadYEdm2vaKFsmV2f5+URSeUCV4="), # "new-key" => Base64.decode64("w1WLio3agRWRTSJK/Ouh8NHoqRQ6fn5WbSXDTHjXMSo="), # }), # # # chooses the key based on the materials description stored # # with the encrypted object # s3 = Aws::S3::Encryption::Client.new(key_provider: keys) # # ## Materials Description # # A materials description is JSON document string that is stored # in the metadata (or instruction file) of an encrypted object. # The {DefaultKeyProvider} uses the empty JSON document `"{}"`. # # When building a key provider, you are free to store whatever # information you need to identify the master key that was used # to encrypt the object. # # ## Envelope Location # # By default, the encryption client store the encryption envelope # with the object, as metadata. You can choose to have the envelope # stored in a separate "instruction file". An instruction file # is an object, with the key of the encrypted object, suffixed with # `".instruction"`. # # Specify the `:envelope_location` option as `:instruction_file` to # use an instruction file for storing the envelope. # # # default behavior # s3 = Aws::S3::Encryption::Client.new( # key_provider: ..., # envelope_location: :metadata, # ) # # # store envelope in a separate object # s3 = Aws::S3::Encryption::Client.new( # key_provider: ..., # envelope_location: :instruction_file, # instruction_file_suffix: '.instruction' # default # ) # # When using an instruction file, multiple requests are made when # putting and getting the object. **This may cause issues if you are # issuing concurrent PUT and GET requests to an encrypted object.** # module Encryption class Client extend Deprecations # Creates a new encryption client. You must provide one of the following # options: # # * `:encryption_key` # * `:kms_key_id` # * `:key_provider` # # You may also pass any other options accepted by `Client#initialize`. # # @option options [S3::Client] :client A basic S3 client that is used # to make api calls. If a `:client` is not provided, a new {S3::Client} # will be constructed. # # @option options [OpenSSL::PKey::RSA, String] :encryption_key The master # key to use for encrypting/decrypting all objects. # # @option options [String] :kms_key_id When you provide a `:kms_key_id`, # then AWS Key Management Service (KMS) will be used to manage the # object encryption keys. By default a {KMS::Client} will be # constructed for KMS API calls. Alternatively, you can provide # your own via `:kms_client`. # # @option options [#key_for] :key_provider Any object that responds # to `#key_for`. This method should accept a materials description # JSON document string and return return an encryption key. # # @option options [Symbol] :envelope_location (:metadata) Where to # store the envelope encryption keys. By default, the envelope is # stored with the encrypted object. If you pass `:instruction_file`, # then the envelope is stored in a separate object in Amazon S3. # # @option options [String] :instruction_file_suffix ('.instruction') # When `:envelope_location` is `:instruction_file` then the # instruction file uses the object key with this suffix appended. # # @option options [KMS::Client] :kms_client A default {KMS::Client} # is constructed when using KMS to manage encryption keys. # def initialize(options = {}) @client = extract_client(options) @cipher_provider = cipher_provider(options) @envelope_location = extract_location(options) @instruction_file_suffix = extract_suffix(options) end # @return [S3::Client] attr_reader :client # @return [KeyProvider, nil] Returns `nil` if you are using # AWS Key Management Service (KMS). attr_reader :key_provider # @return [Symbol<:metadata, :instruction_file>] attr_reader :envelope_location # @return [String] When {#envelope_location} is `:instruction_file`, # the envelope is stored in the object with the object key suffixed # by this string. attr_reader :instruction_file_suffix # Uploads an object to Amazon S3, encrypting data client-side. # See {S3::Client#put_object} for documentation on accepted # request parameters. # @option (see S3::Client#put_object) # @return (see S3::Client#put_object) # @see S3::Client#put_object def put_object(params = {}) req = @client.build_request(:put_object, params) req.handlers.add(EncryptHandler, priority: 95) req.context[:encryption] = { cipher_provider: @cipher_provider, envelope_location: @envelope_location, instruction_file_suffix: @instruction_file_suffix, } req.send_request end # Gets an object from Amazon S3, decrypting data locally. # See {S3::Client#get_object} for documentation on accepted # request parameters. # @option params [String] :instruction_file_suffix The suffix # used to find the instruction file containing the encryption # envelope. You should not set this option when the envelope # is stored in the object metadata. Defaults to # {#instruction_file_suffix}. # @option params [String] :instruction_file_suffix # @option (see S3::Client#get_object) # @return (see S3::Client#get_object) # @see S3::Client#get_object # @note The `:range` request parameter is not yet supported. def get_object(params = {}, &block) if params[:range] raise NotImplementedError, '#get_object with :range not supported yet' end envelope_location, instruction_file_suffix = envelope_options(params) req = @client.build_request(:get_object, params) req.handlers.add(DecryptHandler) req.context[:encryption] = { cipher_provider: @cipher_provider, envelope_location: envelope_location, instruction_file_suffix: instruction_file_suffix, } req.send_request(target: block) end private def extract_client(options) options[:client] || begin options = options.dup options.delete(:kms_key_id) options.delete(:kms_client) options.delete(:key_provider) options.delete(:encryption_key) options.delete(:envelope_location) options.delete(:instruction_file_suffix) S3::Client.new(options) end end def kms_client(options) options[:kms_client] || begin KMS::Client.new( region: @client.config.region, credentials: @client.config.credentials, ) end end def cipher_provider(options) if options[:kms_key_id] KmsCipherProvider.new( kms_key_id: options[:kms_key_id], kms_client: kms_client(options), ) else # kept here for backwards compatability, {#key_provider} is deprecated @key_provider = extract_key_provider(options) DefaultCipherProvider.new(key_provider: @key_provider) end end def extract_key_provider(options) if options[:key_provider] options[:key_provider] elsif options[:encryption_key] DefaultKeyProvider.new(options) else msg = "you must pass a :kms_key_id, :key_provider, or :encryption_key" raise ArgumentError, msg end end def envelope_options(params) location = params.delete(:envelope_location) || @envelope_location suffix = params.delete(:instruction_file_suffix) if suffix [:instruction_file, suffix] else [location, @instruction_file_suffix] end end def extract_location(options) location = options[:envelope_location] || :metadata if [:metadata, :instruction_file].include?(location) location else msg = ":envelope_location must be :metadata or :instruction_file " msg << "got #{location.inspect}" raise ArgumentError, msg end end def extract_suffix(options) suffix = options[:instruction_file_suffix] || '.instruction' if String === suffix suffix else msg = ":instruction_file_suffix must be a String" raise ArgumentError, msg end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/encrypt_handler.rb0000644000004100000410000000316113536452011024073 0ustar www-datawww-datarequire 'base64' module Aws module S3 module Encryption # @api private class EncryptHandler < Seahorse::Client::Handler def call(context) envelope, cipher = context[:encryption][:cipher_provider].encryption_cipher apply_encryption_envelope(context, envelope, cipher) apply_encryption_cipher(context, cipher) @handler.call(context) end private def apply_encryption_envelope(context, envelope, cipher) context[:encryption][:cipher] = cipher if context[:encryption][:envelope_location] == :metadata context.params[:metadata] ||= {} context.params[:metadata].update(envelope) else # :instruction_file suffix = context[:encryption][:instruction_file_suffix] context.client.put_object( bucket: context.params[:bucket], key: context.params[:key] + suffix, body: Json.dump(envelope) ) end end def apply_encryption_cipher(context, cipher) io = context.params[:body] || '' io = StringIO.new(io) if String === io context.params[:body] = IOEncrypter.new(cipher, io) context.params[:metadata] ||= {} context.params[:metadata]['x-amz-unencrypted-content-length'] = io.size if md5 = context.params.delete(:content_md5) context.params[:metadata]['x-amz-unencrypted-content-md5'] = md5 end context.http_response.on_headers do context.params[:body].close end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/utils.rb0000644000004100000410000000517713536452011022063 0ustar www-datawww-datarequire 'openssl' module Aws module S3 module Encryption # @api private module Utils UNSAFE_MSG = "unsafe encryption, data is longer than key length" class << self def encrypt(key, data) case key when OpenSSL::PKey::RSA # asymmetric encryption warn(UNSAFE_MSG) if key.public_key.n.num_bits < cipher_size(data) key.public_encrypt(data) when String # symmetric encryption warn(UNSAFE_MSG) if cipher_size(key) < cipher_size(data) cipher = aes_encryption_cipher(:ECB, key) cipher.update(data) + cipher.final end end def decrypt(key, data) begin case key when OpenSSL::PKey::RSA # asymmetric decryption key.private_decrypt(data) when String # symmetric Decryption cipher = aes_cipher(:decrypt, :ECB, key, nil) cipher.update(data) + cipher.final end rescue OpenSSL::Cipher::CipherError msg = 'decryption failed, possible incorrect key' raise Errors::DecryptionError, msg end end # @param [String] block_mode "CBC" or "ECB" # @param [OpenSSL::PKey::RSA, String, nil] key # @param [String, nil] iv The initialization vector def aes_encryption_cipher(block_mode, key = nil, iv = nil) aes_cipher(:encrypt, block_mode, key, iv) end # @param [String] block_mode "CBC" or "ECB" # @param [OpenSSL::PKey::RSA, String, nil] key # @param [String, nil] iv The initialization vector def aes_decryption_cipher(block_mode, key = nil, iv = nil) aes_cipher(:decrypt, block_mode, key, iv) end # @param [String] mode "encrypt" or "decrypt" # @param [String] block_mode "CBC" or "ECB" # @param [OpenSSL::PKey::RSA, String, nil] key # @param [String, nil] iv The initialization vector def aes_cipher(mode, block_mode, key, iv) cipher = key ? OpenSSL::Cipher.new("aes-#{cipher_size(key)}-#{block_mode.downcase}") : OpenSSL::Cipher.new("aes-256-#{block_mode.downcase}") cipher.send(mode) # encrypt or decrypt cipher.key = key if key cipher.iv = iv if iv cipher end # @param [String] key # @return [Integer] # @raise ArgumentError def cipher_size(key) key.bytesize * 8 end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb0000644000004100000410000000433213536452011024751 0ustar www-datawww-datarequire 'base64' module Aws module S3 module Encryption # @api private class KmsCipherProvider def initialize(options = {}) @kms_key_id = options[:kms_key_id] @kms_client = options[:kms_client] end # @return [Array] Creates an returns a new encryption # envelope and encryption cipher. def encryption_cipher encryption_context = { "kms_cmk_id" => @kms_key_id } key_data = @kms_client.generate_data_key( key_id: @kms_key_id, encryption_context: encryption_context, key_spec: 'AES_256', ) cipher = Utils.aes_encryption_cipher(:CBC) cipher.key = key_data.plaintext envelope = { 'x-amz-key-v2' => encode64(key_data.ciphertext_blob), 'x-amz-iv' => encode64(cipher.iv = cipher.random_iv), 'x-amz-cek-alg' => 'AES/CBC/PKCS5Padding', 'x-amz-wrap-alg' => 'kms', 'x-amz-matdesc' => Json.dump(encryption_context) } [envelope, cipher] end # @return [Cipher] Given an encryption envelope, returns a # decryption cipher. def decryption_cipher(envelope) encryption_context = Json.load(envelope['x-amz-matdesc']) key = @kms_client.decrypt( ciphertext_blob: decode64(envelope['x-amz-key-v2']), encryption_context: encryption_context, ).plaintext iv = decode64(envelope['x-amz-iv']) block_mode = case envelope['x-amz-cek-alg'] when 'AES/CBC/PKCS5Padding' :CBC when 'AES/CBC/PKCS7Padding' :CBC when 'AES/GCM/NoPadding' :GCM else type = envelope['x-amz-cek-alg'].inspect msg = "unsupported content encrypting key (cek) format: #{type}" raise Errors::DecryptionError, msg end Utils.aes_decryption_cipher(block_mode, key, iv) end private def encode64(str) Base64.encode64(str).split("\n") * "" end def decode64(str) Base64.decode64(str) end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/io_encrypter.rb0000644000004100000410000000334513536452011023420 0ustar www-datawww-datarequire 'stringio' require 'tempfile' module Aws module S3 module Encryption # Provides an IO wrapper encrpyting a stream of data. # It is possible to use this same object for decrypting. You must # initialize it with a decryptiion cipher in that case and the # IO object must contain cipher text instead of plain text. # @api private class IOEncrypter # @api private ONE_MEGABYTE = 1024 * 1024 def initialize(cipher, io) @encrypted = io.size <= ONE_MEGABYTE ? encrypt_to_stringio(cipher, io.read) : encrypt_to_tempfile(cipher, io) @size = @encrypted.size end # @return [Integer] attr_reader :size def read(bytes = nil, output_buffer = nil) if Tempfile === @encrypted && @encrypted.closed? @encrypted.open @encrypted.binmode end @encrypted.read(bytes, output_buffer) end def rewind @encrypted.rewind end # @api private def close @encrypted.close if Tempfile === @encrypted end private def encrypt_to_stringio(cipher, plain_text) if plain_text.empty? StringIO.new(cipher.final) else StringIO.new(cipher.update(plain_text) + cipher.final) end end def encrypt_to_tempfile(cipher, io) encrypted = Tempfile.new(self.object_id.to_s) encrypted.binmode while chunk = io.read(ONE_MEGABYTE) encrypted.write(cipher.update(chunk)) end encrypted.write(cipher.final) encrypted.rewind encrypted end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption/materials.rb0000644000004100000410000000323513536452011022675 0ustar www-datawww-datarequire 'base64' module Aws module S3 module Encryption class Materials # @option options [required, OpenSSL::PKey::RSA, String] :key # The master key to use for encrypting/decrypting all objects. # # @option options [String] :description ('{}') # The encryption materials description. This is must be # a JSON document string. # def initialize(options = {}) @key = validate_key(options[:key]) @description = validate_desc(options[:description]) end # @return [OpenSSL::PKey::RSA, String] attr_reader :key # @return [String] attr_reader :description private def validate_key(key) case key when OpenSSL::PKey::RSA then key when String if [32, 24, 16].include?(key.bytesize) key else msg = "invalid key, symmetric key required to be 16, 24, or " msg << "32 bytes in length, saw length " + key.bytesize.to_s raise ArgumentError, msg end else msg = "invalid encryption key, expected an OpenSSL::PKey::RSA key " msg << "(for asymmetric encryption) or a String (for symmetric " msg << "encryption)." raise ArgumentError, msg end end def validate_desc(description) Json.load(description) description rescue Json::ParseError, EncodingError msg = "expected description to be a valid JSON document string" raise ArgumentError, msg end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_lifecycle.rb0000644000004100000410000001731213536452011022017 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketLifecycle extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Array] def rules data[:rules] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketLifecycle}. # Returns `self` making it possible to chain methods. # # bucket_lifecycle.reload.data # # @return [self] def load resp = @client.get_bucket_lifecycle(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketLifecycleOutput] # Returns the data for this {BucketLifecycle}. Calls # {Client#get_bucket_lifecycle} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_lifecycle.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.delete_bucket_lifecycle(options) resp.data end # @example Request syntax with placeholder values # # bucket_lifecycle.put({ # content_md5: "ContentMD5", # lifecycle_configuration: { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # required # status: "Enabled", # required, accepts Enabled, Disabled # transition: { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_transition: { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # }, # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [Types::LifecycleConfiguration] :lifecycle_configuration # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_lifecycle(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/multipart_upload_part.rb0000644000004100000410000003571613536452011023146 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class MultipartUploadPart extend Aws::Deprecations # @overload def initialize(bucket_name, object_key, multipart_upload_id, part_number, options = {}) # @param [String] bucket_name # @param [String] object_key # @param [String] multipart_upload_id # @param [Integer] part_number # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [required, String] :object_key # @option options [required, String] :multipart_upload_id # @option options [required, Integer] :part_number # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @object_key = extract_object_key(args, options) @multipart_upload_id = extract_multipart_upload_id(args, options) @part_number = extract_part_number(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [String] def object_key @object_key end # @return [String] def multipart_upload_id @multipart_upload_id end # @return [Integer] def part_number @part_number end # Date and time at which the part was uploaded. # @return [Time] def last_modified data[:last_modified] end # Entity tag returned when the part was uploaded. # @return [String] def etag data[:etag] end # Size in bytes of the uploaded part data. # @return [Integer] def size data[:size] end # @!endgroup # @return [Client] def client @client end # @raise [NotImplementedError] # @api private def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end alias :reload :load # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`. # @return [Types::Part] # Returns the data for this {MultipartUploadPart}. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # multipart_upload_part.copy_from({ # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # copy_source_range: "CopySourceRange", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [required, String] :copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # @option options [String] :copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified tag. # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # @option options [String] :copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # @option options [String] :copy_source_range # The range of bytes to copy from the source object. The range value # must use the form bytes=first-last, where the first and last are the # zero-based byte offsets to copy. For example, bytes=0-9 indicates that # you want to copy the first ten bytes of the source. You can copy a # range only if the source object is greater than 5 MB. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. This must be # the same encryption key specified in the initiate multipart upload # request. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # @option options [String] :copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use to # decrypt the source object. The encryption key provided in this header # must be one that was used when the source object was created. # @option options [String] :copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [Types::UploadPartCopyOutput] def copy_from(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @multipart_upload_id, part_number: @part_number ) resp = @client.upload_part_copy(options) resp.data end # @example Request syntax with placeholder values # # multipart_upload_part.upload({ # body: source_file, # content_length: 1, # content_md5: "ContentMD5", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [String, IO] :body # Object data. # @option options [Integer] :content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # @option options [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This parameter # is auto-populated when using the command from the CLI. This parameted # is required if object lock parameters are specified. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. This must be # the same encryption key specified in the initiate multipart upload # request. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [Types::UploadPartOutput] def upload(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @multipart_upload_id, part_number: @part_number ) resp = @client.upload_part(options) resp.data end # @!group Associations # @return [MultipartUpload] def multipart_upload MultipartUpload.new( bucket_name: @bucket_name, object_key: @object_key, id: @multipart_upload_id, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name, object_key: @object_key, multipart_upload_id: @multipart_upload_id, part_number: @part_number } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_object_key(args, options) value = args[1] || options.delete(:object_key) case value when String then value when nil then raise ArgumentError, "missing required option :object_key" else msg = "expected :object_key to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_multipart_upload_id(args, options) value = args[2] || options.delete(:multipart_upload_id) case value when String then value when nil then raise ArgumentError, "missing required option :multipart_upload_id" else msg = "expected :multipart_upload_id to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_part_number(args, options) value = args[3] || options.delete(:part_number) case value when Integer then value when nil then raise ArgumentError, "missing required option :part_number" else msg = "expected :part_number to be a Integer, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/file_part.rb0000644000004100000410000000324513536452011020470 0ustar www-datawww-datamodule Aws module S3 # A utility class that provides an IO-like interface to a portion of # a file on disk. # @api private class FilePart # @option options [required,String,Pathname,File,Tempfile] :source # @option options [required,Integer] :offset The file part will read # starting at this byte offset. # @option options [required,Integer] :size The maximum number of bytes to # read from the `:offset`. def initialize(options = {}) @source = options[:source] @first_byte = options[:offset] @last_byte = @first_byte + options[:size] @size = options[:size] @file = nil end # @return [String,Pathname,File,Tempfile] attr_reader :source # @return [Integer] attr_reader :first_byte # @return [Integer] attr_reader :last_byte # @return [Integer] attr_reader :size def read(bytes = nil, output_buffer = nil) open_file unless @file read_from_file(bytes, output_buffer) end def rewind if @file @file.seek(@first_byte) @position = @first_byte end 0 end def close @file.close if @file end private def open_file @file = File.open(@source, 'rb') rewind end def read_from_file(bytes, output_buffer) length = [remaining_bytes, *bytes].min data = @file.read(length, output_buffer) @position += data ? data.bytesize : 0 data.to_s unless bytes && (data.nil? || data.empty?) end def remaining_bytes @last_byte - @position end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/legacy_signer.rb0000644000004100000410000001340413536452011021334 0ustar www-datawww-datarequire 'set' require 'time' require 'openssl' require 'cgi' require 'webrick/httputils' require 'aws-sdk-core/query' module Aws module S3 # @api private class LegacySigner SIGNED_QUERYSTRING_PARAMS = Set.new(%w( acl delete cors lifecycle location logging notification partNumber policy requestPayment restore tagging torrent uploadId uploads versionId versioning versions website replication requestPayment accelerate response-content-type response-content-language response-expires response-cache-control response-content-disposition response-content-encoding )) def self.sign(context) new( context.config.credentials, context.params, context.config.force_path_style ).sign(context.http_request) end # @param [CredentialProvider] credentials def initialize(credentials, params, force_path_style) @credentials = credentials.credentials @params = Query::ParamList.new params.each_pair do |param_name, param_value| @params.set(param_name, param_value) end @force_path_style = force_path_style end attr_reader :credentials, :params def sign(request) if token = credentials.session_token request.headers["X-Amz-Security-Token"] = token end request.headers['Authorization'] = authorization(request) end def authorization(request) "AWS #{credentials.access_key_id}:#{signature(request)}" end def signature(request) string_to_sign = string_to_sign(request) signature = digest(credentials.secret_access_key, string_to_sign) uri_escape(signature) end def digest(secret, string_to_sign) Base64.encode64(hmac(secret, string_to_sign)).strip end def hmac(key, value) OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), key, value) end # From the S3 developer guide: # # StringToSign = # HTTP-Verb ` "\n" ` # content-md5 ` "\n" ` # content-type ` "\n" ` # date ` "\n" ` # CanonicalizedAmzHeaders + CanonicalizedResource; # def string_to_sign(request) [ request.http_method, request.headers.values_at('Content-Md5', 'Content-Type').join("\n"), signing_string_date(request), canonicalized_headers(request), canonicalized_resource(request.endpoint), ].flatten.compact.join("\n") end def signing_string_date(request) # if a date is provided via x-amz-date then we should omit the # Date header from the signing string (should appear as a blank line) if request.headers.detect{|k,v| k.to_s =~ /^x-amz-date$/i } '' else request.headers['Date'] = Time.now.httpdate end end # CanonicalizedAmzHeaders # # See the developer guide for more information on how this element # is generated. # def canonicalized_headers(request) x_amz = request.headers.select{|k, v| k =~ /^x-amz-/i } x_amz = x_amz.collect{|k, v| [k.downcase, v] } x_amz = x_amz.sort_by{|k, v| k } x_amz = x_amz.collect{|k, v| "#{k}:#{v.to_s.strip}" }.join("\n") x_amz == '' ? nil : x_amz end # From the S3 developer guide # # CanonicalizedResource = # [ "/" ` Bucket ] ` # + # [ sub-resource, if present. e.g. "?acl", "?location", # "?logging", or "?torrent"]; # # @api private def canonicalized_resource(endpoint) parts = [] # virtual hosted-style requests require the hostname to appear # in the canonicalized resource prefixed by a forward slash. if bucket = params[:bucket] bucket = bucket.value ssl = endpoint.scheme == 'https' if Plugins::BucketDns.dns_compatible?(bucket, ssl) && !@force_path_style parts << "/#{bucket}" end end # append the path name (no querystring) parts << endpoint.path # lastly any sub resource querystring params need to be appened # in lexigraphical ordered joined by '&' and prefixed by '?' params = signed_querystring_params(endpoint) unless params.empty? parts << '?' parts << params.sort.collect{|p| p.to_s }.join('&') end parts.join end def signed_querystring_params(endpoint) endpoint.query.to_s.split('&').select do |p| SIGNED_QUERYSTRING_PARAMS.include?(p.split('=')[0]) end.map { |p| CGI.unescape(p) } end def uri_escape(s) #URI.escape(s) # URI.escape is deprecated, replacing it with escape from webrick # to squelch the massive number of warnings generated from Ruby. # The following script was used to determine the differences # between the various escape methods available. The webrick # escape only had two differences and it is available in the # standard lib. # # (0..255).each {|c| # s = [c].pack("C") # e = [ # CGI.escape(s), # ERB::Util.url_encode(s), # URI.encode_www_form_component(s), # WEBrick::HTTPUtils.escape_form(s), # WEBrick::HTTPUtils.escape(s), # URI.escape(s), # ] # next if e.uniq.length == 1 # puts("%5s %5s %5s %5s %5s %5s %5s" % ([s.inspect] + e)) # } # WEBrick::HTTPUtils.escape(s).gsub('%5B', '[').gsub('%5D', ']') end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_acl.rb0000644000004100000410000001777013536452011020627 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketAcl extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Types::Owner] def owner data[:owner] end # A list of grants. # @return [Array] def grants data[:grants] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketAcl}. # Returns `self` making it possible to chain methods. # # bucket_acl.reload.data # # @return [self] def load resp = @client.get_bucket_acl(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketAclOutput] # Returns the data for this {BucketAcl}. Calls # {Client#get_bucket_acl} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_acl.put({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # access_control_policy: { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # }, # content_md5: "ContentMD5", # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the bucket. # @option options [Types::AccessControlPolicy] :access_control_policy # Contains the elements that set the ACL permissions for an object per # grantee. # @option options [String] :content_md5 # @option options [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # @option options [String] :grant_read # Allows grantee to list the objects in the bucket. # @option options [String] :grant_read_acp # Allows grantee to read the bucket ACL. # @option options [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_acl(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/event_streams.rb0000644000004100000410000000270413536452011021401 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 module EventStreams class SelectObjectContentEventStream def initialize @event_emitter = Aws::EventEmitter.new end def on_records_event(&block) @event_emitter.on(:records, block) if block_given? end def on_stats_event(&block) @event_emitter.on(:stats, block) if block_given? end def on_progress_event(&block) @event_emitter.on(:progress, block) if block_given? end def on_cont_event(&block) @event_emitter.on(:cont, block) if block_given? end def on_end_event(&block) @event_emitter.on(:end, block) if block_given? end def on_error_event(&block) @event_emitter.on(:error, block) if block_given? end def on_initial_response_event(&block) @event_emitter.on(:initial_response, block) if block_given? end def on_event(&block) on_records_event(&block) on_stats_event(&block) on_progress_event(&block) on_cont_event(&block) on_end_event(&block) on_error_event(&block) on_initial_response_event(&block) end # @api private # @return Aws::EventEmitter attr_reader :event_emitter end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/object_version.rb0000644000004100000410000004422113536452011021535 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class ObjectVersion extend Aws::Deprecations # @overload def initialize(bucket_name, object_key, id, options = {}) # @param [String] bucket_name # @param [String] object_key # @param [String] id # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [required, String] :object_key # @option options [required, String] :id # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @object_key = extract_object_key(args, options) @id = extract_id(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [String] def object_key @object_key end # @return [String] def id @id end # @return [String] def etag data[:etag] end # Size in bytes of the object. # @return [Integer] def size data[:size] end # The class of storage used to store the object. # @return [String] def storage_class data[:storage_class] end # The object key. # @return [String] def key data[:key] end # Version ID of an object. # @return [String] def version_id data[:version_id] end # Specifies whether the object is (true) or is not (false) the latest # version of an object. # @return [Boolean] def is_latest data[:is_latest] end # Date and time the object was last modified. # @return [Time] def last_modified data[:last_modified] end # @return [Types::Owner] def owner data[:owner] end # @!endgroup # @return [Client] def client @client end # @raise [NotImplementedError] # @api private def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end alias :reload :load # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`. # @return [Types::ObjectVersion] # Returns the data for this {ObjectVersion}. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # object_version.delete({ # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param [Hash] options ({}) # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Indicates whether Amazon S3 object lock should bypass governance-mode # restrictions to process this operation. # @return [Types::DeleteObjectOutput] def delete(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, version_id: @id ) resp = @client.delete_object(options) resp.data end # @example Request syntax with placeholder values # # object_version.get({ # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # range: "Range", # response_cache_control: "ResponseCacheControl", # response_content_disposition: "ResponseContentDisposition", # response_content_encoding: "ResponseContentEncoding", # response_content_language: "ResponseContentLanguage", # response_content_type: "ResponseContentType", # response_expires: Time.now, # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # }) # @param [Hash] options ({}) # @option options [String] :if_match # Return the object only if its entity tag (ETag) is the same as the one # specified, otherwise return a 412 (precondition failed). # @option options [Time,DateTime,Date,Integer,String] :if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # @option options [String] :if_none_match # Return the object only if its entity tag (ETag) is different from the # one specified, otherwise return a 304 (not modified). # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since # Return the object only if it has not been modified since the specified # time, otherwise return a 412 (precondition failed). # @option options [String] :range # Downloads the specified range bytes of an object. For more information # about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # @option options [String] :response_cache_control # Sets the Cache-Control header of the response. # @option options [String] :response_content_disposition # Sets the Content-Disposition header of the response # @option options [String] :response_content_encoding # Sets the Content-Encoding header of the response. # @option options [String] :response_content_language # Sets the Content-Language header of the response. # @option options [String] :response_content_type # Sets the Content-Type header of the response. # @option options [Time,DateTime,Date,Integer,String] :response_expires # Sets the Expires header of the response. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Integer] :part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' GET request # for the part specified. Useful for downloading just a part of an # object. # @return [Types::GetObjectOutput] def get(options = {}, &block) options = options.merge( bucket: @bucket_name, key: @object_key, version_id: @id ) resp = @client.get_object(options, &block) resp.data end # @example Request syntax with placeholder values # # object_version.head({ # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # range: "Range", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # }) # @param [Hash] options ({}) # @option options [String] :if_match # Return the object only if its entity tag (ETag) is the same as the one # specified, otherwise return a 412 (precondition failed). # @option options [Time,DateTime,Date,Integer,String] :if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # @option options [String] :if_none_match # Return the object only if its entity tag (ETag) is different from the # one specified, otherwise return a 304 (not modified). # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since # Return the object only if it has not been modified since the specified # time, otherwise return a 412 (precondition failed). # @option options [String] :range # Downloads the specified range bytes of an object. For more information # about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Integer] :part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' HEAD request # for the part specified. Useful querying about the size of the part and # the number of parts in this object. # @return [Types::HeadObjectOutput] def head(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, version_id: @id ) resp = @client.head_object(options) resp.data end # @!group Associations # @return [Object] def object Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name, object_key: @object_key, id: @id } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_object_key(args, options) value = args[1] || options.delete(:object_key) case value when String then value when nil then raise ArgumentError, "missing required option :object_key" else msg = "expected :object_key to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_id(args, options) value = args[2] || options.delete(:id) case value when String then value when nil then raise ArgumentError, "missing required option :id" else msg = "expected :id to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection # @!group Batch Actions # @example Request syntax with placeholder values # # object_version.batch_delete!({ # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param options ({}) # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Specifies whether you want to delete this object even if it has a # Governance-type object lock in place. You must have sufficient # permissions to perform this operation. # @return [void] def batch_delete!(options = {}) batch_enum.each do |batch| params = Aws::Util.copy_hash(options) params[:bucket] = batch[0].bucket_name params[:delete] ||= {} params[:delete][:objects] ||= [] batch.each do |item| params[:delete][:objects] << { key: item.object_key, version_id: item.id } end batch[0].client.delete_objects(params) end nil end # @!endgroup end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/multipart_stream_uploader.rb0000644000004100000410000001143213536452011024007 0ustar www-datawww-datarequire 'thread' require 'set' require 'tempfile' require 'stringio' module Aws module S3 # @api private class MultipartStreamUploader # api private PART_SIZE = 5 * 1024 * 1024 # 5MB # api private THREAD_COUNT = 10 # api private TEMPFILE_PREIX = 'aws-sdk-s3-upload_stream'.freeze # @api private CREATE_OPTIONS = Set.new(Client.api.operation(:create_multipart_upload).input.shape.member_names) # @api private UPLOAD_PART_OPTIONS = Set.new(Client.api.operation(:upload_part).input.shape.member_names) # @option options [Client] :client def initialize(options = {}) @client = options[:client] || Client.new @tempfile = options[:tempfile] @part_size = options[:part_size] || PART_SIZE @thread_count = options[:thread_count] || THREAD_COUNT end # @return [Client] attr_reader :client # @option options [required,String] :bucket # @option options [required,String] :key # @return [void] def upload(options = {}, &block) upload_id = initiate_upload(options) parts = upload_parts(upload_id, options, &block) complete_upload(upload_id, parts, options) end private def initiate_upload(options) @client.create_multipart_upload(create_opts(options)).upload_id end def complete_upload(upload_id, parts, options) @client.complete_multipart_upload( bucket: options[:bucket], key: options[:key], upload_id: upload_id, multipart_upload: { parts: parts }) end def upload_parts(upload_id, options, &block) completed = Queue.new errors = IO.pipe do |read_pipe, write_pipe| threads = upload_in_threads(read_pipe, completed, upload_part_opts(options).merge(upload_id: upload_id)) block.call(write_pipe) write_pipe.close threads.map(&:value).compact end if errors.empty? Array.new(completed.size) { completed.pop }.sort_by { |part| part[:part_number] } else abort_upload(upload_id, options, errors) end end def abort_upload(upload_id, options, errors) @client.abort_multipart_upload( bucket: options[:bucket], key: options[:key], upload_id: upload_id ) msg = "multipart upload failed: #{errors.map(&:message).join("; ")}" raise MultipartUploadError.new(msg, errors) rescue MultipartUploadError => error raise error rescue => error msg = "failed to abort multipart upload: #{error.message}" raise MultipartUploadError.new(msg, errors + [error]) end def create_opts(options) CREATE_OPTIONS.inject({}) do |hash, key| hash[key] = options[key] if options.key?(key) hash end end def upload_part_opts(options) UPLOAD_PART_OPTIONS.inject({}) do |hash, key| hash[key] = options[key] if options.key?(key) hash end end def read_to_part_body(read_pipe) return if read_pipe.closed? temp_io = @tempfile ? Tempfile.new(TEMPFILE_PREIX) : StringIO.new temp_io.binmode bytes_copied = IO.copy_stream(read_pipe, temp_io, @part_size) temp_io.rewind if bytes_copied == 0 if Tempfile === temp_io temp_io.close temp_io.unlink end nil else temp_io end end def upload_in_threads(read_pipe, completed, options) mutex = Mutex.new part_number = 0 @thread_count.times.map do thread = Thread.new do begin loop do body, thread_part_number = mutex.synchronize do [read_to_part_body(read_pipe), part_number += 1] end break unless (body || thread_part_number == 1) begin part = options.merge( body: body, part_number: thread_part_number, ) resp = @client.upload_part(part) completed << {etag: resp.etag, part_number: part[:part_number]} ensure if Tempfile === body body.close body.unlink elsif StringIO === body body.string.clear end end end nil rescue => error # keep other threads from uploading other parts mutex.synchronize { read_pipe.close_read } error end end thread.abort_on_exception = true thread end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/multipart_upload_error.rb0000644000004100000410000000051413536452011023315 0ustar www-datawww-datamodule Aws module S3 class MultipartUploadError < StandardError def initialize(message, errors) @errors = errors super(message) end # @return [Array] The list of errors encountered # when uploading or aborting the upload. attr_reader :errors end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/object_multipart_copier.rb0000644000004100000410000001200013536452011023420 0ustar www-datawww-datarequire 'thread' require 'cgi' module Aws module S3 # @api private class ObjectMultipartCopier FIVE_MB = 5 * 1024 * 1024 # 5MB FILE_TOO_SMALL = "unable to multipart copy files smaller than 5MB" MAX_PARTS = 10_000 # @option options [Client] :client # @option [Integer] :min_part_size (52428800) Size of copied parts. # Defaults to 50MB. # will be constructed from the given `options' hash. # @option [Integer] :thread_count (10) Number of concurrent threads to # use for copying parts. def initialize(options = {}) @thread_count = options.delete(:thread_count) || 10 @min_part_size = options.delete(:min_part_size) || (FIVE_MB * 10) @client = options[:client] || Client.new end # @return [Client] attr_reader :client # @option (see S3::Client#copy_object) def copy(options = {}) size = source_size(options) options[:upload_id] = initiate_upload(options) begin parts = copy_parts(size, default_part_size(size), options) complete_upload(parts, options) rescue => error abort_upload(options) raise error end end private def initiate_upload(options) options = options_for(:create_multipart_upload, options) @client.create_multipart_upload(options).upload_id end def copy_parts(size, default_part_size, options) queue = PartQueue.new(compute_parts(size, default_part_size, options)) threads = [] @thread_count.times do threads << copy_part_thread(queue) end threads.map(&:value).flatten.sort_by{ |part| part[:part_number] } end def copy_part_thread(queue) Thread.new do begin completed = [] while part = queue.shift completed << copy_part(part) end completed rescue => error queue.clear! raise error end end end def copy_part(part) { etag: @client.upload_part_copy(part).copy_part_result.etag, part_number: part[:part_number], } end def complete_upload(parts, options) options = options_for(:complete_multipart_upload, options) options[:multipart_upload] = { parts: parts } @client.complete_multipart_upload(options) end def abort_upload(options) @client.abort_multipart_upload({ bucket: options[:bucket], key: options[:key], upload_id: options[:upload_id], }) end def compute_parts(size, default_part_size, options) part_number = 1 offset = 0 parts = [] options = options_for(:upload_part_copy, options) while offset < size parts << options.merge({ part_number: part_number, copy_source_range: byte_range(offset, default_part_size, size), }) part_number += 1 offset += default_part_size end parts end def byte_range(offset, default_part_size, size) if offset + default_part_size < size "bytes=#{offset}-#{offset + default_part_size - 1}" else "bytes=#{offset}-#{size - 1}" end end def source_size(options) return options.delete(:content_length) if options[:content_length] client = options[:copy_source_client] || @client if vid_match = options[:copy_source].match(/([^\/]+?)\/(.+)\?versionId=(.+)/) bucket, key, version_id = vid_match[1,3] else bucket, key = options[:copy_source].match(/([^\/]+?)\/(.+)/)[1,2] end key = CGI.unescape(key) opts = { bucket: bucket, key: key } opts[:version_id] = version_id if version_id client.head_object(opts).content_length end def default_part_size(source_size) if source_size < FIVE_MB raise ArgumentError, FILE_TOO_SMALL else [(source_size.to_f / MAX_PARTS).ceil, @min_part_size].max.to_i end end def options_for(operation_name, options) API_OPTIONS[operation_name].inject({}) do |hash, opt_name| hash[opt_name] = options[opt_name] if options.key?(opt_name) hash end end # @api private def self.options_for(shape_name) Client.api.metadata['shapes'][shape_name].member_names end API_OPTIONS = { create_multipart_upload: Types::CreateMultipartUploadRequest.members, upload_part_copy: Types::UploadPartCopyRequest.members, complete_multipart_upload: Types::CompleteMultipartUploadRequest.members, } class PartQueue def initialize(parts = []) @parts = parts @mutex = Mutex.new end def shift @mutex.synchronize { @parts.shift } end def clear! @mutex.synchronize { @parts.clear } end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/errors.rb0000644000004100000410000000044113536452011020032 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 module Errors extend Aws::Errors::DynamicErrors end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/client.rb0000644000004100000410000112030713536452011020001 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'seahorse/client/plugins/content_length.rb' require 'aws-sdk-core/plugins/credentials_configuration.rb' require 'aws-sdk-core/plugins/logging.rb' require 'aws-sdk-core/plugins/param_converter.rb' require 'aws-sdk-core/plugins/param_validator.rb' require 'aws-sdk-core/plugins/user_agent.rb' require 'aws-sdk-core/plugins/helpful_socket_errors.rb' require 'aws-sdk-core/plugins/retry_errors.rb' require 'aws-sdk-core/plugins/global_configuration.rb' require 'aws-sdk-core/plugins/regional_endpoint.rb' require 'aws-sdk-core/plugins/endpoint_discovery.rb' require 'aws-sdk-core/plugins/endpoint_pattern.rb' require 'aws-sdk-core/plugins/response_paging.rb' require 'aws-sdk-core/plugins/stub_responses.rb' require 'aws-sdk-core/plugins/idempotency_token.rb' require 'aws-sdk-core/plugins/jsonvalue_converter.rb' require 'aws-sdk-core/plugins/client_metrics_plugin.rb' require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb' require 'aws-sdk-core/plugins/transfer_encoding.rb' require 'aws-sdk-core/plugins/protocols/rest_xml.rb' require 'aws-sdk-s3/plugins/accelerate.rb' require 'aws-sdk-s3/plugins/dualstack.rb' require 'aws-sdk-s3/plugins/bucket_dns.rb' require 'aws-sdk-s3/plugins/expect_100_continue.rb' require 'aws-sdk-s3/plugins/http_200_errors.rb' require 'aws-sdk-s3/plugins/s3_host_id.rb' require 'aws-sdk-s3/plugins/get_bucket_location_fix.rb' require 'aws-sdk-s3/plugins/location_constraint.rb' require 'aws-sdk-s3/plugins/md5s.rb' require 'aws-sdk-s3/plugins/redirects.rb' require 'aws-sdk-s3/plugins/sse_cpk.rb' require 'aws-sdk-s3/plugins/url_encoded_keys.rb' require 'aws-sdk-s3/plugins/s3_signer.rb' require 'aws-sdk-s3/plugins/bucket_name_restrictions.rb' require 'aws-sdk-core/plugins/event_stream_configuration.rb' Aws::Plugins::GlobalConfiguration.add_identifier(:s3) module Aws::S3 class Client < Seahorse::Client::Base include Aws::ClientStubs @identifier = :s3 set_api(ClientApi::API) add_plugin(Seahorse::Client::Plugins::ContentLength) add_plugin(Aws::Plugins::CredentialsConfiguration) add_plugin(Aws::Plugins::Logging) add_plugin(Aws::Plugins::ParamConverter) add_plugin(Aws::Plugins::ParamValidator) add_plugin(Aws::Plugins::UserAgent) add_plugin(Aws::Plugins::HelpfulSocketErrors) add_plugin(Aws::Plugins::RetryErrors) add_plugin(Aws::Plugins::GlobalConfiguration) add_plugin(Aws::Plugins::RegionalEndpoint) add_plugin(Aws::Plugins::EndpointDiscovery) add_plugin(Aws::Plugins::EndpointPattern) add_plugin(Aws::Plugins::ResponsePaging) add_plugin(Aws::Plugins::StubResponses) add_plugin(Aws::Plugins::IdempotencyToken) add_plugin(Aws::Plugins::JsonvalueConverter) add_plugin(Aws::Plugins::ClientMetricsPlugin) add_plugin(Aws::Plugins::ClientMetricsSendPlugin) add_plugin(Aws::Plugins::TransferEncoding) add_plugin(Aws::Plugins::Protocols::RestXml) add_plugin(Aws::S3::Plugins::Accelerate) add_plugin(Aws::S3::Plugins::Dualstack) add_plugin(Aws::S3::Plugins::BucketDns) add_plugin(Aws::S3::Plugins::Expect100Continue) add_plugin(Aws::S3::Plugins::Http200Errors) add_plugin(Aws::S3::Plugins::S3HostId) add_plugin(Aws::S3::Plugins::GetBucketLocationFix) add_plugin(Aws::S3::Plugins::LocationConstraint) add_plugin(Aws::S3::Plugins::Md5s) add_plugin(Aws::S3::Plugins::Redirects) add_plugin(Aws::S3::Plugins::SseCpk) add_plugin(Aws::S3::Plugins::UrlEncodedKeys) add_plugin(Aws::S3::Plugins::S3Signer) add_plugin(Aws::S3::Plugins::BucketNameRestrictions) add_plugin(Aws::Plugins::EventStreamConfiguration) # @overload initialize(options) # @param [Hash] options # @option options [required, Aws::CredentialProvider] :credentials # Your AWS credentials. This can be an instance of any one of the # following classes: # # * `Aws::Credentials` - Used for configuring static, non-refreshing # credentials. # # * `Aws::InstanceProfileCredentials` - Used for loading credentials # from an EC2 IMDS on an EC2 instance. # # * `Aws::SharedCredentials` - Used for loading credentials from a # shared file, such as `~/.aws/config`. # # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role. # # When `:credentials` are not configured directly, the following # locations will be searched for credentials: # # * `Aws.config[:credentials]` # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options. # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'] # * `~/.aws/credentials` # * `~/.aws/config` # * EC2 IMDS instance profile - When used by default, the timeouts are # very aggressive. Construct and pass an instance of # `Aws::InstanceProfileCredentails` to enable retries and extended # timeouts. # # @option options [required, String] :region # The AWS region to connect to. The configured `:region` is # used to determine the service `:endpoint`. When not passed, # a default `:region` is search for in the following locations: # # * `Aws.config[:region]` # * `ENV['AWS_REGION']` # * `ENV['AMAZON_REGION']` # * `ENV['AWS_DEFAULT_REGION']` # * `~/.aws/credentials` # * `~/.aws/config` # # @option options [String] :access_key_id # # @option options [Boolean] :active_endpoint_cache (false) # When set to `true`, a thread polling for endpoints will be running in # the background every 60 secs (default). Defaults to `false`. # # @option options [Boolean] :client_side_monitoring (false) # When `true`, client-side metrics will be collected for all API requests from # this client. # # @option options [String] :client_side_monitoring_client_id ("") # Allows you to provide an identifier for this client which will be attached to # all generated client side metrics. Defaults to an empty string. # # @option options [String] :client_side_monitoring_host ("127.0.0.1") # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client # side monitoring agent is running on, where client metrics will be published via UDP. # # @option options [Integer] :client_side_monitoring_port (31000) # Required for publishing client metrics. The port that the client side monitoring # agent is running on, where client metrics will be published via UDP. # # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) # Allows you to provide a custom client-side monitoring publisher class. By default, # will use the Client Side Monitoring Agent Publisher. # # @option options [Boolean] :compute_checksums (true) # When `true` a MD5 checksum will be computed for every request that # sends a body. When `false`, MD5 checksums will only be computed # for operations that require them. Checksum errors returned by Amazon # S3 are automatically retried up to `:retry_limit` times. # # @option options [Boolean] :convert_params (true) # When `true`, an attempt is made to coerce request parameters into # the required types. # # @option options [Boolean] :disable_host_prefix_injection (false) # Set to true to disable SDK automatically adding host prefix # to default service endpoint when available. # # @option options [String] :endpoint # The client endpoint is normally constructed from the `:region` # option. You should only configure an `:endpoint` when connecting # to test endpoints. This should be avalid HTTP(S) URI. # # @option options [Integer] :endpoint_cache_max_entries (1000) # Used for the maximum size limit of the LRU cache storing endpoints data # for endpoint discovery enabled operations. Defaults to 1000. # # @option options [Integer] :endpoint_cache_max_threads (10) # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. # # @option options [Integer] :endpoint_cache_poll_interval (60) # When :endpoint_discovery and :active_endpoint_cache is enabled, # Use this option to config the time interval in seconds for making # requests fetching endpoints information. Defaults to 60 sec. # # @option options [Boolean] :endpoint_discovery (false) # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`. # # @option options [Proc] :event_stream_handler # When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way. # # @option options [Boolean] :follow_redirects (true) # When `true`, this client will follow 307 redirects returned # by Amazon S3. # # @option options [Boolean] :force_path_style (false) # When set to `true`, the bucket name is always left in the # request URI and never moved to the host as a sub-domain. # # @option options [Proc] :input_event_stream_handler # When an EventStream or Proc object is provided, it can be used for sending events for the event stream. # # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default) # The log formatter. # # @option options [Symbol] :log_level (:info) # The log level to send messages to the `:logger` at. # # @option options [Logger] :logger # The Logger instance to send log messages to. If this option # is not set, logging will be disabled. # # @option options [Proc] :output_event_stream_handler # When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way. # # @option options [String] :profile ("default") # Used when loading credentials from the shared credentials file # at HOME/.aws/credentials. When not specified, 'default' is used. # # @option options [Boolean] :require_https_for_sse_cpk (true) # When `true`, the endpoint **must** be HTTPS for all operations # where server-side-encryption is used with customer-provided keys. # This should only be disabled for local testing. # # @option options [Float] :retry_base_delay (0.3) # The base delay in seconds used by the default backoff function. # # @option options [Symbol] :retry_jitter (:none) # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. # # @see https://www.awsarchitectureblog.com/2015/03/backoff.html # # @option options [Integer] :retry_limit (3) # The maximum number of times to retry failed requests. Only # ~ 500 level server errors and certain ~ 400 level client errors # are retried. Generally, these are throttling errors, data # checksum errors, networking errors, timeout errors and auth # errors from expired credentials. # # @option options [Integer] :retry_max_delay (0) # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. # # @option options [String] :secret_access_key # # @option options [String] :session_token # # @option options [Boolean] :stub_responses (false) # Causes the client to return stubbed responses. By default # fake responses are generated and returned. You can specify # the response data to return or errors to raise by calling # {ClientStubs#stub_responses}. See {ClientStubs} for more information. # # ** Please note ** When response stubbing is enabled, no HTTP # requests are made, and retries are disabled. # # @option options [Boolean] :use_accelerate_endpoint (false) # When set to `true`, accelerated bucket endpoints will be used # for all object operations. You must first enable accelerate for # each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html). # # @option options [Boolean] :use_dualstack_endpoint (false) # When set to `true`, IPv6-compatible bucket endpoints will be used # for all operations. # # @option options [Boolean] :validate_params (true) # When `true`, request parameters are validated before # sending the request. # # @option options [URI::HTTP,String] :http_proxy A proxy to send # requests through. Formatted like 'http://proxy.com:123'. # # @option options [Float] :http_open_timeout (15) The number of # seconds to wait when opening a HTTP session before rasing a # `Timeout::Error`. # # @option options [Integer] :http_read_timeout (60) The default # number of seconds to wait for response data. This value can # safely be set # per-request on the session yeidled by {#session_for}. # # @option options [Float] :http_idle_timeout (5) The number of # seconds a connection is allowed to sit idble before it is # considered stale. Stale connections are closed and removed # from the pool before making a request. # # @option options [Float] :http_continue_timeout (1) The number of # seconds to wait for a 100-continue response before sending the # request body. This option has no effect unless the request has # "Expect" header set to "100-continue". Defaults to `nil` which # disables this behaviour. This value can safely be set per # request on the session yeidled by {#session_for}. # # @option options [Boolean] :http_wire_trace (false) When `true`, # HTTP debug output will be sent to the `:logger`. # # @option options [Boolean] :ssl_verify_peer (true) When `true`, # SSL peer certificates are verified when establishing a # connection. # # @option options [String] :ssl_ca_bundle Full path to the SSL # certificate authority bundle file that should be used when # verifying peer certificates. If you do not pass # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default # will be used if available. # # @option options [String] :ssl_ca_directory Full path of the # directory that contains the unbundled SSL certificate # authority files for verifying peer certificates. If you do # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the # system default will be used if available. # def initialize(*args) super end # @!group API Operations # Aborts a multipart upload. # # To verify that all parts have been removed, so you don't get charged # for the part storage, you should call the List Parts operation and # ensure the parts list is empty. # # @option params [required, String] :bucket # Name of the bucket to which the multipart upload was initiated. # # @option params [required, String] :key # Key of the object for which the multipart upload was initiated. # # @option params [required, String] :upload_id # Upload ID that identifies the multipart upload. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::AbortMultipartUploadOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::AbortMultipartUploadOutput#request_charged #request_charged} => String # # # @example Example: To abort a multipart upload # # # The following example aborts a multipart upload. # # resp = client.abort_multipart_upload({ # bucket: "examplebucket", # key: "bigobject", # upload_id: "xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--", # }) # # resp.to_h outputs the following: # { # } # # @example Request syntax with placeholder values # # resp = client.abort_multipart_upload({ # bucket: "BucketName", # required # key: "ObjectKey", # required # upload_id: "MultipartUploadId", # required # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload AWS API Documentation # # @overload abort_multipart_upload(params = {}) # @param [Hash] params ({}) def abort_multipart_upload(params = {}, options = {}) req = build_request(:abort_multipart_upload, params) req.send_request(options) end # Completes a multipart upload by assembling previously uploaded parts. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [Types::CompletedMultipartUpload] :multipart_upload # # @option params [required, String] :upload_id # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::CompleteMultipartUploadOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::CompleteMultipartUploadOutput#location #location} => String # * {Types::CompleteMultipartUploadOutput#bucket #bucket} => String # * {Types::CompleteMultipartUploadOutput#key #key} => String # * {Types::CompleteMultipartUploadOutput#expiration #expiration} => String # * {Types::CompleteMultipartUploadOutput#etag #etag} => String # * {Types::CompleteMultipartUploadOutput#server_side_encryption #server_side_encryption} => String # * {Types::CompleteMultipartUploadOutput#version_id #version_id} => String # * {Types::CompleteMultipartUploadOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::CompleteMultipartUploadOutput#request_charged #request_charged} => String # # # @example Example: To complete multipart upload # # # The following example completes a multipart upload. # # resp = client.complete_multipart_upload({ # bucket: "examplebucket", # key: "bigobject", # multipart_upload: { # parts: [ # { # etag: "\"d8c2eafd90c266e19ab9dcacc479f8af\"", # part_number: 1, # }, # { # etag: "\"d8c2eafd90c266e19ab9dcacc479f8af\"", # part_number: 2, # }, # ], # }, # upload_id: "7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--", # }) # # resp.to_h outputs the following: # { # bucket: "acexamplebucket", # etag: "\"4d9031c7644d8081c2829f4ea23c55f7-2\"", # key: "bigobject", # location: "https://examplebucket.s3.amazonaws.com/bigobject", # } # # @example Request syntax with placeholder values # # resp = client.complete_multipart_upload({ # bucket: "BucketName", # required # key: "ObjectKey", # required # multipart_upload: { # parts: [ # { # etag: "ETag", # part_number: 1, # }, # ], # }, # upload_id: "MultipartUploadId", # required # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.location #=> String # resp.bucket #=> String # resp.key #=> String # resp.expiration #=> String # resp.etag #=> String # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.version_id #=> String # resp.ssekms_key_id #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload AWS API Documentation # # @overload complete_multipart_upload(params = {}) # @param [Hash] params ({}) def complete_multipart_upload(params = {}, options = {}) req = build_request(:complete_multipart_upload, params) req.send_request(options) end # Creates a copy of an object that is already stored in Amazon S3. # # @option params [String] :acl # The canned ACL to apply to the object. # # @option params [required, String] :bucket # # @option params [String] :cache_control # Specifies caching behavior along the request/reply chain. # # @option params [String] :content_disposition # Specifies presentational information for the object. # # @option params [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # # @option params [String] :content_language # The language the content is in. # # @option params [String] :content_type # A standard MIME type describing the format of the object data. # # @option params [required, String] :copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # # @option params [String] :copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified tag. # # @option params [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # # @option params [String] :copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # # @option params [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # # @option params [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # # @option params [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # # @option params [String] :grant_read # Allows grantee to read the object data and its metadata. # # @option params [String] :grant_read_acp # Allows grantee to read the object ACL. # # @option params [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # # @option params [required, String] :key # # @option params [Hash] :metadata # A map of metadata to store with the object in S3. # # @option params [String] :metadata_directive # Specifies whether the metadata is copied from the source object or # replaced with metadata provided in the request. # # @option params [String] :tagging_directive # Specifies whether the object tag-set are copied from the source object # or replaced with tag-set provided in the request. # # @option params [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # # @option params [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # # @option params [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # # @option params [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # # @option params [String] :copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # # @option params [String] :copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use to # decrypt the source object. The encryption key provided in this header # must be one that was used when the source object was created. # # @option params [String] :copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :tagging # The tag-set for the object destination object this value must be used # in conjunction with the TaggingDirective. The tag-set must be encoded # as URL Query parameters # # @option params [String] :object_lock_mode # The object lock mode that you want to apply to the copied object. # # @option params [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want the copied object's object lock to # expire. # # @option params [String] :object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the copied object. # # @return [Types::CopyObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::CopyObjectOutput#copy_object_result #copy_object_result} => Types::CopyObjectResult # * {Types::CopyObjectOutput#expiration #expiration} => String # * {Types::CopyObjectOutput#copy_source_version_id #copy_source_version_id} => String # * {Types::CopyObjectOutput#version_id #version_id} => String # * {Types::CopyObjectOutput#server_side_encryption #server_side_encryption} => String # * {Types::CopyObjectOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::CopyObjectOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::CopyObjectOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::CopyObjectOutput#ssekms_encryption_context #ssekms_encryption_context} => String # * {Types::CopyObjectOutput#request_charged #request_charged} => String # # # @example Example: To copy an object # # # The following example copies an object from one bucket to another. # # resp = client.copy_object({ # bucket: "destinationbucket", # copy_source: "/sourcebucket/HappyFacejpg", # key: "HappyFaceCopyjpg", # }) # # resp.to_h outputs the following: # { # copy_object_result: { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # last_modified: Time.parse("2016-12-15T17:38:53.000Z"), # }, # } # # @example Request syntax with placeholder values # # resp = client.copy_object({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # bucket: "BucketName", # required # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # metadata_directive: "COPY", # accepts COPY, REPLACE # tagging_directive: "COPY", # accepts COPY, REPLACE # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # # @example Response structure # # resp.copy_object_result.etag #=> String # resp.copy_object_result.last_modified #=> Time # resp.expiration #=> String # resp.copy_source_version_id #=> String # resp.version_id #=> String # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.ssekms_encryption_context #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject AWS API Documentation # # @overload copy_object(params = {}) # @param [Hash] params ({}) def copy_object(params = {}, options = {}) req = build_request(:copy_object, params) req.send_request(options) end # Creates a new bucket. # # @option params [String] :acl # The canned ACL to apply to the bucket. # # @option params [required, String] :bucket # # @option params [Types::CreateBucketConfiguration] :create_bucket_configuration # # @option params [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # # @option params [String] :grant_read # Allows grantee to list the objects in the bucket. # # @option params [String] :grant_read_acp # Allows grantee to read the bucket ACL. # # @option params [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # # @option params [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # # @option params [Boolean] :object_lock_enabled_for_bucket # Specifies whether you want Amazon S3 object lock to be enabled for the # new bucket. # # @return [Types::CreateBucketOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::CreateBucketOutput#location #location} => String # # # @example Example: To create a bucket in a specific region # # # The following example creates a bucket. The request specifies an AWS region where to create the bucket. # # resp = client.create_bucket({ # bucket: "examplebucket", # create_bucket_configuration: { # location_constraint: "eu-west-1", # }, # }) # # resp.to_h outputs the following: # { # location: "http://examplebucket.s3.amazonaws.com/", # } # # @example Example: To create a bucket # # # The following example creates a bucket. # # resp = client.create_bucket({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # location: "/examplebucket", # } # # @example Request syntax with placeholder values # # resp = client.create_bucket({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # bucket: "BucketName", # required # create_bucket_configuration: { # location_constraint: "EU", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 # }, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # object_lock_enabled_for_bucket: false, # }) # # @example Response structure # # resp.location #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket AWS API Documentation # # @overload create_bucket(params = {}) # @param [Hash] params ({}) def create_bucket(params = {}, options = {}) req = build_request(:create_bucket, params) req.send_request(options) end # Initiates a multipart upload and returns an upload ID. # # **Note:** After you initiate multipart upload and upload one or more # parts, you must either complete or abort multipart upload in order to # stop getting charged for storage of the uploaded parts. Only after you # either complete or abort multipart upload, Amazon S3 frees up the # parts storage and stops charging you for the parts storage. # # @option params [String] :acl # The canned ACL to apply to the object. # # @option params [required, String] :bucket # # @option params [String] :cache_control # Specifies caching behavior along the request/reply chain. # # @option params [String] :content_disposition # Specifies presentational information for the object. # # @option params [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # # @option params [String] :content_language # The language the content is in. # # @option params [String] :content_type # A standard MIME type describing the format of the object data. # # @option params [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # # @option params [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # # @option params [String] :grant_read # Allows grantee to read the object data and its metadata. # # @option params [String] :grant_read_acp # Allows grantee to read the object ACL. # # @option params [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # # @option params [required, String] :key # # @option params [Hash] :metadata # A map of metadata to store with the object in S3. # # @option params [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # # @option params [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # # @option params [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # # @option params [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters # # @option params [String] :object_lock_mode # Specifies the object lock mode that you want to apply to the uploaded # object. # # @option params [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # Specifies the date and time when you want the object lock to expire. # # @option params [String] :object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the uploaded # object. # # @return [Types::CreateMultipartUploadOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::CreateMultipartUploadOutput#abort_date #abort_date} => Time # * {Types::CreateMultipartUploadOutput#abort_rule_id #abort_rule_id} => String # * {Types::CreateMultipartUploadOutput#bucket #bucket} => String # * {Types::CreateMultipartUploadOutput#key #key} => String # * {Types::CreateMultipartUploadOutput#upload_id #upload_id} => String # * {Types::CreateMultipartUploadOutput#server_side_encryption #server_side_encryption} => String # * {Types::CreateMultipartUploadOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::CreateMultipartUploadOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::CreateMultipartUploadOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::CreateMultipartUploadOutput#ssekms_encryption_context #ssekms_encryption_context} => String # * {Types::CreateMultipartUploadOutput#request_charged #request_charged} => String # # # @example Example: To initiate a multipart upload # # # The following example initiates a multipart upload. # # resp = client.create_multipart_upload({ # bucket: "examplebucket", # key: "largeobject", # }) # # resp.to_h outputs the following: # { # bucket: "examplebucket", # key: "largeobject", # upload_id: "ibZBv_75gd9r8lH_gqXatLdxMVpAlj6ZQjEs.OwyF3953YdwbcQnMA2BLGn8Lx12fQNICtMw5KyteFeHw.Sjng--", # } # # @example Request syntax with placeholder values # # resp = client.create_multipart_upload({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # bucket: "BucketName", # required # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # # @example Response structure # # resp.abort_date #=> Time # resp.abort_rule_id #=> String # resp.bucket #=> String # resp.key #=> String # resp.upload_id #=> String # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.ssekms_encryption_context #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload AWS API Documentation # # @overload create_multipart_upload(params = {}) # @param [Hash] params ({}) def create_multipart_upload(params = {}, options = {}) req = build_request(:create_multipart_upload, params) req.send_request(options) end # Deletes the bucket. All objects (including all object versions and # Delete Markers) in the bucket must be deleted before the bucket itself # can be deleted. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete a bucket # # # The following example deletes the specified bucket. # # resp = client.delete_bucket({ # bucket: "forrandall2", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket AWS API Documentation # # @overload delete_bucket(params = {}) # @param [Hash] params ({}) def delete_bucket(params = {}, options = {}) req = build_request(:delete_bucket, params) req.send_request(options) end # Deletes an analytics configuration for the bucket (specified by the # analytics configuration ID). # # To use this operation, you must have permissions to perform the # s3:PutAnalyticsConfiguration action. The bucket owner has this # permission by default. The bucket owner can grant this permission to # others. # # @option params [required, String] :bucket # The name of the bucket from which an analytics configuration is # deleted. # # @option params [required, String] :id # The ID that identifies the analytics configuration. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.delete_bucket_analytics_configuration({ # bucket: "BucketName", # required # id: "AnalyticsId", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration AWS API Documentation # # @overload delete_bucket_analytics_configuration(params = {}) # @param [Hash] params ({}) def delete_bucket_analytics_configuration(params = {}, options = {}) req = build_request(:delete_bucket_analytics_configuration, params) req.send_request(options) end # Deletes the CORS configuration information set for the bucket. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete cors configuration on a bucket. # # # The following example deletes CORS configuration on a bucket. # # resp = client.delete_bucket_cors({ # bucket: "examplebucket", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket_cors({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors AWS API Documentation # # @overload delete_bucket_cors(params = {}) # @param [Hash] params ({}) def delete_bucket_cors(params = {}, options = {}) req = build_request(:delete_bucket_cors, params) req.send_request(options) end # Deletes the server-side encryption configuration from the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the server-side encryption # configuration to delete. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.delete_bucket_encryption({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketEncryption AWS API Documentation # # @overload delete_bucket_encryption(params = {}) # @param [Hash] params ({}) def delete_bucket_encryption(params = {}, options = {}) req = build_request(:delete_bucket_encryption, params) req.send_request(options) end # Deletes an inventory configuration (identified by the inventory ID) # from the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the inventory configuration to # delete. # # @option params [required, String] :id # The ID used to identify the inventory configuration. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.delete_bucket_inventory_configuration({ # bucket: "BucketName", # required # id: "InventoryId", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration AWS API Documentation # # @overload delete_bucket_inventory_configuration(params = {}) # @param [Hash] params ({}) def delete_bucket_inventory_configuration(params = {}, options = {}) req = build_request(:delete_bucket_inventory_configuration, params) req.send_request(options) end # Deletes the lifecycle configuration from the bucket. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete lifecycle configuration on a bucket. # # # The following example deletes lifecycle configuration on a bucket. # # resp = client.delete_bucket_lifecycle({ # bucket: "examplebucket", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket_lifecycle({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle AWS API Documentation # # @overload delete_bucket_lifecycle(params = {}) # @param [Hash] params ({}) def delete_bucket_lifecycle(params = {}, options = {}) req = build_request(:delete_bucket_lifecycle, params) req.send_request(options) end # Deletes a metrics configuration (specified by the metrics # configuration ID) from the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the metrics configuration to delete. # # @option params [required, String] :id # The ID used to identify the metrics configuration. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.delete_bucket_metrics_configuration({ # bucket: "BucketName", # required # id: "MetricsId", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration AWS API Documentation # # @overload delete_bucket_metrics_configuration(params = {}) # @param [Hash] params ({}) def delete_bucket_metrics_configuration(params = {}, options = {}) req = build_request(:delete_bucket_metrics_configuration, params) req.send_request(options) end # Deletes the policy from the bucket. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete bucket policy # # # The following example deletes bucket policy on the specified bucket. # # resp = client.delete_bucket_policy({ # bucket: "examplebucket", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket_policy({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy AWS API Documentation # # @overload delete_bucket_policy(params = {}) # @param [Hash] params ({}) def delete_bucket_policy(params = {}, options = {}) req = build_request(:delete_bucket_policy, params) req.send_request(options) end # Deletes the replication configuration from the bucket. For information # about replication configuration, see [Cross-Region Replication # (CRR)][1] in the *Amazon S3 Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html # # @option params [required, String] :bucket # The bucket name. # # It can take a while to propagate the deletion of a replication # configuration to all Amazon S3 systems. # # # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete bucket replication configuration # # # The following example deletes replication configuration set on bucket. # # resp = client.delete_bucket_replication({ # bucket: "example", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket_replication({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication AWS API Documentation # # @overload delete_bucket_replication(params = {}) # @param [Hash] params ({}) def delete_bucket_replication(params = {}, options = {}) req = build_request(:delete_bucket_replication, params) req.send_request(options) end # Deletes the tags from the bucket. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete bucket tags # # # The following example deletes bucket tags. # # resp = client.delete_bucket_tagging({ # bucket: "examplebucket", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket_tagging({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging AWS API Documentation # # @overload delete_bucket_tagging(params = {}) # @param [Hash] params ({}) def delete_bucket_tagging(params = {}, options = {}) req = build_request(:delete_bucket_tagging, params) req.send_request(options) end # This operation removes the website configuration from the bucket. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To delete bucket website configuration # # # The following example deletes bucket website configuration. # # resp = client.delete_bucket_website({ # bucket: "examplebucket", # }) # # @example Request syntax with placeholder values # # resp = client.delete_bucket_website({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite AWS API Documentation # # @overload delete_bucket_website(params = {}) # @param [Hash] params ({}) def delete_bucket_website(params = {}, options = {}) req = build_request(:delete_bucket_website, params) req.send_request(options) end # Removes the null version (if there is one) of an object and inserts a # delete marker, which becomes the latest version of the object. If # there isn't a null version, Amazon S3 does not remove any objects. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # # @option params [String] :version_id # VersionId used to reference a specific version of the object. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [Boolean] :bypass_governance_retention # Indicates whether Amazon S3 object lock should bypass governance-mode # restrictions to process this operation. # # @return [Types::DeleteObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::DeleteObjectOutput#delete_marker #delete_marker} => Boolean # * {Types::DeleteObjectOutput#version_id #version_id} => String # * {Types::DeleteObjectOutput#request_charged #request_charged} => String # # # @example Example: To delete an object (from a non-versioned bucket) # # # The following example deletes an object from a non-versioned bucket. # # resp = client.delete_object({ # bucket: "ExampleBucket", # key: "HappyFace.jpg", # }) # # @example Example: To delete an object # # # The following example deletes an object from an S3 bucket. # # resp = client.delete_object({ # bucket: "examplebucket", # key: "objectkey.jpg", # }) # # resp.to_h outputs the following: # { # } # # @example Request syntax with placeholder values # # resp = client.delete_object({ # bucket: "BucketName", # required # key: "ObjectKey", # required # mfa: "MFA", # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # # @example Response structure # # resp.delete_marker #=> Boolean # resp.version_id #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject AWS API Documentation # # @overload delete_object(params = {}) # @param [Hash] params ({}) def delete_object(params = {}, options = {}) req = build_request(:delete_object, params) req.send_request(options) end # Removes the tag-set from an existing object. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :version_id # The versionId of the object that the tag-set will be removed from. # # @return [Types::DeleteObjectTaggingOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::DeleteObjectTaggingOutput#version_id #version_id} => String # # # @example Example: To remove tag set from an object # # # The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the # # operation removes tag set from the latest object version. # # resp = client.delete_object_tagging({ # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # version_id: "null", # } # # @example Example: To remove tag set from an object version # # # The following example removes tag set associated with the specified object version. The request specifies both the # # object key and object version. # # resp = client.delete_object_tagging({ # bucket: "examplebucket", # key: "HappyFace.jpg", # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI", # }) # # resp.to_h outputs the following: # { # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI", # } # # @example Request syntax with placeholder values # # resp = client.delete_object_tagging({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # }) # # @example Response structure # # resp.version_id #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging AWS API Documentation # # @overload delete_object_tagging(params = {}) # @param [Hash] params ({}) def delete_object_tagging(params = {}, options = {}) req = build_request(:delete_object_tagging, params) req.send_request(options) end # This operation enables you to delete multiple objects from a bucket # using a single HTTP request. You may specify up to 1000 keys. # # @option params [required, String] :bucket # # @option params [required, Types::Delete] :delete # # @option params [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [Boolean] :bypass_governance_retention # Specifies whether you want to delete this object even if it has a # Governance-type object lock in place. You must have sufficient # permissions to perform this operation. # # @return [Types::DeleteObjectsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::DeleteObjectsOutput#deleted #deleted} => Array<Types::DeletedObject> # * {Types::DeleteObjectsOutput#request_charged #request_charged} => String # * {Types::DeleteObjectsOutput#errors #errors} => Array<Types::Error> # # # @example Example: To delete multiple object versions from a versioned bucket # # # The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object # # versions and returns the key and versions of deleted objects in the response. # # resp = client.delete_objects({ # bucket: "examplebucket", # delete: { # objects: [ # { # key: "HappyFace.jpg", # version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b", # }, # { # key: "HappyFace.jpg", # version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd", # }, # ], # quiet: false, # }, # }) # # resp.to_h outputs the following: # { # deleted: [ # { # key: "HappyFace.jpg", # version_id: "yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd", # }, # { # key: "HappyFace.jpg", # version_id: "2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b", # }, # ], # } # # @example Example: To delete multiple objects from a versioned bucket # # # The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the # # object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker. # # resp = client.delete_objects({ # bucket: "examplebucket", # delete: { # objects: [ # { # key: "objectkey1", # }, # { # key: "objectkey2", # }, # ], # quiet: false, # }, # }) # # resp.to_h outputs the following: # { # deleted: [ # { # delete_marker: true, # delete_marker_version_id: "A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F", # key: "objectkey1", # }, # { # delete_marker: true, # delete_marker_version_id: "iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt", # key: "objectkey2", # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.delete_objects({ # bucket: "BucketName", # required # delete: { # required # objects: [ # required # { # key: "ObjectKey", # required # version_id: "ObjectVersionId", # }, # ], # quiet: false, # }, # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # # @example Response structure # # resp.deleted #=> Array # resp.deleted[0].key #=> String # resp.deleted[0].version_id #=> String # resp.deleted[0].delete_marker #=> Boolean # resp.deleted[0].delete_marker_version_id #=> String # resp.request_charged #=> String, one of "requester" # resp.errors #=> Array # resp.errors[0].key #=> String # resp.errors[0].version_id #=> String # resp.errors[0].code #=> String # resp.errors[0].message #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects AWS API Documentation # # @overload delete_objects(params = {}) # @param [Hash] params ({}) def delete_objects(params = {}, options = {}) req = build_request(:delete_objects, params) req.send_request(options) end # Removes the `PublicAccessBlock` configuration from an Amazon S3 # bucket. # # @option params [required, String] :bucket # The Amazon S3 bucket whose `PublicAccessBlock` configuration you want # to delete. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.delete_public_access_block({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletePublicAccessBlock AWS API Documentation # # @overload delete_public_access_block(params = {}) # @param [Hash] params ({}) def delete_public_access_block(params = {}, options = {}) req = build_request(:delete_public_access_block, params) req.send_request(options) end # Returns the accelerate configuration of a bucket. # # @option params [required, String] :bucket # Name of the bucket for which the accelerate configuration is # retrieved. # # @return [Types::GetBucketAccelerateConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketAccelerateConfigurationOutput#status #status} => String # # @example Request syntax with placeholder values # # resp = client.get_bucket_accelerate_configuration({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.status #=> String, one of "Enabled", "Suspended" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration AWS API Documentation # # @overload get_bucket_accelerate_configuration(params = {}) # @param [Hash] params ({}) def get_bucket_accelerate_configuration(params = {}, options = {}) req = build_request(:get_bucket_accelerate_configuration, params) req.send_request(options) end # Gets the access control policy for the bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketAclOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketAclOutput#owner #owner} => Types::Owner # * {Types::GetBucketAclOutput#grants #grants} => Array<Types::Grant> # # @example Request syntax with placeholder values # # resp = client.get_bucket_acl({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.owner.display_name #=> String # resp.owner.id #=> String # resp.grants #=> Array # resp.grants[0].grantee.display_name #=> String # resp.grants[0].grantee.email_address #=> String # resp.grants[0].grantee.id #=> String # resp.grants[0].grantee.type #=> String, one of "CanonicalUser", "AmazonCustomerByEmail", "Group" # resp.grants[0].grantee.uri #=> String # resp.grants[0].permission #=> String, one of "FULL_CONTROL", "WRITE", "WRITE_ACP", "READ", "READ_ACP" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl AWS API Documentation # # @overload get_bucket_acl(params = {}) # @param [Hash] params ({}) def get_bucket_acl(params = {}, options = {}) req = build_request(:get_bucket_acl, params) req.send_request(options) end # Gets an analytics configuration for the bucket (specified by the # analytics configuration ID). # # @option params [required, String] :bucket # The name of the bucket from which an analytics configuration is # retrieved. # # @option params [required, String] :id # The ID that identifies the analytics configuration. # # @return [Types::GetBucketAnalyticsConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketAnalyticsConfigurationOutput#analytics_configuration #analytics_configuration} => Types::AnalyticsConfiguration # # @example Request syntax with placeholder values # # resp = client.get_bucket_analytics_configuration({ # bucket: "BucketName", # required # id: "AnalyticsId", # required # }) # # @example Response structure # # resp.analytics_configuration.id #=> String # resp.analytics_configuration.filter.prefix #=> String # resp.analytics_configuration.filter.tag.key #=> String # resp.analytics_configuration.filter.tag.value #=> String # resp.analytics_configuration.filter.and.prefix #=> String # resp.analytics_configuration.filter.and.tags #=> Array # resp.analytics_configuration.filter.and.tags[0].key #=> String # resp.analytics_configuration.filter.and.tags[0].value #=> String # resp.analytics_configuration.storage_class_analysis.data_export.output_schema_version #=> String, one of "V_1" # resp.analytics_configuration.storage_class_analysis.data_export.destination.s3_bucket_destination.format #=> String, one of "CSV" # resp.analytics_configuration.storage_class_analysis.data_export.destination.s3_bucket_destination.bucket_account_id #=> String # resp.analytics_configuration.storage_class_analysis.data_export.destination.s3_bucket_destination.bucket #=> String # resp.analytics_configuration.storage_class_analysis.data_export.destination.s3_bucket_destination.prefix #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration AWS API Documentation # # @overload get_bucket_analytics_configuration(params = {}) # @param [Hash] params ({}) def get_bucket_analytics_configuration(params = {}, options = {}) req = build_request(:get_bucket_analytics_configuration, params) req.send_request(options) end # Returns the CORS configuration for the bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketCorsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketCorsOutput#cors_rules #cors_rules} => Array<Types::CORSRule> # # # @example Example: To get cors configuration set on a bucket # # # The following example returns cross-origin resource sharing (CORS) configuration set on a bucket. # # resp = client.get_bucket_cors({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # cors_rules: [ # { # allowed_headers: [ # "Authorization", # ], # allowed_methods: [ # "GET", # ], # allowed_origins: [ # "*", # ], # max_age_seconds: 3000, # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_cors({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.cors_rules #=> Array # resp.cors_rules[0].allowed_headers #=> Array # resp.cors_rules[0].allowed_headers[0] #=> String # resp.cors_rules[0].allowed_methods #=> Array # resp.cors_rules[0].allowed_methods[0] #=> String # resp.cors_rules[0].allowed_origins #=> Array # resp.cors_rules[0].allowed_origins[0] #=> String # resp.cors_rules[0].expose_headers #=> Array # resp.cors_rules[0].expose_headers[0] #=> String # resp.cors_rules[0].max_age_seconds #=> Integer # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors AWS API Documentation # # @overload get_bucket_cors(params = {}) # @param [Hash] params ({}) def get_bucket_cors(params = {}, options = {}) req = build_request(:get_bucket_cors, params) req.send_request(options) end # Returns the server-side encryption configuration of a bucket. # # @option params [required, String] :bucket # The name of the bucket from which the server-side encryption # configuration is retrieved. # # @return [Types::GetBucketEncryptionOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketEncryptionOutput#server_side_encryption_configuration #server_side_encryption_configuration} => Types::ServerSideEncryptionConfiguration # # @example Request syntax with placeholder values # # resp = client.get_bucket_encryption({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.server_side_encryption_configuration.rules #=> Array # resp.server_side_encryption_configuration.rules[0].apply_server_side_encryption_by_default.sse_algorithm #=> String, one of "AES256", "aws:kms" # resp.server_side_encryption_configuration.rules[0].apply_server_side_encryption_by_default.kms_master_key_id #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryption AWS API Documentation # # @overload get_bucket_encryption(params = {}) # @param [Hash] params ({}) def get_bucket_encryption(params = {}, options = {}) req = build_request(:get_bucket_encryption, params) req.send_request(options) end # Returns an inventory configuration (identified by the inventory ID) # from the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the inventory configuration to # retrieve. # # @option params [required, String] :id # The ID used to identify the inventory configuration. # # @return [Types::GetBucketInventoryConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketInventoryConfigurationOutput#inventory_configuration #inventory_configuration} => Types::InventoryConfiguration # # @example Request syntax with placeholder values # # resp = client.get_bucket_inventory_configuration({ # bucket: "BucketName", # required # id: "InventoryId", # required # }) # # @example Response structure # # resp.inventory_configuration.destination.s3_bucket_destination.account_id #=> String # resp.inventory_configuration.destination.s3_bucket_destination.bucket #=> String # resp.inventory_configuration.destination.s3_bucket_destination.format #=> String, one of "CSV", "ORC", "Parquet" # resp.inventory_configuration.destination.s3_bucket_destination.prefix #=> String # resp.inventory_configuration.destination.s3_bucket_destination.encryption.ssekms.key_id #=> String # resp.inventory_configuration.is_enabled #=> Boolean # resp.inventory_configuration.filter.prefix #=> String # resp.inventory_configuration.id #=> String # resp.inventory_configuration.included_object_versions #=> String, one of "All", "Current" # resp.inventory_configuration.optional_fields #=> Array # resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus" # resp.inventory_configuration.schedule.frequency #=> String, one of "Daily", "Weekly" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration AWS API Documentation # # @overload get_bucket_inventory_configuration(params = {}) # @param [Hash] params ({}) def get_bucket_inventory_configuration(params = {}, options = {}) req = build_request(:get_bucket_inventory_configuration, params) req.send_request(options) end # No longer used, see the GetBucketLifecycleConfiguration operation. # # @option params [required, String] :bucket # # @return [Types::GetBucketLifecycleOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketLifecycleOutput#rules #rules} => Array<Types::Rule> # # # @example Example: To get a bucket acl # # # The following example gets ACL on the specified bucket. # # resp = client.get_bucket_lifecycle({ # bucket: "acl1", # }) # # resp.to_h outputs the following: # { # rules: [ # { # expiration: { # days: 1, # }, # id: "delete logs", # prefix: "123/", # status: "Enabled", # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_lifecycle({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.rules #=> Array # resp.rules[0].expiration.date #=> Time # resp.rules[0].expiration.days #=> Integer # resp.rules[0].expiration.expired_object_delete_marker #=> Boolean # resp.rules[0].id #=> String # resp.rules[0].prefix #=> String # resp.rules[0].status #=> String, one of "Enabled", "Disabled" # resp.rules[0].transition.date #=> Time # resp.rules[0].transition.days #=> Integer # resp.rules[0].transition.storage_class #=> String, one of "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE" # resp.rules[0].noncurrent_version_transition.noncurrent_days #=> Integer # resp.rules[0].noncurrent_version_transition.storage_class #=> String, one of "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE" # resp.rules[0].noncurrent_version_expiration.noncurrent_days #=> Integer # resp.rules[0].abort_incomplete_multipart_upload.days_after_initiation #=> Integer # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle AWS API Documentation # # @overload get_bucket_lifecycle(params = {}) # @param [Hash] params ({}) def get_bucket_lifecycle(params = {}, options = {}) req = build_request(:get_bucket_lifecycle, params) req.send_request(options) end # Returns the lifecycle configuration information set on the bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketLifecycleConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketLifecycleConfigurationOutput#rules #rules} => Array<Types::LifecycleRule> # # # @example Example: To get lifecycle configuration on a bucket # # # The following example retrieves lifecycle configuration on set on a bucket. # # resp = client.get_bucket_lifecycle_configuration({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # rules: [ # { # id: "Rule for TaxDocs/", # prefix: "TaxDocs", # status: "Enabled", # transitions: [ # { # days: 365, # storage_class: "STANDARD_IA", # }, # ], # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_lifecycle_configuration({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.rules #=> Array # resp.rules[0].expiration.date #=> Time # resp.rules[0].expiration.days #=> Integer # resp.rules[0].expiration.expired_object_delete_marker #=> Boolean # resp.rules[0].id #=> String # resp.rules[0].prefix #=> String # resp.rules[0].filter.prefix #=> String # resp.rules[0].filter.tag.key #=> String # resp.rules[0].filter.tag.value #=> String # resp.rules[0].filter.and.prefix #=> String # resp.rules[0].filter.and.tags #=> Array # resp.rules[0].filter.and.tags[0].key #=> String # resp.rules[0].filter.and.tags[0].value #=> String # resp.rules[0].status #=> String, one of "Enabled", "Disabled" # resp.rules[0].transitions #=> Array # resp.rules[0].transitions[0].date #=> Time # resp.rules[0].transitions[0].days #=> Integer # resp.rules[0].transitions[0].storage_class #=> String, one of "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE" # resp.rules[0].noncurrent_version_transitions #=> Array # resp.rules[0].noncurrent_version_transitions[0].noncurrent_days #=> Integer # resp.rules[0].noncurrent_version_transitions[0].storage_class #=> String, one of "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE" # resp.rules[0].noncurrent_version_expiration.noncurrent_days #=> Integer # resp.rules[0].abort_incomplete_multipart_upload.days_after_initiation #=> Integer # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration AWS API Documentation # # @overload get_bucket_lifecycle_configuration(params = {}) # @param [Hash] params ({}) def get_bucket_lifecycle_configuration(params = {}, options = {}) req = build_request(:get_bucket_lifecycle_configuration, params) req.send_request(options) end # Returns the region the bucket resides in. # # @option params [required, String] :bucket # # @return [Types::GetBucketLocationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketLocationOutput#location_constraint #location_constraint} => String # # # @example Example: To get bucket location # # # The following example returns bucket location. # # resp = client.get_bucket_location({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # location_constraint: "us-west-2", # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_location({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.location_constraint #=> String, one of "EU", "eu-west-1", "us-west-1", "us-west-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "sa-east-1", "cn-north-1", "eu-central-1" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation AWS API Documentation # # @overload get_bucket_location(params = {}) # @param [Hash] params ({}) def get_bucket_location(params = {}, options = {}) req = build_request(:get_bucket_location, params) req.send_request(options) end # Returns the logging status of a bucket and the permissions users have # to view and modify that status. To use GET, you must be the bucket # owner. # # @option params [required, String] :bucket # # @return [Types::GetBucketLoggingOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketLoggingOutput#logging_enabled #logging_enabled} => Types::LoggingEnabled # # @example Request syntax with placeholder values # # resp = client.get_bucket_logging({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.logging_enabled.target_bucket #=> String # resp.logging_enabled.target_grants #=> Array # resp.logging_enabled.target_grants[0].grantee.display_name #=> String # resp.logging_enabled.target_grants[0].grantee.email_address #=> String # resp.logging_enabled.target_grants[0].grantee.id #=> String # resp.logging_enabled.target_grants[0].grantee.type #=> String, one of "CanonicalUser", "AmazonCustomerByEmail", "Group" # resp.logging_enabled.target_grants[0].grantee.uri #=> String # resp.logging_enabled.target_grants[0].permission #=> String, one of "FULL_CONTROL", "READ", "WRITE" # resp.logging_enabled.target_prefix #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging AWS API Documentation # # @overload get_bucket_logging(params = {}) # @param [Hash] params ({}) def get_bucket_logging(params = {}, options = {}) req = build_request(:get_bucket_logging, params) req.send_request(options) end # Gets a metrics configuration (specified by the metrics configuration # ID) from the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the metrics configuration to # retrieve. # # @option params [required, String] :id # The ID used to identify the metrics configuration. # # @return [Types::GetBucketMetricsConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketMetricsConfigurationOutput#metrics_configuration #metrics_configuration} => Types::MetricsConfiguration # # @example Request syntax with placeholder values # # resp = client.get_bucket_metrics_configuration({ # bucket: "BucketName", # required # id: "MetricsId", # required # }) # # @example Response structure # # resp.metrics_configuration.id #=> String # resp.metrics_configuration.filter.prefix #=> String # resp.metrics_configuration.filter.tag.key #=> String # resp.metrics_configuration.filter.tag.value #=> String # resp.metrics_configuration.filter.and.prefix #=> String # resp.metrics_configuration.filter.and.tags #=> Array # resp.metrics_configuration.filter.and.tags[0].key #=> String # resp.metrics_configuration.filter.and.tags[0].value #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration AWS API Documentation # # @overload get_bucket_metrics_configuration(params = {}) # @param [Hash] params ({}) def get_bucket_metrics_configuration(params = {}, options = {}) req = build_request(:get_bucket_metrics_configuration, params) req.send_request(options) end # No longer used, see the GetBucketNotificationConfiguration operation. # # @option params [required, String] :bucket # Name of the bucket to get the notification configuration for. # # @return [Types::NotificationConfigurationDeprecated] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::NotificationConfigurationDeprecated#topic_configuration #topic_configuration} => Types::TopicConfigurationDeprecated # * {Types::NotificationConfigurationDeprecated#queue_configuration #queue_configuration} => Types::QueueConfigurationDeprecated # * {Types::NotificationConfigurationDeprecated#cloud_function_configuration #cloud_function_configuration} => Types::CloudFunctionConfiguration # # # @example Example: To get notification configuration set on a bucket # # # The following example returns notification configuration set on a bucket. # # resp = client.get_bucket_notification({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # queue_configuration: { # event: "s3:ObjectCreated:Put", # events: [ # "s3:ObjectCreated:Put", # ], # id: "MDQ2OGQ4NDEtOTBmNi00YTM4LTk0NzYtZDIwN2I3NWQ1NjIx", # queue: "arn:aws:sqs:us-east-1:acct-id:S3ObjectCreatedEventQueue", # }, # topic_configuration: { # event: "s3:ObjectCreated:Copy", # events: [ # "s3:ObjectCreated:Copy", # ], # id: "YTVkMWEzZGUtNTY1NS00ZmE2LWJjYjktMmRlY2QwODFkNTJi", # topic: "arn:aws:sns:us-east-1:acct-id:S3ObjectCreatedEventTopic", # }, # } # # @example Example: To get notification configuration set on a bucket # # # The following example returns notification configuration set on a bucket. # # resp = client.get_bucket_notification({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # queue_configuration: { # event: "s3:ObjectCreated:Put", # events: [ # "s3:ObjectCreated:Put", # ], # id: "MDQ2OGQ4NDEtOTBmNi00YTM4LTk0NzYtZDIwN2I3NWQ1NjIx", # queue: "arn:aws:sqs:us-east-1:acct-id:S3ObjectCreatedEventQueue", # }, # topic_configuration: { # event: "s3:ObjectCreated:Copy", # events: [ # "s3:ObjectCreated:Copy", # ], # id: "YTVkMWEzZGUtNTY1NS00ZmE2LWJjYjktMmRlY2QwODFkNTJi", # topic: "arn:aws:sns:us-east-1:acct-id:S3ObjectCreatedEventTopic", # }, # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_notification({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.topic_configuration.id #=> String # resp.topic_configuration.events #=> Array # resp.topic_configuration.events[0] #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.topic_configuration.event #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.topic_configuration.topic #=> String # resp.queue_configuration.id #=> String # resp.queue_configuration.event #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.queue_configuration.events #=> Array # resp.queue_configuration.events[0] #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.queue_configuration.queue #=> String # resp.cloud_function_configuration.id #=> String # resp.cloud_function_configuration.event #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.cloud_function_configuration.events #=> Array # resp.cloud_function_configuration.events[0] #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.cloud_function_configuration.cloud_function #=> String # resp.cloud_function_configuration.invocation_role #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification AWS API Documentation # # @overload get_bucket_notification(params = {}) # @param [Hash] params ({}) def get_bucket_notification(params = {}, options = {}) req = build_request(:get_bucket_notification, params) req.send_request(options) end # Returns the notification configuration of a bucket. # # @option params [required, String] :bucket # Name of the bucket to get the notification configuration for. # # @return [Types::NotificationConfiguration] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::NotificationConfiguration#topic_configurations #topic_configurations} => Array<Types::TopicConfiguration> # * {Types::NotificationConfiguration#queue_configurations #queue_configurations} => Array<Types::QueueConfiguration> # * {Types::NotificationConfiguration#lambda_function_configurations #lambda_function_configurations} => Array<Types::LambdaFunctionConfiguration> # # @example Request syntax with placeholder values # # resp = client.get_bucket_notification_configuration({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.topic_configurations #=> Array # resp.topic_configurations[0].id #=> String # resp.topic_configurations[0].topic_arn #=> String # resp.topic_configurations[0].events #=> Array # resp.topic_configurations[0].events[0] #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.topic_configurations[0].filter.key.filter_rules #=> Array # resp.topic_configurations[0].filter.key.filter_rules[0].name #=> String, one of "prefix", "suffix" # resp.topic_configurations[0].filter.key.filter_rules[0].value #=> String # resp.queue_configurations #=> Array # resp.queue_configurations[0].id #=> String # resp.queue_configurations[0].queue_arn #=> String # resp.queue_configurations[0].events #=> Array # resp.queue_configurations[0].events[0] #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.queue_configurations[0].filter.key.filter_rules #=> Array # resp.queue_configurations[0].filter.key.filter_rules[0].name #=> String, one of "prefix", "suffix" # resp.queue_configurations[0].filter.key.filter_rules[0].value #=> String # resp.lambda_function_configurations #=> Array # resp.lambda_function_configurations[0].id #=> String # resp.lambda_function_configurations[0].lambda_function_arn #=> String # resp.lambda_function_configurations[0].events #=> Array # resp.lambda_function_configurations[0].events[0] #=> String, one of "s3:ReducedRedundancyLostObject", "s3:ObjectCreated:*", "s3:ObjectCreated:Put", "s3:ObjectCreated:Post", "s3:ObjectCreated:Copy", "s3:ObjectCreated:CompleteMultipartUpload", "s3:ObjectRemoved:*", "s3:ObjectRemoved:Delete", "s3:ObjectRemoved:DeleteMarkerCreated", "s3:ObjectRestore:Post", "s3:ObjectRestore:Completed" # resp.lambda_function_configurations[0].filter.key.filter_rules #=> Array # resp.lambda_function_configurations[0].filter.key.filter_rules[0].name #=> String, one of "prefix", "suffix" # resp.lambda_function_configurations[0].filter.key.filter_rules[0].value #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration AWS API Documentation # # @overload get_bucket_notification_configuration(params = {}) # @param [Hash] params ({}) def get_bucket_notification_configuration(params = {}, options = {}) req = build_request(:get_bucket_notification_configuration, params) req.send_request(options) end # Returns the policy of a specified bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketPolicyOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketPolicyOutput#policy #policy} => IO # # # @example Example: To get bucket policy # # # The following example returns bucket policy associated with a bucket. # # resp = client.get_bucket_policy({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # policy: "{\"Version\":\"2008-10-17\",\"Id\":\"LogPolicy\",\"Statement\":[{\"Sid\":\"Enables the log delivery group to publish logs to your bucket \",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"111122223333\"},\"Action\":[\"s3:GetBucketAcl\",\"s3:GetObjectAcl\",\"s3:PutObject\"],\"Resource\":[\"arn:aws:s3:::policytest1/*\",\"arn:aws:s3:::policytest1\"]}]}", # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_policy({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.policy #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy AWS API Documentation # # @overload get_bucket_policy(params = {}) # @param [Hash] params ({}) def get_bucket_policy(params = {}, options = {}, &block) req = build_request(:get_bucket_policy, params) req.send_request(options, &block) end # Retrieves the policy status for an Amazon S3 bucket, indicating # whether the bucket is public. # # @option params [required, String] :bucket # The name of the Amazon S3 bucket whose policy status you want to # retrieve. # # @return [Types::GetBucketPolicyStatusOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketPolicyStatusOutput#policy_status #policy_status} => Types::PolicyStatus # # @example Request syntax with placeholder values # # resp = client.get_bucket_policy_status({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.policy_status.is_public #=> Boolean # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyStatus AWS API Documentation # # @overload get_bucket_policy_status(params = {}) # @param [Hash] params ({}) def get_bucket_policy_status(params = {}, options = {}) req = build_request(:get_bucket_policy_status, params) req.send_request(options) end # Returns the replication configuration of a bucket. # # It can take a while to propagate the put or delete a replication # configuration to all Amazon S3 systems. Therefore, a get request soon # after put or delete can return a wrong result. # # # # @option params [required, String] :bucket # # @return [Types::GetBucketReplicationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketReplicationOutput#replication_configuration #replication_configuration} => Types::ReplicationConfiguration # # # @example Example: To get replication configuration set on a bucket # # # The following example returns replication configuration set on a bucket. # # resp = client.get_bucket_replication({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # replication_configuration: { # role: "arn:aws:iam::acct-id:role/example-role", # rules: [ # { # destination: { # bucket: "arn:aws:s3:::destination-bucket", # }, # id: "MWIwNTkwZmItMTE3MS00ZTc3LWJkZDEtNzRmODQwYzc1OTQy", # prefix: "Tax", # status: "Enabled", # }, # ], # }, # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_replication({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.replication_configuration.role #=> String # resp.replication_configuration.rules #=> Array # resp.replication_configuration.rules[0].id #=> String # resp.replication_configuration.rules[0].priority #=> Integer # resp.replication_configuration.rules[0].prefix #=> String # resp.replication_configuration.rules[0].filter.prefix #=> String # resp.replication_configuration.rules[0].filter.tag.key #=> String # resp.replication_configuration.rules[0].filter.tag.value #=> String # resp.replication_configuration.rules[0].filter.and.prefix #=> String # resp.replication_configuration.rules[0].filter.and.tags #=> Array # resp.replication_configuration.rules[0].filter.and.tags[0].key #=> String # resp.replication_configuration.rules[0].filter.and.tags[0].value #=> String # resp.replication_configuration.rules[0].status #=> String, one of "Enabled", "Disabled" # resp.replication_configuration.rules[0].source_selection_criteria.sse_kms_encrypted_objects.status #=> String, one of "Enabled", "Disabled" # resp.replication_configuration.rules[0].destination.bucket #=> String # resp.replication_configuration.rules[0].destination.account #=> String # resp.replication_configuration.rules[0].destination.storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE" # resp.replication_configuration.rules[0].destination.access_control_translation.owner #=> String, one of "Destination" # resp.replication_configuration.rules[0].destination.encryption_configuration.replica_kms_key_id #=> String # resp.replication_configuration.rules[0].delete_marker_replication.status #=> String, one of "Enabled", "Disabled" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication AWS API Documentation # # @overload get_bucket_replication(params = {}) # @param [Hash] params ({}) def get_bucket_replication(params = {}, options = {}) req = build_request(:get_bucket_replication, params) req.send_request(options) end # Returns the request payment configuration of a bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketRequestPaymentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketRequestPaymentOutput#payer #payer} => String # # # @example Example: To get bucket versioning configuration # # # The following example retrieves bucket versioning configuration. # # resp = client.get_bucket_request_payment({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # payer: "BucketOwner", # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_request_payment({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.payer #=> String, one of "Requester", "BucketOwner" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment AWS API Documentation # # @overload get_bucket_request_payment(params = {}) # @param [Hash] params ({}) def get_bucket_request_payment(params = {}, options = {}) req = build_request(:get_bucket_request_payment, params) req.send_request(options) end # Returns the tag set associated with the bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketTaggingOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketTaggingOutput#tag_set #tag_set} => Array<Types::Tag> # # # @example Example: To get tag set associated with a bucket # # # The following example returns tag set associated with a bucket # # resp = client.get_bucket_tagging({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # tag_set: [ # { # key: "key1", # value: "value1", # }, # { # key: "key2", # value: "value2", # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_tagging({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.tag_set #=> Array # resp.tag_set[0].key #=> String # resp.tag_set[0].value #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging AWS API Documentation # # @overload get_bucket_tagging(params = {}) # @param [Hash] params ({}) def get_bucket_tagging(params = {}, options = {}) req = build_request(:get_bucket_tagging, params) req.send_request(options) end # Returns the versioning state of a bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketVersioningOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketVersioningOutput#status #status} => String # * {Types::GetBucketVersioningOutput#mfa_delete #mfa_delete} => String # # # @example Example: To get bucket versioning configuration # # # The following example retrieves bucket versioning configuration. # # resp = client.get_bucket_versioning({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # mfa_delete: "Disabled", # status: "Enabled", # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_versioning({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.status #=> String, one of "Enabled", "Suspended" # resp.mfa_delete #=> String, one of "Enabled", "Disabled" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning AWS API Documentation # # @overload get_bucket_versioning(params = {}) # @param [Hash] params ({}) def get_bucket_versioning(params = {}, options = {}) req = build_request(:get_bucket_versioning, params) req.send_request(options) end # Returns the website configuration for a bucket. # # @option params [required, String] :bucket # # @return [Types::GetBucketWebsiteOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetBucketWebsiteOutput#redirect_all_requests_to #redirect_all_requests_to} => Types::RedirectAllRequestsTo # * {Types::GetBucketWebsiteOutput#index_document #index_document} => Types::IndexDocument # * {Types::GetBucketWebsiteOutput#error_document #error_document} => Types::ErrorDocument # * {Types::GetBucketWebsiteOutput#routing_rules #routing_rules} => Array<Types::RoutingRule> # # # @example Example: To get bucket website configuration # # # The following example retrieves website configuration of a bucket. # # resp = client.get_bucket_website({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # error_document: { # key: "error.html", # }, # index_document: { # suffix: "index.html", # }, # } # # @example Request syntax with placeholder values # # resp = client.get_bucket_website({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.redirect_all_requests_to.host_name #=> String # resp.redirect_all_requests_to.protocol #=> String, one of "http", "https" # resp.index_document.suffix #=> String # resp.error_document.key #=> String # resp.routing_rules #=> Array # resp.routing_rules[0].condition.http_error_code_returned_equals #=> String # resp.routing_rules[0].condition.key_prefix_equals #=> String # resp.routing_rules[0].redirect.host_name #=> String # resp.routing_rules[0].redirect.http_redirect_code #=> String # resp.routing_rules[0].redirect.protocol #=> String, one of "http", "https" # resp.routing_rules[0].redirect.replace_key_prefix_with #=> String # resp.routing_rules[0].redirect.replace_key_with #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite AWS API Documentation # # @overload get_bucket_website(params = {}) # @param [Hash] params ({}) def get_bucket_website(params = {}, options = {}) req = build_request(:get_bucket_website, params) req.send_request(options) end # Retrieves objects from Amazon S3. # # @option params [String, IO] :response_target # Where to write response data, file path, or IO object. # # @option params [required, String] :bucket # # @option params [String] :if_match # Return the object only if its entity tag (ETag) is the same as the one # specified, otherwise return a 412 (precondition failed). # # @option params [Time,DateTime,Date,Integer,String] :if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # # @option params [String] :if_none_match # Return the object only if its entity tag (ETag) is different from the # one specified, otherwise return a 304 (not modified). # # @option params [Time,DateTime,Date,Integer,String] :if_unmodified_since # Return the object only if it has not been modified since the specified # time, otherwise return a 412 (precondition failed). # # @option params [required, String] :key # # @option params [String] :range # Downloads the specified range bytes of an object. For more information # about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # # @option params [String] :response_cache_control # Sets the Cache-Control header of the response. # # @option params [String] :response_content_disposition # Sets the Content-Disposition header of the response # # @option params [String] :response_content_encoding # Sets the Content-Encoding header of the response. # # @option params [String] :response_content_language # Sets the Content-Language header of the response. # # @option params [String] :response_content_type # Sets the Content-Type header of the response. # # @option params [Time,DateTime,Date,Integer,String] :response_expires # Sets the Expires header of the response. # # @option params [String] :version_id # VersionId used to reference a specific version of the object. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [Integer] :part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' GET request # for the part specified. Useful for downloading just a part of an # object. # # @return [Types::GetObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectOutput#body #body} => IO # * {Types::GetObjectOutput#delete_marker #delete_marker} => Boolean # * {Types::GetObjectOutput#accept_ranges #accept_ranges} => String # * {Types::GetObjectOutput#expiration #expiration} => String # * {Types::GetObjectOutput#restore #restore} => String # * {Types::GetObjectOutput#last_modified #last_modified} => Time # * {Types::GetObjectOutput#content_length #content_length} => Integer # * {Types::GetObjectOutput#etag #etag} => String # * {Types::GetObjectOutput#missing_meta #missing_meta} => Integer # * {Types::GetObjectOutput#version_id #version_id} => String # * {Types::GetObjectOutput#cache_control #cache_control} => String # * {Types::GetObjectOutput#content_disposition #content_disposition} => String # * {Types::GetObjectOutput#content_encoding #content_encoding} => String # * {Types::GetObjectOutput#content_language #content_language} => String # * {Types::GetObjectOutput#content_range #content_range} => String # * {Types::GetObjectOutput#content_type #content_type} => String # * {Types::GetObjectOutput#expires #expires} => Time # * {Types::GetObjectOutput#expires_string #expires_string} => String # * {Types::GetObjectOutput#website_redirect_location #website_redirect_location} => String # * {Types::GetObjectOutput#server_side_encryption #server_side_encryption} => String # * {Types::GetObjectOutput#metadata #metadata} => Hash<String,String> # * {Types::GetObjectOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::GetObjectOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::GetObjectOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::GetObjectOutput#storage_class #storage_class} => String # * {Types::GetObjectOutput#request_charged #request_charged} => String # * {Types::GetObjectOutput#replication_status #replication_status} => String # * {Types::GetObjectOutput#parts_count #parts_count} => Integer # * {Types::GetObjectOutput#tag_count #tag_count} => Integer # * {Types::GetObjectOutput#object_lock_mode #object_lock_mode} => String # * {Types::GetObjectOutput#object_lock_retain_until_date #object_lock_retain_until_date} => Time # * {Types::GetObjectOutput#object_lock_legal_hold_status #object_lock_legal_hold_status} => String # # # @example Example: To retrieve an object # # # The following example retrieves an object for an S3 bucket. # # resp = client.get_object({ # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # accept_ranges: "bytes", # content_length: 3191, # content_type: "image/jpeg", # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # last_modified: Time.parse("Thu, 15 Dec 2016 01:19:41 GMT"), # metadata: { # }, # tag_count: 2, # version_id: "null", # } # # @example Example: To retrieve a byte range of an object # # # The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a # # specific byte range. # # resp = client.get_object({ # bucket: "examplebucket", # key: "SampleFile.txt", # range: "bytes=0-9", # }) # # resp.to_h outputs the following: # { # accept_ranges: "bytes", # content_length: 10, # content_range: "bytes 0-9/43", # content_type: "text/plain", # etag: "\"0d94420ffd0bc68cd3d152506b97a9cc\"", # last_modified: Time.parse("Thu, 09 Oct 2014 22:57:28 GMT"), # metadata: { # }, # version_id: "null", # } # # @example Download an object to disk # # stream object directly to disk # resp = s3.get_object( # response_target: '/path/to/file', # bucket: 'bucket-name', # key: 'object-key') # # # you can still access other response data # resp.metadata #=> { ... } # resp.etag #=> "..." # # @example Download object into memory # # omit :response_target to download to a StringIO in memory # resp = s3.get_object(bucket: 'bucket-name', key: 'object-key') # # # call #read or #string on the response body # resp.body.read # #=> '...' # # @example Streaming data to a block # # WARNING: yielding data to a block disables retries of networking errors # File.open('/path/to/file', 'wb') do |file| # s3.get_object(bucket: 'bucket-name', key: 'object-key') do |chunk| # file.write(chunk) # end # end # # @example Request syntax with placeholder values # # resp = client.get_object({ # bucket: "BucketName", # required # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # key: "ObjectKey", # required # range: "Range", # response_cache_control: "ResponseCacheControl", # response_content_disposition: "ResponseContentDisposition", # response_content_encoding: "ResponseContentEncoding", # response_content_language: "ResponseContentLanguage", # response_content_type: "ResponseContentType", # response_expires: Time.now, # version_id: "ObjectVersionId", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # }) # # @example Response structure # # resp.body #=> IO # resp.delete_marker #=> Boolean # resp.accept_ranges #=> String # resp.expiration #=> String # resp.restore #=> String # resp.last_modified #=> Time # resp.content_length #=> Integer # resp.etag #=> String # resp.missing_meta #=> Integer # resp.version_id #=> String # resp.cache_control #=> String # resp.content_disposition #=> String # resp.content_encoding #=> String # resp.content_language #=> String # resp.content_range #=> String # resp.content_type #=> String # resp.expires #=> Time # resp.expires_string #=> String # resp.website_redirect_location #=> String # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.metadata #=> Hash # resp.metadata["MetadataKey"] #=> String # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE" # resp.request_charged #=> String, one of "requester" # resp.replication_status #=> String, one of "COMPLETE", "PENDING", "FAILED", "REPLICA" # resp.parts_count #=> Integer # resp.tag_count #=> Integer # resp.object_lock_mode #=> String, one of "GOVERNANCE", "COMPLIANCE" # resp.object_lock_retain_until_date #=> Time # resp.object_lock_legal_hold_status #=> String, one of "ON", "OFF" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject AWS API Documentation # # @overload get_object(params = {}) # @param [Hash] params ({}) def get_object(params = {}, options = {}, &block) req = build_request(:get_object, params) req.send_request(options, &block) end # Returns the access control list (ACL) of an object. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :version_id # VersionId used to reference a specific version of the object. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::GetObjectAclOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectAclOutput#owner #owner} => Types::Owner # * {Types::GetObjectAclOutput#grants #grants} => Array<Types::Grant> # * {Types::GetObjectAclOutput#request_charged #request_charged} => String # # # @example Example: To retrieve object ACL # # # The following example retrieves access control list (ACL) of an object. # # resp = client.get_object_acl({ # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # grants: [ # { # grantee: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # type: "CanonicalUser", # }, # permission: "WRITE", # }, # { # grantee: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # type: "CanonicalUser", # }, # permission: "WRITE_ACP", # }, # { # grantee: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # type: "CanonicalUser", # }, # permission: "READ", # }, # { # grantee: { # display_name: "owner-display-name", # id: "852b113eexamplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # type: "CanonicalUser", # }, # permission: "READ_ACP", # }, # ], # owner: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # } # # @example Request syntax with placeholder values # # resp = client.get_object_acl({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.owner.display_name #=> String # resp.owner.id #=> String # resp.grants #=> Array # resp.grants[0].grantee.display_name #=> String # resp.grants[0].grantee.email_address #=> String # resp.grants[0].grantee.id #=> String # resp.grants[0].grantee.type #=> String, one of "CanonicalUser", "AmazonCustomerByEmail", "Group" # resp.grants[0].grantee.uri #=> String # resp.grants[0].permission #=> String, one of "FULL_CONTROL", "WRITE", "WRITE_ACP", "READ", "READ_ACP" # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl AWS API Documentation # # @overload get_object_acl(params = {}) # @param [Hash] params ({}) def get_object_acl(params = {}, options = {}) req = build_request(:get_object_acl, params) req.send_request(options) end # Gets an object's current Legal Hold status. # # @option params [required, String] :bucket # The bucket containing the object whose Legal Hold status you want to # retrieve. # # @option params [required, String] :key # The key name for the object whose Legal Hold status you want to # retrieve. # # @option params [String] :version_id # The version ID of the object whose Legal Hold status you want to # retrieve. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::GetObjectLegalHoldOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectLegalHoldOutput#legal_hold #legal_hold} => Types::ObjectLockLegalHold # # @example Request syntax with placeholder values # # resp = client.get_object_legal_hold({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.legal_hold.status #=> String, one of "ON", "OFF" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLegalHold AWS API Documentation # # @overload get_object_legal_hold(params = {}) # @param [Hash] params ({}) def get_object_legal_hold(params = {}, options = {}) req = build_request(:get_object_legal_hold, params) req.send_request(options) end # Gets the object lock configuration for a bucket. The rule specified in # the object lock configuration will be applied by default to every new # object placed in the specified bucket. # # @option params [required, String] :bucket # The bucket whose object lock configuration you want to retrieve. # # @return [Types::GetObjectLockConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectLockConfigurationOutput#object_lock_configuration #object_lock_configuration} => Types::ObjectLockConfiguration # # @example Request syntax with placeholder values # # resp = client.get_object_lock_configuration({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.object_lock_configuration.object_lock_enabled #=> String, one of "Enabled" # resp.object_lock_configuration.rule.default_retention.mode #=> String, one of "GOVERNANCE", "COMPLIANCE" # resp.object_lock_configuration.rule.default_retention.days #=> Integer # resp.object_lock_configuration.rule.default_retention.years #=> Integer # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLockConfiguration AWS API Documentation # # @overload get_object_lock_configuration(params = {}) # @param [Hash] params ({}) def get_object_lock_configuration(params = {}, options = {}) req = build_request(:get_object_lock_configuration, params) req.send_request(options) end # Retrieves an object's retention settings. # # @option params [required, String] :bucket # The bucket containing the object whose retention settings you want to # retrieve. # # @option params [required, String] :key # The key name for the object whose retention settings you want to # retrieve. # # @option params [String] :version_id # The version ID for the object whose retention settings you want to # retrieve. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::GetObjectRetentionOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectRetentionOutput#retention #retention} => Types::ObjectLockRetention # # @example Request syntax with placeholder values # # resp = client.get_object_retention({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.retention.mode #=> String, one of "GOVERNANCE", "COMPLIANCE" # resp.retention.retain_until_date #=> Time # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRetention AWS API Documentation # # @overload get_object_retention(params = {}) # @param [Hash] params ({}) def get_object_retention(params = {}, options = {}) req = build_request(:get_object_retention, params) req.send_request(options) end # Returns the tag-set of an object. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :version_id # # @return [Types::GetObjectTaggingOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectTaggingOutput#version_id #version_id} => String # * {Types::GetObjectTaggingOutput#tag_set #tag_set} => Array<Types::Tag> # # # @example Example: To retrieve tag set of a specific object version # # # The following example retrieves tag set of an object. The request specifies object version. # # resp = client.get_object_tagging({ # bucket: "examplebucket", # key: "exampleobject", # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI", # }) # # resp.to_h outputs the following: # { # tag_set: [ # { # key: "Key1", # value: "Value1", # }, # ], # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI", # } # # @example Example: To retrieve tag set of an object # # # The following example retrieves tag set of an object. # # resp = client.get_object_tagging({ # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # tag_set: [ # { # key: "Key4", # value: "Value4", # }, # { # key: "Key3", # value: "Value3", # }, # ], # version_id: "null", # } # # @example Request syntax with placeholder values # # resp = client.get_object_tagging({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # }) # # @example Response structure # # resp.version_id #=> String # resp.tag_set #=> Array # resp.tag_set[0].key #=> String # resp.tag_set[0].value #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging AWS API Documentation # # @overload get_object_tagging(params = {}) # @param [Hash] params ({}) def get_object_tagging(params = {}, options = {}) req = build_request(:get_object_tagging, params) req.send_request(options) end # Return torrent files from a bucket. # # @option params [String, IO] :response_target # Where to write response data, file path, or IO object. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::GetObjectTorrentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetObjectTorrentOutput#body #body} => IO # * {Types::GetObjectTorrentOutput#request_charged #request_charged} => String # # # @example Example: To retrieve torrent files for an object # # # The following example retrieves torrent files of an object. # # resp = client.get_object_torrent({ # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # } # # @example Request syntax with placeholder values # # resp = client.get_object_torrent({ # bucket: "BucketName", # required # key: "ObjectKey", # required # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.body #=> IO # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent AWS API Documentation # # @overload get_object_torrent(params = {}) # @param [Hash] params ({}) def get_object_torrent(params = {}, options = {}, &block) req = build_request(:get_object_torrent, params) req.send_request(options, &block) end # Retrieves the `PublicAccessBlock` configuration for an Amazon S3 # bucket. # # @option params [required, String] :bucket # The name of the Amazon S3 bucket whose `PublicAccessBlock` # configuration you want to retrieve. # # @return [Types::GetPublicAccessBlockOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::GetPublicAccessBlockOutput#public_access_block_configuration #public_access_block_configuration} => Types::PublicAccessBlockConfiguration # # @example Request syntax with placeholder values # # resp = client.get_public_access_block({ # bucket: "BucketName", # required # }) # # @example Response structure # # resp.public_access_block_configuration.block_public_acls #=> Boolean # resp.public_access_block_configuration.ignore_public_acls #=> Boolean # resp.public_access_block_configuration.block_public_policy #=> Boolean # resp.public_access_block_configuration.restrict_public_buckets #=> Boolean # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetPublicAccessBlock AWS API Documentation # # @overload get_public_access_block(params = {}) # @param [Hash] params ({}) def get_public_access_block(params = {}, options = {}) req = build_request(:get_public_access_block, params) req.send_request(options) end # This operation is useful to determine if a bucket exists and you have # permission to access it. # # @option params [required, String] :bucket # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To determine if bucket exists # # # This operation checks to see if a bucket exists. # # resp = client.head_bucket({ # bucket: "acl1", # }) # # @example Request syntax with placeholder values # # resp = client.head_bucket({ # bucket: "BucketName", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket AWS API Documentation # # @overload head_bucket(params = {}) # @param [Hash] params ({}) def head_bucket(params = {}, options = {}) req = build_request(:head_bucket, params) req.send_request(options) end # The HEAD operation retrieves metadata from an object without returning # the object itself. This operation is useful if you're only interested # in an object's metadata. To use HEAD, you must have READ access to # the object. # # @option params [required, String] :bucket # # @option params [String] :if_match # Return the object only if its entity tag (ETag) is the same as the one # specified, otherwise return a 412 (precondition failed). # # @option params [Time,DateTime,Date,Integer,String] :if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # # @option params [String] :if_none_match # Return the object only if its entity tag (ETag) is different from the # one specified, otherwise return a 304 (not modified). # # @option params [Time,DateTime,Date,Integer,String] :if_unmodified_since # Return the object only if it has not been modified since the specified # time, otherwise return a 412 (precondition failed). # # @option params [required, String] :key # # @option params [String] :range # Downloads the specified range bytes of an object. For more information # about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # # @option params [String] :version_id # VersionId used to reference a specific version of the object. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [Integer] :part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' HEAD request # for the part specified. Useful querying about the size of the part and # the number of parts in this object. # # @return [Types::HeadObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::HeadObjectOutput#delete_marker #delete_marker} => Boolean # * {Types::HeadObjectOutput#accept_ranges #accept_ranges} => String # * {Types::HeadObjectOutput#expiration #expiration} => String # * {Types::HeadObjectOutput#restore #restore} => String # * {Types::HeadObjectOutput#last_modified #last_modified} => Time # * {Types::HeadObjectOutput#content_length #content_length} => Integer # * {Types::HeadObjectOutput#etag #etag} => String # * {Types::HeadObjectOutput#missing_meta #missing_meta} => Integer # * {Types::HeadObjectOutput#version_id #version_id} => String # * {Types::HeadObjectOutput#cache_control #cache_control} => String # * {Types::HeadObjectOutput#content_disposition #content_disposition} => String # * {Types::HeadObjectOutput#content_encoding #content_encoding} => String # * {Types::HeadObjectOutput#content_language #content_language} => String # * {Types::HeadObjectOutput#content_type #content_type} => String # * {Types::HeadObjectOutput#expires #expires} => Time # * {Types::HeadObjectOutput#expires_string #expires_string} => String # * {Types::HeadObjectOutput#website_redirect_location #website_redirect_location} => String # * {Types::HeadObjectOutput#server_side_encryption #server_side_encryption} => String # * {Types::HeadObjectOutput#metadata #metadata} => Hash<String,String> # * {Types::HeadObjectOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::HeadObjectOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::HeadObjectOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::HeadObjectOutput#storage_class #storage_class} => String # * {Types::HeadObjectOutput#request_charged #request_charged} => String # * {Types::HeadObjectOutput#replication_status #replication_status} => String # * {Types::HeadObjectOutput#parts_count #parts_count} => Integer # * {Types::HeadObjectOutput#object_lock_mode #object_lock_mode} => String # * {Types::HeadObjectOutput#object_lock_retain_until_date #object_lock_retain_until_date} => Time # * {Types::HeadObjectOutput#object_lock_legal_hold_status #object_lock_legal_hold_status} => String # # # @example Example: To retrieve metadata of an object without returning the object itself # # # The following example retrieves an object metadata. # # resp = client.head_object({ # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # accept_ranges: "bytes", # content_length: 3191, # content_type: "image/jpeg", # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # last_modified: Time.parse("Thu, 15 Dec 2016 01:19:41 GMT"), # metadata: { # }, # version_id: "null", # } # # @example Request syntax with placeholder values # # resp = client.head_object({ # bucket: "BucketName", # required # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # key: "ObjectKey", # required # range: "Range", # version_id: "ObjectVersionId", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # }) # # @example Response structure # # resp.delete_marker #=> Boolean # resp.accept_ranges #=> String # resp.expiration #=> String # resp.restore #=> String # resp.last_modified #=> Time # resp.content_length #=> Integer # resp.etag #=> String # resp.missing_meta #=> Integer # resp.version_id #=> String # resp.cache_control #=> String # resp.content_disposition #=> String # resp.content_encoding #=> String # resp.content_language #=> String # resp.content_type #=> String # resp.expires #=> Time # resp.expires_string #=> String # resp.website_redirect_location #=> String # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.metadata #=> Hash # resp.metadata["MetadataKey"] #=> String # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE" # resp.request_charged #=> String, one of "requester" # resp.replication_status #=> String, one of "COMPLETE", "PENDING", "FAILED", "REPLICA" # resp.parts_count #=> Integer # resp.object_lock_mode #=> String, one of "GOVERNANCE", "COMPLIANCE" # resp.object_lock_retain_until_date #=> Time # resp.object_lock_legal_hold_status #=> String, one of "ON", "OFF" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject AWS API Documentation # # @overload head_object(params = {}) # @param [Hash] params ({}) def head_object(params = {}, options = {}) req = build_request(:head_object, params) req.send_request(options) end # Lists the analytics configurations for the bucket. # # @option params [required, String] :bucket # The name of the bucket from which analytics configurations are # retrieved. # # @option params [String] :continuation_token # The ContinuationToken that represents a placeholder from where this # request should begin. # # @return [Types::ListBucketAnalyticsConfigurationsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListBucketAnalyticsConfigurationsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListBucketAnalyticsConfigurationsOutput#continuation_token #continuation_token} => String # * {Types::ListBucketAnalyticsConfigurationsOutput#next_continuation_token #next_continuation_token} => String # * {Types::ListBucketAnalyticsConfigurationsOutput#analytics_configuration_list #analytics_configuration_list} => Array<Types::AnalyticsConfiguration> # # @example Request syntax with placeholder values # # resp = client.list_bucket_analytics_configurations({ # bucket: "BucketName", # required # continuation_token: "Token", # }) # # @example Response structure # # resp.is_truncated #=> Boolean # resp.continuation_token #=> String # resp.next_continuation_token #=> String # resp.analytics_configuration_list #=> Array # resp.analytics_configuration_list[0].id #=> String # resp.analytics_configuration_list[0].filter.prefix #=> String # resp.analytics_configuration_list[0].filter.tag.key #=> String # resp.analytics_configuration_list[0].filter.tag.value #=> String # resp.analytics_configuration_list[0].filter.and.prefix #=> String # resp.analytics_configuration_list[0].filter.and.tags #=> Array # resp.analytics_configuration_list[0].filter.and.tags[0].key #=> String # resp.analytics_configuration_list[0].filter.and.tags[0].value #=> String # resp.analytics_configuration_list[0].storage_class_analysis.data_export.output_schema_version #=> String, one of "V_1" # resp.analytics_configuration_list[0].storage_class_analysis.data_export.destination.s3_bucket_destination.format #=> String, one of "CSV" # resp.analytics_configuration_list[0].storage_class_analysis.data_export.destination.s3_bucket_destination.bucket_account_id #=> String # resp.analytics_configuration_list[0].storage_class_analysis.data_export.destination.s3_bucket_destination.bucket #=> String # resp.analytics_configuration_list[0].storage_class_analysis.data_export.destination.s3_bucket_destination.prefix #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations AWS API Documentation # # @overload list_bucket_analytics_configurations(params = {}) # @param [Hash] params ({}) def list_bucket_analytics_configurations(params = {}, options = {}) req = build_request(:list_bucket_analytics_configurations, params) req.send_request(options) end # Returns a list of inventory configurations for the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the inventory configurations to # retrieve. # # @option params [String] :continuation_token # The marker used to continue an inventory configuration listing that # has been truncated. Use the NextContinuationToken from a previously # truncated list response to continue the listing. The continuation # token is an opaque value that Amazon S3 understands. # # @return [Types::ListBucketInventoryConfigurationsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListBucketInventoryConfigurationsOutput#continuation_token #continuation_token} => String # * {Types::ListBucketInventoryConfigurationsOutput#inventory_configuration_list #inventory_configuration_list} => Array<Types::InventoryConfiguration> # * {Types::ListBucketInventoryConfigurationsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListBucketInventoryConfigurationsOutput#next_continuation_token #next_continuation_token} => String # # @example Request syntax with placeholder values # # resp = client.list_bucket_inventory_configurations({ # bucket: "BucketName", # required # continuation_token: "Token", # }) # # @example Response structure # # resp.continuation_token #=> String # resp.inventory_configuration_list #=> Array # resp.inventory_configuration_list[0].destination.s3_bucket_destination.account_id #=> String # resp.inventory_configuration_list[0].destination.s3_bucket_destination.bucket #=> String # resp.inventory_configuration_list[0].destination.s3_bucket_destination.format #=> String, one of "CSV", "ORC", "Parquet" # resp.inventory_configuration_list[0].destination.s3_bucket_destination.prefix #=> String # resp.inventory_configuration_list[0].destination.s3_bucket_destination.encryption.ssekms.key_id #=> String # resp.inventory_configuration_list[0].is_enabled #=> Boolean # resp.inventory_configuration_list[0].filter.prefix #=> String # resp.inventory_configuration_list[0].id #=> String # resp.inventory_configuration_list[0].included_object_versions #=> String, one of "All", "Current" # resp.inventory_configuration_list[0].optional_fields #=> Array # resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus" # resp.inventory_configuration_list[0].schedule.frequency #=> String, one of "Daily", "Weekly" # resp.is_truncated #=> Boolean # resp.next_continuation_token #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations AWS API Documentation # # @overload list_bucket_inventory_configurations(params = {}) # @param [Hash] params ({}) def list_bucket_inventory_configurations(params = {}, options = {}) req = build_request(:list_bucket_inventory_configurations, params) req.send_request(options) end # Lists the metrics configurations for the bucket. # # @option params [required, String] :bucket # The name of the bucket containing the metrics configurations to # retrieve. # # @option params [String] :continuation_token # The marker that is used to continue a metrics configuration listing # that has been truncated. Use the NextContinuationToken from a # previously truncated list response to continue the listing. The # continuation token is an opaque value that Amazon S3 understands. # # @return [Types::ListBucketMetricsConfigurationsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListBucketMetricsConfigurationsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListBucketMetricsConfigurationsOutput#continuation_token #continuation_token} => String # * {Types::ListBucketMetricsConfigurationsOutput#next_continuation_token #next_continuation_token} => String # * {Types::ListBucketMetricsConfigurationsOutput#metrics_configuration_list #metrics_configuration_list} => Array<Types::MetricsConfiguration> # # @example Request syntax with placeholder values # # resp = client.list_bucket_metrics_configurations({ # bucket: "BucketName", # required # continuation_token: "Token", # }) # # @example Response structure # # resp.is_truncated #=> Boolean # resp.continuation_token #=> String # resp.next_continuation_token #=> String # resp.metrics_configuration_list #=> Array # resp.metrics_configuration_list[0].id #=> String # resp.metrics_configuration_list[0].filter.prefix #=> String # resp.metrics_configuration_list[0].filter.tag.key #=> String # resp.metrics_configuration_list[0].filter.tag.value #=> String # resp.metrics_configuration_list[0].filter.and.prefix #=> String # resp.metrics_configuration_list[0].filter.and.tags #=> Array # resp.metrics_configuration_list[0].filter.and.tags[0].key #=> String # resp.metrics_configuration_list[0].filter.and.tags[0].value #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations AWS API Documentation # # @overload list_bucket_metrics_configurations(params = {}) # @param [Hash] params ({}) def list_bucket_metrics_configurations(params = {}, options = {}) req = build_request(:list_bucket_metrics_configurations, params) req.send_request(options) end # Returns a list of all buckets owned by the authenticated sender of the # request. # # @return [Types::ListBucketsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListBucketsOutput#buckets #buckets} => Array<Types::Bucket> # * {Types::ListBucketsOutput#owner #owner} => Types::Owner # # # @example Example: To list object versions # # # The following example return versions of an object with specific key name prefix. The request limits the number of items # # returned to two. If there are are more than two object version, S3 returns NextToken in the response. You can specify # # this token value in your next request to fetch next set of object versions. # # resp = client.list_buckets({ # }) # # resp.to_h outputs the following: # { # buckets: [ # { # creation_date: Time.parse("2012-02-15T21: 03: 02.000Z"), # name: "examplebucket", # }, # { # creation_date: Time.parse("2011-07-24T19: 33: 50.000Z"), # name: "examplebucket2", # }, # { # creation_date: Time.parse("2010-12-17T00: 56: 49.000Z"), # name: "examplebucket3", # }, # ], # owner: { # display_name: "own-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31", # }, # } # # @example Response structure # # resp.buckets #=> Array # resp.buckets[0].name #=> String # resp.buckets[0].creation_date #=> Time # resp.owner.display_name #=> String # resp.owner.id #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets AWS API Documentation # # @overload list_buckets(params = {}) # @param [Hash] params ({}) def list_buckets(params = {}, options = {}) req = build_request(:list_buckets, params) req.send_request(options) end # This operation lists in-progress multipart uploads. # # @option params [required, String] :bucket # # @option params [String] :delimiter # Character you use to group keys. # # @option params [String] :encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # # @option params [String] :key_marker # Together with upload-id-marker, this parameter specifies the multipart # upload after which listing should begin. # # @option params [Integer] :max_uploads # Sets the maximum number of multipart uploads, from 1 to 1,000, to # return in the response body. 1,000 is the maximum number of uploads # that can be returned in a response. # # @option params [String] :prefix # Lists in-progress uploads only for those keys that begin with the # specified prefix. # # @option params [String] :upload_id_marker # Together with key-marker, specifies the multipart upload after which # listing should begin. If key-marker is not specified, the # upload-id-marker parameter is ignored. # # @return [Types::ListMultipartUploadsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListMultipartUploadsOutput#bucket #bucket} => String # * {Types::ListMultipartUploadsOutput#key_marker #key_marker} => String # * {Types::ListMultipartUploadsOutput#upload_id_marker #upload_id_marker} => String # * {Types::ListMultipartUploadsOutput#next_key_marker #next_key_marker} => String # * {Types::ListMultipartUploadsOutput#prefix #prefix} => String # * {Types::ListMultipartUploadsOutput#delimiter #delimiter} => String # * {Types::ListMultipartUploadsOutput#next_upload_id_marker #next_upload_id_marker} => String # * {Types::ListMultipartUploadsOutput#max_uploads #max_uploads} => Integer # * {Types::ListMultipartUploadsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListMultipartUploadsOutput#uploads #uploads} => Array<Types::MultipartUpload> # * {Types::ListMultipartUploadsOutput#common_prefixes #common_prefixes} => Array<Types::CommonPrefix> # * {Types::ListMultipartUploadsOutput#encoding_type #encoding_type} => String # # # @example Example: List next set of multipart uploads when previous result is truncated # # # The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next # # setup of multipart uploads. # # resp = client.list_multipart_uploads({ # bucket: "examplebucket", # key_marker: "nextkeyfrompreviousresponse", # max_uploads: 2, # upload_id_marker: "valuefrompreviousresponse", # }) # # resp.to_h outputs the following: # { # bucket: "acl1", # is_truncated: true, # key_marker: "", # max_uploads: 2, # next_key_marker: "someobjectkey", # next_upload_id_marker: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--", # upload_id_marker: "", # uploads: [ # { # initiated: Time.parse("2014-05-01T05:40:58.000Z"), # initiator: { # display_name: "ownder-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # key: "JavaFile", # owner: { # display_name: "mohanataws", # id: "852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # storage_class: "STANDARD", # upload_id: "gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--", # }, # { # initiated: Time.parse("2014-05-01T05:41:27.000Z"), # initiator: { # display_name: "ownder-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # key: "JavaFile", # owner: { # display_name: "ownder-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # storage_class: "STANDARD", # upload_id: "b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--", # }, # ], # } # # @example Example: To list in-progress multipart uploads on a bucket # # # The following example lists in-progress multipart uploads on a specific bucket. # # resp = client.list_multipart_uploads({ # bucket: "examplebucket", # }) # # resp.to_h outputs the following: # { # uploads: [ # { # initiated: Time.parse("2014-05-01T05:40:58.000Z"), # initiator: { # display_name: "display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # key: "JavaFile", # owner: { # display_name: "display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # storage_class: "STANDARD", # upload_id: "examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--", # }, # { # initiated: Time.parse("2014-05-01T05:41:27.000Z"), # initiator: { # display_name: "display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # key: "JavaFile", # owner: { # display_name: "display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # storage_class: "STANDARD", # upload_id: "examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--", # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.list_multipart_uploads({ # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # key_marker: "KeyMarker", # max_uploads: 1, # prefix: "Prefix", # upload_id_marker: "UploadIdMarker", # }) # # @example Response structure # # resp.bucket #=> String # resp.key_marker #=> String # resp.upload_id_marker #=> String # resp.next_key_marker #=> String # resp.prefix #=> String # resp.delimiter #=> String # resp.next_upload_id_marker #=> String # resp.max_uploads #=> Integer # resp.is_truncated #=> Boolean # resp.uploads #=> Array # resp.uploads[0].upload_id #=> String # resp.uploads[0].key #=> String # resp.uploads[0].initiated #=> Time # resp.uploads[0].storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE" # resp.uploads[0].owner.display_name #=> String # resp.uploads[0].owner.id #=> String # resp.uploads[0].initiator.id #=> String # resp.uploads[0].initiator.display_name #=> String # resp.common_prefixes #=> Array # resp.common_prefixes[0].prefix #=> String # resp.encoding_type #=> String, one of "url" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads AWS API Documentation # # @overload list_multipart_uploads(params = {}) # @param [Hash] params ({}) def list_multipart_uploads(params = {}, options = {}) req = build_request(:list_multipart_uploads, params) req.send_request(options) end # Returns metadata about all of the versions of objects in a bucket. # # @option params [required, String] :bucket # # @option params [String] :delimiter # A delimiter is a character you use to group keys. # # @option params [String] :encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # # @option params [String] :key_marker # Specifies the key to start with when listing objects in a bucket. # # @option params [Integer] :max_keys # Sets the maximum number of keys returned in the response. The response # might contain fewer keys but will never contain more. # # @option params [String] :prefix # Limits the response to keys that begin with the specified prefix. # # @option params [String] :version_id_marker # Specifies the object version you want to start listing from. # # @return [Types::ListObjectVersionsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListObjectVersionsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListObjectVersionsOutput#key_marker #key_marker} => String # * {Types::ListObjectVersionsOutput#version_id_marker #version_id_marker} => String # * {Types::ListObjectVersionsOutput#next_key_marker #next_key_marker} => String # * {Types::ListObjectVersionsOutput#next_version_id_marker #next_version_id_marker} => String # * {Types::ListObjectVersionsOutput#versions #versions} => Array<Types::ObjectVersion> # * {Types::ListObjectVersionsOutput#delete_markers #delete_markers} => Array<Types::DeleteMarkerEntry> # * {Types::ListObjectVersionsOutput#name #name} => String # * {Types::ListObjectVersionsOutput#prefix #prefix} => String # * {Types::ListObjectVersionsOutput#delimiter #delimiter} => String # * {Types::ListObjectVersionsOutput#max_keys #max_keys} => Integer # * {Types::ListObjectVersionsOutput#common_prefixes #common_prefixes} => Array<Types::CommonPrefix> # * {Types::ListObjectVersionsOutput#encoding_type #encoding_type} => String # # # @example Example: To list object versions # # # The following example return versions of an object with specific key name prefix. The request limits the number of items # # returned to two. If there are are more than two object version, S3 returns NextToken in the response. You can specify # # this token value in your next request to fetch next set of object versions. # # resp = client.list_object_versions({ # bucket: "examplebucket", # prefix: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # versions: [ # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # is_latest: true, # key: "HappyFace.jpg", # last_modified: Time.parse("2016-12-15T01:19:41.000Z"), # owner: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # size: 3191, # storage_class: "STANDARD", # version_id: "null", # }, # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # is_latest: false, # key: "HappyFace.jpg", # last_modified: Time.parse("2016-12-13T00:58:26.000Z"), # owner: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # size: 3191, # storage_class: "STANDARD", # version_id: "PHtexPGjH2y.zBgT8LmB7wwLI2mpbz.k", # }, # ], # } # # @example Request syntax with placeholder values # # resp = client.list_object_versions({ # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # key_marker: "KeyMarker", # max_keys: 1, # prefix: "Prefix", # version_id_marker: "VersionIdMarker", # }) # # @example Response structure # # resp.is_truncated #=> Boolean # resp.key_marker #=> String # resp.version_id_marker #=> String # resp.next_key_marker #=> String # resp.next_version_id_marker #=> String # resp.versions #=> Array # resp.versions[0].etag #=> String # resp.versions[0].size #=> Integer # resp.versions[0].storage_class #=> String, one of "STANDARD" # resp.versions[0].key #=> String # resp.versions[0].version_id #=> String # resp.versions[0].is_latest #=> Boolean # resp.versions[0].last_modified #=> Time # resp.versions[0].owner.display_name #=> String # resp.versions[0].owner.id #=> String # resp.delete_markers #=> Array # resp.delete_markers[0].owner.display_name #=> String # resp.delete_markers[0].owner.id #=> String # resp.delete_markers[0].key #=> String # resp.delete_markers[0].version_id #=> String # resp.delete_markers[0].is_latest #=> Boolean # resp.delete_markers[0].last_modified #=> Time # resp.name #=> String # resp.prefix #=> String # resp.delimiter #=> String # resp.max_keys #=> Integer # resp.common_prefixes #=> Array # resp.common_prefixes[0].prefix #=> String # resp.encoding_type #=> String, one of "url" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions AWS API Documentation # # @overload list_object_versions(params = {}) # @param [Hash] params ({}) def list_object_versions(params = {}, options = {}) req = build_request(:list_object_versions, params) req.send_request(options) end # Returns some or all (up to 1000) of the objects in a bucket. You can # use the request parameters as selection criteria to return a subset of # the objects in a bucket. # # @option params [required, String] :bucket # # @option params [String] :delimiter # A delimiter is a character you use to group keys. # # @option params [String] :encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # # @option params [String] :marker # Specifies the key to start with when listing objects in a bucket. # # @option params [Integer] :max_keys # Sets the maximum number of keys returned in the response. The response # might contain fewer keys but will never contain more. # # @option params [String] :prefix # Limits the response to keys that begin with the specified prefix. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the list objects request. Bucket owners need not specify this # parameter in their requests. # # @return [Types::ListObjectsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListObjectsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListObjectsOutput#marker #marker} => String # * {Types::ListObjectsOutput#next_marker #next_marker} => String # * {Types::ListObjectsOutput#contents #contents} => Array<Types::Object> # * {Types::ListObjectsOutput#name #name} => String # * {Types::ListObjectsOutput#prefix #prefix} => String # * {Types::ListObjectsOutput#delimiter #delimiter} => String # * {Types::ListObjectsOutput#max_keys #max_keys} => Integer # * {Types::ListObjectsOutput#common_prefixes #common_prefixes} => Array<Types::CommonPrefix> # * {Types::ListObjectsOutput#encoding_type #encoding_type} => String # # # @example Example: To list objects in a bucket # # # The following example list two objects in a bucket. # # resp = client.list_objects({ # bucket: "examplebucket", # max_keys: 2, # }) # # resp.to_h outputs the following: # { # contents: [ # { # etag: "\"70ee1738b6b21e2c8a43f3a5ab0eee71\"", # key: "example1.jpg", # last_modified: Time.parse("2014-11-21T19:40:05.000Z"), # owner: { # display_name: "myname", # id: "12345example25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # size: 11, # storage_class: "STANDARD", # }, # { # etag: "\"9c8af9a76df052144598c115ef33e511\"", # key: "example2.jpg", # last_modified: Time.parse("2013-11-15T01:10:49.000Z"), # owner: { # display_name: "myname", # id: "12345example25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # size: 713193, # storage_class: "STANDARD", # }, # ], # next_marker: "eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ==", # } # # @example Request syntax with placeholder values # # resp = client.list_objects({ # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # marker: "Marker", # max_keys: 1, # prefix: "Prefix", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.is_truncated #=> Boolean # resp.marker #=> String # resp.next_marker #=> String # resp.contents #=> Array # resp.contents[0].key #=> String # resp.contents[0].last_modified #=> Time # resp.contents[0].etag #=> String # resp.contents[0].size #=> Integer # resp.contents[0].storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE" # resp.contents[0].owner.display_name #=> String # resp.contents[0].owner.id #=> String # resp.name #=> String # resp.prefix #=> String # resp.delimiter #=> String # resp.max_keys #=> Integer # resp.common_prefixes #=> Array # resp.common_prefixes[0].prefix #=> String # resp.encoding_type #=> String, one of "url" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects AWS API Documentation # # @overload list_objects(params = {}) # @param [Hash] params ({}) def list_objects(params = {}, options = {}) req = build_request(:list_objects, params) req.send_request(options) end # Returns some or all (up to 1000) of the objects in a bucket. You can # use the request parameters as selection criteria to return a subset of # the objects in a bucket. Note: ListObjectsV2 is the revised List # Objects API and we recommend you use this revised API for new # application development. # # @option params [required, String] :bucket # Name of the bucket to list. # # @option params [String] :delimiter # A delimiter is a character you use to group keys. # # @option params [String] :encoding_type # Encoding type used by Amazon S3 to encode object keys in the response. # # @option params [Integer] :max_keys # Sets the maximum number of keys returned in the response. The response # might contain fewer keys but will never contain more. # # @option params [String] :prefix # Limits the response to keys that begin with the specified prefix. # # @option params [String] :continuation_token # ContinuationToken indicates Amazon S3 that the list is being continued # on this bucket with a token. ContinuationToken is obfuscated and is # not a real key # # @option params [Boolean] :fetch_owner # The owner field is not present in listV2 by default, if you want to # return owner field with each key in the result then set the fetch # owner field to true # # @option params [String] :start_after # StartAfter is where you want Amazon S3 to start listing from. Amazon # S3 starts listing after this specified key. StartAfter can be any key # in the bucket # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the list objects request in V2 style. Bucket owners need not specify # this parameter in their requests. # # @return [Types::ListObjectsV2Output] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListObjectsV2Output#is_truncated #is_truncated} => Boolean # * {Types::ListObjectsV2Output#contents #contents} => Array<Types::Object> # * {Types::ListObjectsV2Output#name #name} => String # * {Types::ListObjectsV2Output#prefix #prefix} => String # * {Types::ListObjectsV2Output#delimiter #delimiter} => String # * {Types::ListObjectsV2Output#max_keys #max_keys} => Integer # * {Types::ListObjectsV2Output#common_prefixes #common_prefixes} => Array<Types::CommonPrefix> # * {Types::ListObjectsV2Output#encoding_type #encoding_type} => String # * {Types::ListObjectsV2Output#key_count #key_count} => Integer # * {Types::ListObjectsV2Output#continuation_token #continuation_token} => String # * {Types::ListObjectsV2Output#next_continuation_token #next_continuation_token} => String # * {Types::ListObjectsV2Output#start_after #start_after} => String # # # @example Example: To get object list # # # The following example retrieves object list. The request specifies max keys to limit response to include only 2 object # # keys. # # resp = client.list_objects_v2({ # bucket: "examplebucket", # max_keys: 2, # }) # # resp.to_h outputs the following: # { # contents: [ # { # etag: "\"70ee1738b6b21e2c8a43f3a5ab0eee71\"", # key: "happyface.jpg", # last_modified: Time.parse("2014-11-21T19:40:05.000Z"), # size: 11, # storage_class: "STANDARD", # }, # { # etag: "\"becf17f89c30367a9a44495d62ed521a-1\"", # key: "test.jpg", # last_modified: Time.parse("2014-05-02T04:51:50.000Z"), # size: 4192256, # storage_class: "STANDARD", # }, # ], # is_truncated: true, # key_count: 2, # max_keys: 2, # name: "examplebucket", # next_continuation_token: "1w41l63U0xa8q7smH50vCxyTQqdxo69O3EmK28Bi5PcROI4wI/EyIJg==", # prefix: "", # } # # @example Request syntax with placeholder values # # resp = client.list_objects_v2({ # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # max_keys: 1, # prefix: "Prefix", # continuation_token: "Token", # fetch_owner: false, # start_after: "StartAfter", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.is_truncated #=> Boolean # resp.contents #=> Array # resp.contents[0].key #=> String # resp.contents[0].last_modified #=> Time # resp.contents[0].etag #=> String # resp.contents[0].size #=> Integer # resp.contents[0].storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE" # resp.contents[0].owner.display_name #=> String # resp.contents[0].owner.id #=> String # resp.name #=> String # resp.prefix #=> String # resp.delimiter #=> String # resp.max_keys #=> Integer # resp.common_prefixes #=> Array # resp.common_prefixes[0].prefix #=> String # resp.encoding_type #=> String, one of "url" # resp.key_count #=> Integer # resp.continuation_token #=> String # resp.next_continuation_token #=> String # resp.start_after #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 AWS API Documentation # # @overload list_objects_v2(params = {}) # @param [Hash] params ({}) def list_objects_v2(params = {}, options = {}) req = build_request(:list_objects_v2, params) req.send_request(options) end # Lists the parts that have been uploaded for a specific multipart # upload. # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [Integer] :max_parts # Sets the maximum number of parts to return. # # @option params [Integer] :part_number_marker # Specifies the part after which listing should begin. Only parts with # higher part numbers will be listed. # # @option params [required, String] :upload_id # Upload ID identifying the multipart upload whose parts are being # listed. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::ListPartsOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::ListPartsOutput#abort_date #abort_date} => Time # * {Types::ListPartsOutput#abort_rule_id #abort_rule_id} => String # * {Types::ListPartsOutput#bucket #bucket} => String # * {Types::ListPartsOutput#key #key} => String # * {Types::ListPartsOutput#upload_id #upload_id} => String # * {Types::ListPartsOutput#part_number_marker #part_number_marker} => Integer # * {Types::ListPartsOutput#next_part_number_marker #next_part_number_marker} => Integer # * {Types::ListPartsOutput#max_parts #max_parts} => Integer # * {Types::ListPartsOutput#is_truncated #is_truncated} => Boolean # * {Types::ListPartsOutput#parts #parts} => Array<Types::Part> # * {Types::ListPartsOutput#initiator #initiator} => Types::Initiator # * {Types::ListPartsOutput#owner #owner} => Types::Owner # * {Types::ListPartsOutput#storage_class #storage_class} => String # * {Types::ListPartsOutput#request_charged #request_charged} => String # # # @example Example: To list parts of a multipart upload. # # # The following example lists parts uploaded for a specific multipart upload. # # resp = client.list_parts({ # bucket: "examplebucket", # key: "bigobject", # upload_id: "example7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--", # }) # # resp.to_h outputs the following: # { # initiator: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # owner: { # display_name: "owner-display-name", # id: "examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc", # }, # parts: [ # { # etag: "\"d8c2eafd90c266e19ab9dcacc479f8af\"", # last_modified: Time.parse("2016-12-16T00:11:42.000Z"), # part_number: 1, # size: 26246026, # }, # { # etag: "\"d8c2eafd90c266e19ab9dcacc479f8af\"", # last_modified: Time.parse("2016-12-16T00:15:01.000Z"), # part_number: 2, # size: 26246026, # }, # ], # storage_class: "STANDARD", # } # # @example Request syntax with placeholder values # # resp = client.list_parts({ # bucket: "BucketName", # required # key: "ObjectKey", # required # max_parts: 1, # part_number_marker: 1, # upload_id: "MultipartUploadId", # required # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.abort_date #=> Time # resp.abort_rule_id #=> String # resp.bucket #=> String # resp.key #=> String # resp.upload_id #=> String # resp.part_number_marker #=> Integer # resp.next_part_number_marker #=> Integer # resp.max_parts #=> Integer # resp.is_truncated #=> Boolean # resp.parts #=> Array # resp.parts[0].part_number #=> Integer # resp.parts[0].last_modified #=> Time # resp.parts[0].etag #=> String # resp.parts[0].size #=> Integer # resp.initiator.id #=> String # resp.initiator.display_name #=> String # resp.owner.display_name #=> String # resp.owner.id #=> String # resp.storage_class #=> String, one of "STANDARD", "REDUCED_REDUNDANCY", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER", "DEEP_ARCHIVE" # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts AWS API Documentation # # @overload list_parts(params = {}) # @param [Hash] params ({}) def list_parts(params = {}, options = {}) req = build_request(:list_parts, params) req.send_request(options) end # Sets the accelerate configuration of an existing bucket. # # @option params [required, String] :bucket # Name of the bucket for which the accelerate configuration is set. # # @option params [required, Types::AccelerateConfiguration] :accelerate_configuration # Specifies the Accelerate Configuration you want to set for the bucket. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_accelerate_configuration({ # bucket: "BucketName", # required # accelerate_configuration: { # required # status: "Enabled", # accepts Enabled, Suspended # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration AWS API Documentation # # @overload put_bucket_accelerate_configuration(params = {}) # @param [Hash] params ({}) def put_bucket_accelerate_configuration(params = {}, options = {}) req = build_request(:put_bucket_accelerate_configuration, params) req.send_request(options) end # Sets the permissions on a bucket using access control lists (ACL). # # @option params [String] :acl # The canned ACL to apply to the bucket. # # @option params [Types::AccessControlPolicy] :access_control_policy # Contains the elements that set the ACL permissions for an object per # grantee. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # # @option params [String] :grant_read # Allows grantee to list the objects in the bucket. # # @option params [String] :grant_read_acp # Allows grantee to read the bucket ACL. # # @option params [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # # @option params [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Put bucket acl # # # The following example replaces existing ACL on a bucket. The ACL grants the bucket owner (specified using the owner ID) # # and write permission to the LogDelivery group. Because this is a replace operation, you must specify all the grants in # # your request. To incrementally add or remove ACL grants, you might use the console. # # resp = client.put_bucket_acl({ # bucket: "examplebucket", # grant_full_control: "id=examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484", # grant_write: "uri=http://acs.amazonaws.com/groups/s3/LogDelivery", # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_acl({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # access_control_policy: { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # }, # bucket: "BucketName", # required # content_md5: "ContentMD5", # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl AWS API Documentation # # @overload put_bucket_acl(params = {}) # @param [Hash] params ({}) def put_bucket_acl(params = {}, options = {}) req = build_request(:put_bucket_acl, params) req.send_request(options) end # Sets an analytics configuration for the bucket (specified by the # analytics configuration ID). # # @option params [required, String] :bucket # The name of the bucket to which an analytics configuration is stored. # # @option params [required, String] :id # The ID that identifies the analytics configuration. # # @option params [required, Types::AnalyticsConfiguration] :analytics_configuration # The configuration and any analyses for the analytics filter. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_analytics_configuration({ # bucket: "BucketName", # required # id: "AnalyticsId", # required # analytics_configuration: { # required # id: "AnalyticsId", # required # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # storage_class_analysis: { # required # data_export: { # output_schema_version: "V_1", # required, accepts V_1 # destination: { # required # s3_bucket_destination: { # required # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # }, # }, # }, # }, # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration AWS API Documentation # # @overload put_bucket_analytics_configuration(params = {}) # @param [Hash] params ({}) def put_bucket_analytics_configuration(params = {}, options = {}) req = build_request(:put_bucket_analytics_configuration, params) req.send_request(options) end # Sets the CORS configuration for a bucket. # # @option params [required, String] :bucket # # @option params [required, Types::CORSConfiguration] :cors_configuration # # @option params [String] :content_md5 # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: To set cors configuration on a bucket. # # # The following example enables PUT, POST, and DELETE requests from www.example.com, and enables GET requests from any # # domain. # # resp = client.put_bucket_cors({ # bucket: "", # cors_configuration: { # cors_rules: [ # { # allowed_headers: [ # "*", # ], # allowed_methods: [ # "PUT", # "POST", # "DELETE", # ], # allowed_origins: [ # "http://www.example.com", # ], # expose_headers: [ # "x-amz-server-side-encryption", # ], # max_age_seconds: 3000, # }, # { # allowed_headers: [ # "Authorization", # ], # allowed_methods: [ # "GET", # ], # allowed_origins: [ # "*", # ], # max_age_seconds: 3000, # }, # ], # }, # content_md5: "", # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_cors({ # bucket: "BucketName", # required # cors_configuration: { # required # cors_rules: [ # required # { # allowed_headers: ["AllowedHeader"], # allowed_methods: ["AllowedMethod"], # required # allowed_origins: ["AllowedOrigin"], # required # expose_headers: ["ExposeHeader"], # max_age_seconds: 1, # }, # ], # }, # content_md5: "ContentMD5", # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors AWS API Documentation # # @overload put_bucket_cors(params = {}) # @param [Hash] params ({}) def put_bucket_cors(params = {}, options = {}) req = build_request(:put_bucket_cors, params) req.send_request(options) end # Creates a new server-side encryption configuration (or replaces an # existing one, if present). # # @option params [required, String] :bucket # Specifies default encryption for a bucket using server-side encryption # with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys # (SSE-KMS). For information about the Amazon S3 default encryption # feature, see [Amazon S3 Default Bucket Encryption][1] in the *Amazon # Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html # # @option params [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the server-side encryption # configuration. This parameter is auto-populated when using the command # from the CLI. # # @option params [required, Types::ServerSideEncryptionConfiguration] :server_side_encryption_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_encryption({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # server_side_encryption_configuration: { # required # rules: [ # required # { # apply_server_side_encryption_by_default: { # sse_algorithm: "AES256", # required, accepts AES256, aws:kms # kms_master_key_id: "SSEKMSKeyId", # }, # }, # ], # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketEncryption AWS API Documentation # # @overload put_bucket_encryption(params = {}) # @param [Hash] params ({}) def put_bucket_encryption(params = {}, options = {}) req = build_request(:put_bucket_encryption, params) req.send_request(options) end # Adds an inventory configuration (identified by the inventory ID) from # the bucket. # # @option params [required, String] :bucket # The name of the bucket where the inventory configuration will be # stored. # # @option params [required, String] :id # The ID used to identify the inventory configuration. # # @option params [required, Types::InventoryConfiguration] :inventory_configuration # Specifies the inventory configuration. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_inventory_configuration({ # bucket: "BucketName", # required # id: "InventoryId", # required # inventory_configuration: { # required # destination: { # required # s3_bucket_destination: { # required # account_id: "AccountId", # bucket: "BucketName", # required # format: "CSV", # required, accepts CSV, ORC, Parquet # prefix: "Prefix", # encryption: { # sses3: { # }, # ssekms: { # key_id: "SSEKMSKeyId", # required # }, # }, # }, # }, # is_enabled: false, # required # filter: { # prefix: "Prefix", # required # }, # id: "InventoryId", # required # included_object_versions: "All", # required, accepts All, Current # optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus # schedule: { # required # frequency: "Daily", # required, accepts Daily, Weekly # }, # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration AWS API Documentation # # @overload put_bucket_inventory_configuration(params = {}) # @param [Hash] params ({}) def put_bucket_inventory_configuration(params = {}, options = {}) req = build_request(:put_bucket_inventory_configuration, params) req.send_request(options) end # No longer used, see the PutBucketLifecycleConfiguration operation. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [Types::LifecycleConfiguration] :lifecycle_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_lifecycle({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # lifecycle_configuration: { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # required # status: "Enabled", # required, accepts Enabled, Disabled # transition: { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_transition: { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle AWS API Documentation # # @overload put_bucket_lifecycle(params = {}) # @param [Hash] params ({}) def put_bucket_lifecycle(params = {}, options = {}) req = build_request(:put_bucket_lifecycle, params) req.send_request(options) end # Sets lifecycle configuration for your bucket. If a lifecycle # configuration exists, it replaces it. # # @option params [required, String] :bucket # # @option params [Types::BucketLifecycleConfiguration] :lifecycle_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Put bucket lifecycle # # # The following example replaces existing lifecycle configuration, if any, on the specified bucket. # # resp = client.put_bucket_lifecycle_configuration({ # bucket: "examplebucket", # lifecycle_configuration: { # rules: [ # { # expiration: { # days: 3650, # }, # filter: { # prefix: "documents/", # }, # id: "TestOnly", # status: "Enabled", # transitions: [ # { # days: 365, # storage_class: "GLACIER", # }, # ], # }, # ], # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_lifecycle_configuration({ # bucket: "BucketName", # required # lifecycle_configuration: { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # transitions: [ # { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_transitions: [ # { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration AWS API Documentation # # @overload put_bucket_lifecycle_configuration(params = {}) # @param [Hash] params ({}) def put_bucket_lifecycle_configuration(params = {}, options = {}) req = build_request(:put_bucket_lifecycle_configuration, params) req.send_request(options) end # Set the logging parameters for a bucket and to specify permissions for # who can view and modify the logging parameters. To set the logging # status of a bucket, you must be the bucket owner. # # @option params [required, String] :bucket # # @option params [required, Types::BucketLoggingStatus] :bucket_logging_status # # @option params [String] :content_md5 # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set logging configuration for a bucket # # # The following example sets logging policy on a bucket. For the Log Delivery group to deliver logs to the destination # # bucket, it needs permission for the READ_ACP action which the policy grants. # # resp = client.put_bucket_logging({ # bucket: "sourcebucket", # bucket_logging_status: { # logging_enabled: { # target_bucket: "targetbucket", # target_grants: [ # { # grantee: { # type: "Group", # uri: "http://acs.amazonaws.com/groups/global/AllUsers", # }, # permission: "READ", # }, # ], # target_prefix: "MyBucketLogs/", # }, # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_logging({ # bucket: "BucketName", # required # bucket_logging_status: { # required # logging_enabled: { # target_bucket: "TargetBucket", # required # target_grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE # }, # ], # target_prefix: "TargetPrefix", # required # }, # }, # content_md5: "ContentMD5", # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging AWS API Documentation # # @overload put_bucket_logging(params = {}) # @param [Hash] params ({}) def put_bucket_logging(params = {}, options = {}) req = build_request(:put_bucket_logging, params) req.send_request(options) end # Sets a metrics configuration (specified by the metrics configuration # ID) for the bucket. # # @option params [required, String] :bucket # The name of the bucket for which the metrics configuration is set. # # @option params [required, String] :id # The ID used to identify the metrics configuration. # # @option params [required, Types::MetricsConfiguration] :metrics_configuration # Specifies the metrics configuration. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_metrics_configuration({ # bucket: "BucketName", # required # id: "MetricsId", # required # metrics_configuration: { # required # id: "MetricsId", # required # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration AWS API Documentation # # @overload put_bucket_metrics_configuration(params = {}) # @param [Hash] params ({}) def put_bucket_metrics_configuration(params = {}, options = {}) req = build_request(:put_bucket_metrics_configuration, params) req.send_request(options) end # No longer used, see the PutBucketNotificationConfiguration operation. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [required, Types::NotificationConfigurationDeprecated] :notification_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_bucket_notification({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # notification_configuration: { # required # topic_configuration: { # id: "NotificationId", # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # topic: "TopicArn", # }, # queue_configuration: { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # queue: "QueueArn", # }, # cloud_function_configuration: { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # cloud_function: "CloudFunction", # invocation_role: "CloudFunctionInvocationRole", # }, # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification AWS API Documentation # # @overload put_bucket_notification(params = {}) # @param [Hash] params ({}) def put_bucket_notification(params = {}, options = {}) req = build_request(:put_bucket_notification, params) req.send_request(options) end # Enables notifications of specified events for a bucket. # # @option params [required, String] :bucket # # @option params [required, Types::NotificationConfiguration] :notification_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set notification configuration for a bucket # # # The following example sets notification configuration on a bucket to publish the object created events to an SNS topic. # # resp = client.put_bucket_notification_configuration({ # bucket: "examplebucket", # notification_configuration: { # topic_configurations: [ # { # events: [ # "s3:ObjectCreated:*", # ], # topic_arn: "arn:aws:sns:us-west-2:123456789012:s3-notification-topic", # }, # ], # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_notification_configuration({ # bucket: "BucketName", # required # notification_configuration: { # required # topic_configurations: [ # { # id: "NotificationId", # topic_arn: "TopicArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # queue_configurations: [ # { # id: "NotificationId", # queue_arn: "QueueArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # lambda_function_configurations: [ # { # id: "NotificationId", # lambda_function_arn: "LambdaFunctionArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration AWS API Documentation # # @overload put_bucket_notification_configuration(params = {}) # @param [Hash] params ({}) def put_bucket_notification_configuration(params = {}, options = {}) req = build_request(:put_bucket_notification_configuration, params) req.send_request(options) end # Applies an Amazon S3 bucket policy to an Amazon S3 bucket. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [Boolean] :confirm_remove_self_bucket_access # Set this parameter to true to confirm that you want to remove your # permissions to change this bucket policy in the future. # # @option params [required, String] :policy # The bucket policy as a JSON document. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set bucket policy # # # The following example sets a permission policy on a bucket. # # resp = client.put_bucket_policy({ # bucket: "examplebucket", # policy: "{\"Version\": \"2012-10-17\", \"Statement\": [{ \"Sid\": \"id-1\",\"Effect\": \"Allow\",\"Principal\": {\"AWS\": \"arn:aws:iam::123456789012:root\"}, \"Action\": [ \"s3:PutObject\",\"s3:PutObjectAcl\"], \"Resource\": [\"arn:aws:s3:::acl3/*\" ] } ]}", # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_policy({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # confirm_remove_self_bucket_access: false, # policy: "Policy", # required # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy AWS API Documentation # # @overload put_bucket_policy(params = {}) # @param [Hash] params ({}) def put_bucket_policy(params = {}, options = {}) req = build_request(:put_bucket_policy, params) req.send_request(options) end # Creates a replication configuration or replaces an existing one. For # more information, see [Cross-Region Replication (CRR)][1] in the # *Amazon S3 Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html # # @option params [required, String] :bucket # # @option params [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the data. You must use this # header as a message integrity check to verify that the request body # was not corrupted in transit. # # @option params [required, Types::ReplicationConfiguration] :replication_configuration # # @option params [String] :token # A token that allows Amazon S3 object lock to be enabled for an # existing bucket. # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set replication configuration on a bucket # # # The following example sets replication configuration on a bucket. # # resp = client.put_bucket_replication({ # bucket: "examplebucket", # replication_configuration: { # role: "arn:aws:iam::123456789012:role/examplerole", # rules: [ # { # destination: { # bucket: "arn:aws:s3:::destinationbucket", # storage_class: "STANDARD", # }, # prefix: "", # status: "Enabled", # }, # ], # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_replication({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # replication_configuration: { # required # role: "Role", # required # rules: [ # required # { # id: "ID", # priority: 1, # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # source_selection_criteria: { # sse_kms_encrypted_objects: { # status: "Enabled", # required, accepts Enabled, Disabled # }, # }, # destination: { # required # bucket: "BucketName", # required # account: "AccountId", # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # access_control_translation: { # owner: "Destination", # required, accepts Destination # }, # encryption_configuration: { # replica_kms_key_id: "ReplicaKmsKeyID", # }, # }, # delete_marker_replication: { # status: "Enabled", # accepts Enabled, Disabled # }, # }, # ], # }, # token: "ObjectLockToken", # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication AWS API Documentation # # @overload put_bucket_replication(params = {}) # @param [Hash] params ({}) def put_bucket_replication(params = {}, options = {}) req = build_request(:put_bucket_replication, params) req.send_request(options) end # Sets the request payment configuration for a bucket. By default, the # bucket owner pays for downloads from the bucket. This configuration # parameter enables the bucket owner (only) to specify that the person # requesting the download will be charged for the download. # Documentation on requester pays buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [required, Types::RequestPaymentConfiguration] :request_payment_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set request payment configuration on a bucket. # # # The following example sets request payment configuration on a bucket so that person requesting the download is charged. # # resp = client.put_bucket_request_payment({ # bucket: "examplebucket", # request_payment_configuration: { # payer: "Requester", # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_request_payment({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # request_payment_configuration: { # required # payer: "Requester", # required, accepts Requester, BucketOwner # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment AWS API Documentation # # @overload put_bucket_request_payment(params = {}) # @param [Hash] params ({}) def put_bucket_request_payment(params = {}, options = {}) req = build_request(:put_bucket_request_payment, params) req.send_request(options) end # Sets the tags for a bucket. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [required, Types::Tagging] :tagging # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set tags on a bucket # # # The following example sets tags on a bucket. Any existing tags are replaced. # # resp = client.put_bucket_tagging({ # bucket: "examplebucket", # tagging: { # tag_set: [ # { # key: "Key1", # value: "Value1", # }, # { # key: "Key2", # value: "Value2", # }, # ], # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_tagging({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # tagging: { # required # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging AWS API Documentation # # @overload put_bucket_tagging(params = {}) # @param [Hash] params ({}) def put_bucket_tagging(params = {}, options = {}) req = build_request(:put_bucket_tagging, params) req.send_request(options) end # Sets the versioning state of an existing bucket. To set the versioning # state, you must be the bucket owner. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # # @option params [required, Types::VersioningConfiguration] :versioning_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set versioning configuration on a bucket # # # The following example sets versioning configuration on bucket. The configuration enables versioning on the bucket. # # resp = client.put_bucket_versioning({ # bucket: "examplebucket", # versioning_configuration: { # mfa_delete: "Disabled", # status: "Enabled", # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_versioning({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # mfa: "MFA", # versioning_configuration: { # required # mfa_delete: "Enabled", # accepts Enabled, Disabled # status: "Enabled", # accepts Enabled, Suspended # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning AWS API Documentation # # @overload put_bucket_versioning(params = {}) # @param [Hash] params ({}) def put_bucket_versioning(params = {}, options = {}) req = build_request(:put_bucket_versioning, params) req.send_request(options) end # Set the website configuration for a bucket. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [required, Types::WebsiteConfiguration] :website_configuration # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # # @example Example: Set website configuration on a bucket # # # The following example adds website configuration to a bucket. # # resp = client.put_bucket_website({ # bucket: "examplebucket", # content_md5: "", # website_configuration: { # error_document: { # key: "error.html", # }, # index_document: { # suffix: "index.html", # }, # }, # }) # # @example Request syntax with placeholder values # # resp = client.put_bucket_website({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # website_configuration: { # required # error_document: { # key: "ObjectKey", # required # }, # index_document: { # suffix: "Suffix", # required # }, # redirect_all_requests_to: { # host_name: "HostName", # required # protocol: "http", # accepts http, https # }, # routing_rules: [ # { # condition: { # http_error_code_returned_equals: "HttpErrorCodeReturnedEquals", # key_prefix_equals: "KeyPrefixEquals", # }, # redirect: { # required # host_name: "HostName", # http_redirect_code: "HttpRedirectCode", # protocol: "http", # accepts http, https # replace_key_prefix_with: "ReplaceKeyPrefixWith", # replace_key_with: "ReplaceKeyWith", # }, # }, # ], # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite AWS API Documentation # # @overload put_bucket_website(params = {}) # @param [Hash] params ({}) def put_bucket_website(params = {}, options = {}) req = build_request(:put_bucket_website, params) req.send_request(options) end # Adds an object to a bucket. # # @option params [String] :acl # The canned ACL to apply to the object. # # @option params [String, IO] :body # Object data. # # @option params [required, String] :bucket # Name of the bucket to which the PUT operation was initiated. # # @option params [String] :cache_control # Specifies caching behavior along the request/reply chain. # # @option params [String] :content_disposition # Specifies presentational information for the object. # # @option params [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # # @option params [String] :content_language # The language the content is in. # # @option params [Integer] :content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # # @option params [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This parameter # is auto-populated when using the command from the CLI. This parameted # is required if object lock parameters are specified. # # @option params [String] :content_type # A standard MIME type describing the format of the object data. # # @option params [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # # @option params [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # # @option params [String] :grant_read # Allows grantee to read the object data and its metadata. # # @option params [String] :grant_read_acp # Allows grantee to read the object ACL. # # @option params [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # # @option params [required, String] :key # Object key for which the PUT operation was initiated. # # @option params [Hash] :metadata # A map of metadata to store with the object in S3. # # @option params [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # # @option params [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # # @option params [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # # @option params [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters. (For example, "Key1=Value1") # # @option params [String] :object_lock_mode # The object lock mode that you want to apply to this object. # # @option params [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want this object's object lock to expire. # # @option params [String] :object_lock_legal_hold_status # The Legal Hold status that you want to apply to the specified object. # # @return [Types::PutObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::PutObjectOutput#expiration #expiration} => String # * {Types::PutObjectOutput#etag #etag} => String # * {Types::PutObjectOutput#server_side_encryption #server_side_encryption} => String # * {Types::PutObjectOutput#version_id #version_id} => String # * {Types::PutObjectOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::PutObjectOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::PutObjectOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::PutObjectOutput#ssekms_encryption_context #ssekms_encryption_context} => String # * {Types::PutObjectOutput#request_charged #request_charged} => String # # # @example Example: To upload an object and specify canned ACL. # # # The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ # # access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. # # resp = client.put_object({ # acl: "authenticated-read", # body: "filetoupload", # bucket: "examplebucket", # key: "exampleobject", # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr", # } # # @example Example: To upload an object and specify optional tags # # # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore # # S3 returns version ID of the newly created object. # # resp = client.put_object({ # body: "c:\\HappyFace.jpg", # bucket: "examplebucket", # key: "HappyFace.jpg", # tagging: "key1=value1&key2=value2", # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a", # } # # @example Example: To upload object and specify user-defined metadata # # # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning # # enabled, S3 returns version ID in response. # # resp = client.put_object({ # body: "filetoupload", # bucket: "examplebucket", # key: "exampleobject", # metadata: { # "metadata1" => "value1", # "metadata2" => "value2", # }, # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0", # } # # @example Example: To upload an object and specify server-side encryption and object tags # # # The following example uploads and object. The request specifies the optional server-side encryption option. The request # # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. # # resp = client.put_object({ # body: "filetoupload", # bucket: "examplebucket", # key: "exampleobject", # server_side_encryption: "AES256", # tagging: "key1=value1&key2=value2", # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # server_side_encryption: "AES256", # version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt", # } # # @example Example: To create an object. # # # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response. # # resp = client.put_object({ # body: "filetoupload", # bucket: "examplebucket", # key: "objectkey", # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ", # } # # @example Example: To upload an object # # # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file # # syntax. S3 returns VersionId of the newly created object. # # resp = client.put_object({ # body: "HappyFace.jpg", # bucket: "examplebucket", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk", # } # # @example Example: To upload an object (specify optional headers) # # # The following example uploads an object. The request specifies optional request headers to directs S3 to use specific # # storage class and use server-side encryption. # # resp = client.put_object({ # body: "HappyFace.jpg", # bucket: "examplebucket", # key: "HappyFace.jpg", # server_side_encryption: "AES256", # storage_class: "STANDARD_IA", # }) # # resp.to_h outputs the following: # { # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"", # server_side_encryption: "AES256", # version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp", # } # # @example Streaming a file from disk # # upload file from disk in a single request, may not exceed 5GB # File.open('/source/file/path', 'rb') do |file| # s3.put_object(bucket: 'bucket-name', key: 'object-key', body: file) # end # # @example Request syntax with placeholder values # # resp = client.put_object({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # body: source_file, # bucket: "BucketName", # required # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_length: 1, # content_md5: "ContentMD5", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # # @example Response structure # # resp.expiration #=> String # resp.etag #=> String # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.version_id #=> String # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.ssekms_encryption_context #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject AWS API Documentation # # @overload put_object(params = {}) # @param [Hash] params ({}) def put_object(params = {}, options = {}) req = build_request(:put_object, params) req.send_request(options) end # uses the acl subresource to set the access control list (ACL) # permissions for an object that already exists in a bucket # # @option params [String] :acl # The canned ACL to apply to the object. # # @option params [Types::AccessControlPolicy] :access_control_policy # Contains the elements that set the ACL permissions for an object per # grantee. # # @option params [required, String] :bucket # # @option params [String] :content_md5 # # @option params [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # # @option params [String] :grant_read # Allows grantee to list the objects in the bucket. # # @option params [String] :grant_read_acp # Allows grantee to read the bucket ACL. # # @option params [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # # @option params [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # # @option params [required, String] :key # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :version_id # VersionId used to reference a specific version of the object. # # @return [Types::PutObjectAclOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::PutObjectAclOutput#request_charged #request_charged} => String # # # @example Example: To grant permissions using object ACL # # # The following example adds grants to an object ACL. The first permission grants user1 and user2 FULL_CONTROL and the # # AllUsers group READ permission. # # resp = client.put_object_acl({ # access_control_policy: { # }, # bucket: "examplebucket", # grant_full_control: "emailaddress=user1@example.com,emailaddress=user2@example.com", # grant_read: "uri=http://acs.amazonaws.com/groups/global/AllUsers", # key: "HappyFace.jpg", # }) # # resp.to_h outputs the following: # { # } # # @example Request syntax with placeholder values # # resp = client.put_object_acl({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_policy: { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # }, # bucket: "BucketName", # required # content_md5: "ContentMD5", # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # }) # # @example Response structure # # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl AWS API Documentation # # @overload put_object_acl(params = {}) # @param [Hash] params ({}) def put_object_acl(params = {}, options = {}) req = build_request(:put_object_acl, params) req.send_request(options) end # Applies a Legal Hold configuration to the specified object. # # @option params [required, String] :bucket # The bucket containing the object that you want to place a Legal Hold # on. # # @option params [required, String] :key # The key name for the object that you want to place a Legal Hold on. # # @option params [Types::ObjectLockLegalHold] :legal_hold # Container element for the Legal Hold configuration you want to apply # to the specified object. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :version_id # The version ID of the object that you want to place a Legal Hold on. # # @option params [String] :content_md5 # The MD5 hash for the request body. # # @return [Types::PutObjectLegalHoldOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::PutObjectLegalHoldOutput#request_charged #request_charged} => String # # @example Request syntax with placeholder values # # resp = client.put_object_legal_hold({ # bucket: "BucketName", # required # key: "ObjectKey", # required # legal_hold: { # status: "ON", # accepts ON, OFF # }, # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # content_md5: "ContentMD5", # }) # # @example Response structure # # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLegalHold AWS API Documentation # # @overload put_object_legal_hold(params = {}) # @param [Hash] params ({}) def put_object_legal_hold(params = {}, options = {}) req = build_request(:put_object_legal_hold, params) req.send_request(options) end # Places an object lock configuration on the specified bucket. The rule # specified in the object lock configuration will be applied by default # to every new object placed in the specified bucket. # # @option params [required, String] :bucket # The bucket whose object lock configuration you want to create or # replace. # # @option params [Types::ObjectLockConfiguration] :object_lock_configuration # The object lock configuration that you want to apply to the specified # bucket. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :token # A token to allow Amazon S3 object lock to be enabled for an existing # bucket. # # @option params [String] :content_md5 # The MD5 hash for the request body. # # @return [Types::PutObjectLockConfigurationOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::PutObjectLockConfigurationOutput#request_charged #request_charged} => String # # @example Request syntax with placeholder values # # resp = client.put_object_lock_configuration({ # bucket: "BucketName", # required # object_lock_configuration: { # object_lock_enabled: "Enabled", # accepts Enabled # rule: { # default_retention: { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # days: 1, # years: 1, # }, # }, # }, # request_payer: "requester", # accepts requester # token: "ObjectLockToken", # content_md5: "ContentMD5", # }) # # @example Response structure # # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLockConfiguration AWS API Documentation # # @overload put_object_lock_configuration(params = {}) # @param [Hash] params ({}) def put_object_lock_configuration(params = {}, options = {}) req = build_request(:put_object_lock_configuration, params) req.send_request(options) end # Places an Object Retention configuration on an object. # # @option params [required, String] :bucket # The bucket that contains the object you want to apply this Object # Retention configuration to. # # @option params [required, String] :key # The key name for the object that you want to apply this Object # Retention configuration to. # # @option params [Types::ObjectLockRetention] :retention # The container element for the Object Retention configuration. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @option params [String] :version_id # The version ID for the object that you want to apply this Object # Retention configuration to. # # @option params [Boolean] :bypass_governance_retention # Indicates whether this operation should bypass Governance-mode # restrictions.j # # @option params [String] :content_md5 # The MD5 hash for the request body. # # @return [Types::PutObjectRetentionOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::PutObjectRetentionOutput#request_charged #request_charged} => String # # @example Request syntax with placeholder values # # resp = client.put_object_retention({ # bucket: "BucketName", # required # key: "ObjectKey", # required # retention: { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # retain_until_date: Time.now, # }, # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # bypass_governance_retention: false, # content_md5: "ContentMD5", # }) # # @example Response structure # # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRetention AWS API Documentation # # @overload put_object_retention(params = {}) # @param [Hash] params ({}) def put_object_retention(params = {}, options = {}) req = build_request(:put_object_retention, params) req.send_request(options) end # Sets the supplied tag-set to an object that already exists in a bucket # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :version_id # # @option params [String] :content_md5 # # @option params [required, Types::Tagging] :tagging # # @return [Types::PutObjectTaggingOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::PutObjectTaggingOutput#version_id #version_id} => String # # # @example Example: To add tags to an existing object # # # The following example adds tags to an existing object. # # resp = client.put_object_tagging({ # bucket: "examplebucket", # key: "HappyFace.jpg", # tagging: { # tag_set: [ # { # key: "Key3", # value: "Value3", # }, # { # key: "Key4", # value: "Value4", # }, # ], # }, # }) # # resp.to_h outputs the following: # { # version_id: "null", # } # # @example Request syntax with placeholder values # # resp = client.put_object_tagging({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # content_md5: "ContentMD5", # tagging: { # required # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }) # # @example Response structure # # resp.version_id #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging AWS API Documentation # # @overload put_object_tagging(params = {}) # @param [Hash] params ({}) def put_object_tagging(params = {}, options = {}) req = build_request(:put_object_tagging, params) req.send_request(options) end # Creates or modifies the `PublicAccessBlock` configuration for an # Amazon S3 bucket. # # @option params [required, String] :bucket # The name of the Amazon S3 bucket whose `PublicAccessBlock` # configuration you want to set. # # @option params [String] :content_md5 # The MD5 hash of the `PutPublicAccessBlock` request body. # # @option params [required, Types::PublicAccessBlockConfiguration] :public_access_block_configuration # The `PublicAccessBlock` configuration that you want to apply to this # Amazon S3 bucket. You can enable the configuration options in any # combination. For more information about when Amazon S3 considers a # bucket or object public, see [The Meaning of "Public"][1] in the # *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status # # @return [Struct] Returns an empty {Seahorse::Client::Response response}. # # @example Request syntax with placeholder values # # resp = client.put_public_access_block({ # bucket: "BucketName", # required # content_md5: "ContentMD5", # public_access_block_configuration: { # required # block_public_acls: false, # ignore_public_acls: false, # block_public_policy: false, # restrict_public_buckets: false, # }, # }) # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutPublicAccessBlock AWS API Documentation # # @overload put_public_access_block(params = {}) # @param [Hash] params ({}) def put_public_access_block(params = {}, options = {}) req = build_request(:put_public_access_block, params) req.send_request(options) end # Restores an archived copy of an object back into Amazon S3 # # @option params [required, String] :bucket # # @option params [required, String] :key # # @option params [String] :version_id # # @option params [Types::RestoreRequest] :restore_request # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::RestoreObjectOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::RestoreObjectOutput#request_charged #request_charged} => String # * {Types::RestoreObjectOutput#restore_output_path #restore_output_path} => String # # # @example Example: To restore an archived object # # # The following example restores for one day an archived copy of an object back into Amazon S3 bucket. # # resp = client.restore_object({ # bucket: "examplebucket", # key: "archivedobjectkey", # restore_request: { # days: 1, # glacier_job_parameters: { # tier: "Expedited", # }, # }, # }) # # resp.to_h outputs the following: # { # } # # @example Request syntax with placeholder values # # resp = client.restore_object({ # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # restore_request: { # days: 1, # glacier_job_parameters: { # tier: "Standard", # required, accepts Standard, Bulk, Expedited # }, # type: "SELECT", # accepts SELECT # tier: "Standard", # accepts Standard, Bulk, Expedited # description: "Description", # select_parameters: { # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # expression_type: "SQL", # required, accepts SQL # expression: "Expression", # required # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # }, # output_location: { # s3: { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # }, # }, # }, # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.request_charged #=> String, one of "requester" # resp.restore_output_path #=> String # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject AWS API Documentation # # @overload restore_object(params = {}) # @param [Hash] params ({}) def restore_object(params = {}, options = {}) req = build_request(:restore_object, params) req.send_request(options) end # This operation filters the contents of an Amazon S3 object based on a # simple Structured Query Language (SQL) statement. In the request, # along with the SQL expression, you must also specify a data # serialization format (JSON or CSV) of the object. Amazon S3 uses this # to parse object data into records, and returns only records that match # the specified SQL expression. You must also specify the data # serialization format for the response. # # @option params [required, String] :bucket # The S3 bucket. # # @option params [required, String] :key # The object key. # # @option params [String] :sse_customer_algorithm # The SSE Algorithm used to encrypt the object. For more information, # see [ Server-Side Encryption (Using Customer-Provided Encryption # Keys][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html # # @option params [String] :sse_customer_key # The SSE Customer Key. For more information, see [ Server-Side # Encryption (Using Customer-Provided Encryption Keys][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html # # @option params [String] :sse_customer_key_md5 # The SSE Customer Key MD5. For more information, see [ Server-Side # Encryption (Using Customer-Provided Encryption Keys][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html # # @option params [required, String] :expression # The expression that is used to query the object. # # @option params [required, String] :expression_type # The type of the provided expression (for example., SQL). # # @option params [Types::RequestProgress] :request_progress # Specifies if periodic request progress information should be enabled. # # @option params [required, Types::InputSerialization] :input_serialization # Describes the format of the data in the object that is being queried. # # @option params [required, Types::OutputSerialization] :output_serialization # Describes the format of the data that you want Amazon S3 to return in # response. # # @return [Types::SelectObjectContentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::SelectObjectContentOutput#payload #payload} => Types::SelectObjectContentEventStream # # @example EventStream Operation Example # # You can process event once it arrives immediately, or wait until # full response complete and iterate through eventstream enumerator. # # To interact with event immediately, you need to register #select_object_content # with callbacks, callbacks can be register for specifc events or for all events, # callback for errors in the event stream is also available for register. # # Callbacks can be passed in by `:event_stream_handler` option or within block # statement attached to #select_object_content call directly. Hybrid pattern of both # is also supported. # # `:event_stream_handler` option takes in either Proc object or # Aws::S3::EventStreams::SelectObjectContentEventStream object. # # Usage pattern a): callbacks with a block attached to #select_object_content # Example for registering callbacks for all event types and error event # # client.select_object_content( # params input# ) do |stream| # stream.on_error_event do |event| # # catch unmodeled error event in the stream # raise event # # => Aws::Errors::EventError # # event.event_type => :error # # event.error_code => String # # event.error_message => String # end # # stream.on_event do |event| # # process all events arrive # puts event.event_type # ... # end # # end # # Usage pattern b): pass in `:event_stream_handler` for #select_object_content # # 1) create a Aws::S3::EventStreams::SelectObjectContentEventStream object # Example for registering callbacks with specific events # # handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new # handler.on_records_event do |event| # event # => Aws::S3::Types::Records # end # handler.on_stats_event do |event| # event # => Aws::S3::Types::Stats # end # handler.on_progress_event do |event| # event # => Aws::S3::Types::Progress # end # handler.on_cont_event do |event| # event # => Aws::S3::Types::Cont # end # handler.on_end_event do |event| # event # => Aws::S3::Types::End # end # # client.select_object_content( # params input #, event_stream_handler: handler) # # 2) use a Ruby Proc object # Example for registering callbacks with specific events # # handler = Proc.new do |stream| # stream.on_records_event do |event| # event # => Aws::S3::Types::Records # end # stream.on_stats_event do |event| # event # => Aws::S3::Types::Stats # end # stream.on_progress_event do |event| # event # => Aws::S3::Types::Progress # end # stream.on_cont_event do |event| # event # => Aws::S3::Types::Cont # end # stream.on_end_event do |event| # event # => Aws::S3::Types::End # end # end # # client.select_object_content( # params input #, event_stream_handler: handler) # # Usage pattern c): hybird pattern of a) and b) # # handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new # handler.on_records_event do |event| # event # => Aws::S3::Types::Records # end # handler.on_stats_event do |event| # event # => Aws::S3::Types::Stats # end # handler.on_progress_event do |event| # event # => Aws::S3::Types::Progress # end # handler.on_cont_event do |event| # event # => Aws::S3::Types::Cont # end # handler.on_end_event do |event| # event # => Aws::S3::Types::End # end # # client.select_object_content( # params input #, event_stream_handler: handler) do |stream| # stream.on_error_event do |event| # # catch unmodeled error event in the stream # raise event # # => Aws::Errors::EventError # # event.event_type => :error # # event.error_code => String # # event.error_message => String # end # end # # Besides above usage patterns for process events when they arrive immediately, you can also # iterate through events after response complete. # # Events are available at resp.payload # => Enumerator # For parameter input example, please refer to following request syntax # # @example Request syntax with placeholder values # # resp = client.select_object_content({ # bucket: "BucketName", # required # key: "ObjectKey", # required # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # expression: "Expression", # required # expression_type: "SQL", # required, accepts SQL # request_progress: { # enabled: false, # }, # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # }) # # @example Response structure # # All events are available at resp.payload: # resp.payload #=> Enumerator # resp.payload.event_types #=> [:records, :stats, :progress, :cont, :end] # # For :records event available at #on_records_event callback and response eventstream enumerator: # event.payload #=> IO # # For :stats event available at #on_stats_event callback and response eventstream enumerator: # event.details.bytes_scanned #=> Integer # event.details.bytes_processed #=> Integer # event.details.bytes_returned #=> Integer # # For :progress event available at #on_progress_event callback and response eventstream enumerator: # event.details.bytes_scanned #=> Integer # event.details.bytes_processed #=> Integer # event.details.bytes_returned #=> Integer # # For :cont event available at #on_cont_event callback and response eventstream enumerator: # #=> EmptyStruct # For :end event available at #on_end_event callback and response eventstream enumerator: # #=> EmptyStruct # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent AWS API Documentation # # @overload select_object_content(params = {}) # @param [Hash] params ({}) def select_object_content(params = {}, options = {}, &block) params = params.dup event_stream_handler = case handler = params.delete(:event_stream_handler) when EventStreams::SelectObjectContentEventStream then handler when Proc then EventStreams::SelectObjectContentEventStream.new.tap(&handler) when nil then EventStreams::SelectObjectContentEventStream.new else msg = "expected :event_stream_handler to be a block or "\ "instance of Aws::S3::EventStreams::SelectObjectContentEventStream"\ ", got `#{handler.inspect}` instead" raise ArgumentError, msg end yield(event_stream_handler) if block_given? req = build_request(:select_object_content, params) req.context[:event_stream_handler] = event_stream_handler req.handlers.add(Aws::Binary::DecodeHandler, priority: 95) req.send_request(options, &block) end # Uploads a part in a multipart upload. # # **Note:** After you initiate multipart upload and upload one or more # parts, you must either complete or abort multipart upload in order to # stop getting charged for storage of the uploaded parts. Only after you # either complete or abort multipart upload, Amazon S3 frees up the # parts storage and stops charging you for the parts storage. # # @option params [String, IO] :body # Object data. # # @option params [required, String] :bucket # Name of the bucket to which the multipart upload was initiated. # # @option params [Integer] :content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # # @option params [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This parameter # is auto-populated when using the command from the CLI. This parameted # is required if object lock parameters are specified. # # @option params [required, String] :key # Object key for which the multipart upload was initiated. # # @option params [required, Integer] :part_number # Part number of part being uploaded. This is a positive integer between # 1 and 10,000. # # @option params [required, String] :upload_id # Upload ID identifying the multipart upload whose part is being # uploaded. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. This must be # the same encryption key specified in the initiate multipart upload # request. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::UploadPartOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::UploadPartOutput#server_side_encryption #server_side_encryption} => String # * {Types::UploadPartOutput#etag #etag} => String # * {Types::UploadPartOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::UploadPartOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::UploadPartOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::UploadPartOutput#request_charged #request_charged} => String # # # @example Example: To upload a part # # # The following example uploads part 1 of a multipart upload. The example specifies a file name for the part data. The # # Upload ID is same that is returned by the initiate multipart upload. # # resp = client.upload_part({ # body: "fileToUpload", # bucket: "examplebucket", # key: "examplelargeobject", # part_number: 1, # upload_id: "xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--", # }) # # resp.to_h outputs the following: # { # etag: "\"d8c2eafd90c266e19ab9dcacc479f8af\"", # } # # @example Request syntax with placeholder values # # resp = client.upload_part({ # body: source_file, # bucket: "BucketName", # required # content_length: 1, # content_md5: "ContentMD5", # key: "ObjectKey", # required # part_number: 1, # required # upload_id: "MultipartUploadId", # required # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.etag #=> String # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart AWS API Documentation # # @overload upload_part(params = {}) # @param [Hash] params ({}) def upload_part(params = {}, options = {}) req = build_request(:upload_part, params) req.send_request(options) end # Uploads a part by copying data from an existing object as data source. # # @option params [required, String] :bucket # # @option params [required, String] :copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # # @option params [String] :copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified tag. # # @option params [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # # @option params [String] :copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # # @option params [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # # @option params [String] :copy_source_range # The range of bytes to copy from the source object. The range value # must use the form bytes=first-last, where the first and last are the # zero-based byte offsets to copy. For example, bytes=0-9 indicates that # you want to copy the first ten bytes of the source. You can copy a # range only if the source object is greater than 5 MB. # # @option params [required, String] :key # # @option params [required, Integer] :part_number # Part number of part being copied. This is a positive integer between 1 # and 10,000. # # @option params [required, String] :upload_id # Upload ID identifying the multipart upload whose part is being copied. # # @option params [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # # @option params [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. This must be # the same encryption key specified in the initiate multipart upload # request. # # @option params [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # # @option params [String] :copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use to # decrypt the source object. The encryption key provided in this header # must be one that was used when the source object was created. # # @option params [String] :copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # # @option params [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # # @return [Types::UploadPartCopyOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: # # * {Types::UploadPartCopyOutput#copy_source_version_id #copy_source_version_id} => String # * {Types::UploadPartCopyOutput#copy_part_result #copy_part_result} => Types::CopyPartResult # * {Types::UploadPartCopyOutput#server_side_encryption #server_side_encryption} => String # * {Types::UploadPartCopyOutput#sse_customer_algorithm #sse_customer_algorithm} => String # * {Types::UploadPartCopyOutput#sse_customer_key_md5 #sse_customer_key_md5} => String # * {Types::UploadPartCopyOutput#ssekms_key_id #ssekms_key_id} => String # * {Types::UploadPartCopyOutput#request_charged #request_charged} => String # # # @example Example: To upload a part by copying data from an existing object as data source # # # The following example uploads a part of a multipart upload by copying data from an existing object as data source. # # resp = client.upload_part_copy({ # bucket: "examplebucket", # copy_source: "/bucketname/sourceobjectkey", # key: "examplelargeobject", # part_number: 1, # upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--", # }) # # resp.to_h outputs the following: # { # copy_part_result: { # etag: "\"b0c6f0e7e054ab8fa2536a2677f8734d\"", # last_modified: Time.parse("2016-12-29T21:24:43.000Z"), # }, # } # # @example Example: To upload a part by copying byte range from an existing object as data source # # # The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as # # data source. # # resp = client.upload_part_copy({ # bucket: "examplebucket", # copy_source: "/bucketname/sourceobjectkey", # copy_source_range: "bytes=1-100000", # key: "examplelargeobject", # part_number: 2, # upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--", # }) # # resp.to_h outputs the following: # { # copy_part_result: { # etag: "\"65d16d19e65a7508a51f043180edcc36\"", # last_modified: Time.parse("2016-12-29T21:44:28.000Z"), # }, # } # # @example Request syntax with placeholder values # # resp = client.upload_part_copy({ # bucket: "BucketName", # required # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # copy_source_range: "CopySourceRange", # key: "ObjectKey", # required # part_number: 1, # required # upload_id: "MultipartUploadId", # required # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # }) # # @example Response structure # # resp.copy_source_version_id #=> String # resp.copy_part_result.etag #=> String # resp.copy_part_result.last_modified #=> Time # resp.server_side_encryption #=> String, one of "AES256", "aws:kms" # resp.sse_customer_algorithm #=> String # resp.sse_customer_key_md5 #=> String # resp.ssekms_key_id #=> String # resp.request_charged #=> String, one of "requester" # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy AWS API Documentation # # @overload upload_part_copy(params = {}) # @param [Hash] params ({}) def upload_part_copy(params = {}, options = {}) req = build_request(:upload_part_copy, params) req.send_request(options) end # @!endgroup # @param params ({}) # @api private def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-s3' context[:gem_version] = '1.48.0' Seahorse::Client::Request.new(handlers, context) end # Polls an API operation until a resource enters a desired state. # # ## Basic Usage # # A waiter will call an API operation until: # # * It is successful # * It enters a terminal state # * It makes the maximum number of attempts # # In between attempts, the waiter will sleep. # # # polls in a loop, sleeping between attempts # client.wait_until(waiter_name, params) # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. You can pass # configuration as the final arguments hash. # # # poll for ~25 seconds # client.wait_until(waiter_name, params, { # max_attempts: 5, # delay: 5, # }) # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # client.wait_until(waiter_name, params, { # # # disable max attempts # max_attempts: nil, # # # poll for 1 hour, instead of a number of attempts # before_wait: -> (attempts, response) do # throw :failure if Time.now - started_at > 3600 # end # }) # # ## Handling Errors # # When a waiter is unsuccessful, it will raise an error. # All of the failure errors extend from # {Aws::Waiters::Errors::WaiterFailed}. # # begin # client.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # ## Valid Waiters # # The following table lists the valid waiter names, the operations they call, # and the default `:delay` and `:max_attempts` values. # # | waiter_name | params | :delay | :max_attempts | # | ----------------- | -------------- | -------- | ------------- | # | bucket_exists | {#head_bucket} | 5 | 20 | # | bucket_not_exists | {#head_bucket} | 5 | 20 | # | object_exists | {#head_object} | 5 | 20 | # | object_not_exists | {#head_object} | 5 | 20 | # # @raise [Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # @raise [Errors::TooManyAttemptsError] Raised when the configured # maximum number of attempts have been made, and the waiter is not # yet successful. # # @raise [Errors::UnexpectedError] Raised when an error is encounted # while polling for a resource that is not expected. # # @raise [Errors::NoSuchWaiterError] Raised when you request to wait # for an unknown state. # # @return [Boolean] Returns `true` if the waiter was successful. # @param [Symbol] waiter_name # @param [Hash] params ({}) # @param [Hash] options ({}) # @option options [Integer] :max_attempts # @option options [Integer] :delay # @option options [Proc] :before_attempt # @option options [Proc] :before_wait def wait_until(waiter_name, params = {}, options = {}) w = waiter(waiter_name, options) yield(w.waiter) if block_given? # deprecated w.wait(params) end # @api private # @deprecated def waiter_names waiters.keys end private # @param [Symbol] waiter_name # @param [Hash] options ({}) def waiter(waiter_name, options = {}) waiter_class = waiters[waiter_name] if waiter_class waiter_class.new(options.merge(client: self)) else raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys) end end def waiters { bucket_exists: Waiters::BucketExists, bucket_not_exists: Waiters::BucketNotExists, object_exists: Waiters::ObjectExists, object_not_exists: Waiters::ObjectNotExists } end class << self # @api private attr_reader :identifier # @api private def errors_module Errors end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/presigned_post.rb0000644000004100000410000005711113536452011021551 0ustar www-datawww-datarequire 'openssl' require 'base64' module Aws module S3 # @note Normally you do not need to construct a {PresignedPost} yourself. # See {Bucket#presigned_post} and {Object#presigned_post}. # # ## Basic Usage # # To generate a presigned post, you need AWS credentials, the region # your bucket is in, and the name of your bucket. You can apply constraints # to the post object as options to {#initialize} or by calling # methods such as {#key} and {#content_length_range}. # # The following two examples are equivalent. # # ```ruby # post = Aws::S3::PresignedPost.new(creds, region, bucket, { # key: '/uploaded/object/key', # content_length_range: 0..1024, # acl: 'public-read', # metadata: { # 'original-filename' => '${filename}' # } # }) # post.fields # #=> { ... } # # post = Aws::S3::PresignedPost.new(creds, region, bucket). # key('/uploaded/object/key'). # content_length_range(0..1024). # acl('public-read'). # metadata('original-filename' => '${filename}'). # fields # #=> { ... } # ``` # # ## HTML Forms # # You can use a {PresignedPost} object to build an HTML form. It is # recommended to use some helper to build the form tag and input # tags that properly escapes values. # # ### Form Tag # # To upload a file to Amazon S3 using a browser, you need to create # a post form. The {#url} method returns the value you should use # as the form action. # # ```erb #
# ... #
# ``` # # The follow attributes must be set on the form: # # * `action` - This must be the {#url}. # * `method` - This must be `post`. # * `enctype` - This must be `multipart/form-data`. # # ### Form Fields # # The {#fields} method returns a hash of form fields to render inside # the form. Typically these are rendered as hidden input fields. # # ```erb # <% @post.fields.each do |name, value| %> # # <% end %> # ``` # # Lastly, the form must have a file field with the name `file`. # # ```erb # # ``` # # ## Post Policy # # When you construct a {PresignedPost}, you must specify every form # field name that will be posted by the browser. If you omit a form # field sent by the browser, Amazon S3 will reject the request. # You can specify accepted form field values three ways: # # * Specify exactly what the value must be. # * Specify what value the field starts with. # * Specify the field may have any value. # # ### Field Equals # # You can specify that a form field must be a certain value. # Simply pass an option like `:content_type` to the constructor, # or call the associated method. # # ```ruby # post = Aws::S3::PresignedPost.new(creds, region, bucket). # post.content_type('text/plain') # ``` # # If any of the given values are changed by the user in the form, then # Amazon S3 will reject the POST request. # # ### Field Starts With # # You can specify prefix values for many of the POST form fields. # To specify a required prefix, use the `:_starts_with` # option or call the associated `#_starts_with` method. # # ```ruby # post = Aws::S3::PresignedPost.new(creds, region, bucket, { # key_starts_with: '/images/', # content_type_starts_with: 'image/', # # ... # }) # ``` # # When using starts with, the form must contain a field where the # user can specify the value. The {PresignedPost} will not add # a value for these fields. # # ### Any Field Value # # To white-list a form field to send any value, you can name that # field with `:allow_any` or {#allow_any}. # # ```ruby # post = Aws::S3::PresignedPost.new(creds, region, bucket, { # key: 'object-key', # allow_any: ['Filename'], # # ... # }) # ``` # # ### Metadata # # You can add rules for metadata fields using `:metadata`, {#metadata}, # `:metadata_starts_with` and {#metadata_starts_with}. Unlike other # form fields, you pass a hash value to these options/methods: # # ```ruby # post = Aws::S3::PresignedPost.new(creds, region, bucket). # key('/fixed/key'). # metadata(foo: 'bar') # # post.fields['x-amz-meta-foo'] # #=> 'bar' # ``` # # ### The `${filename}` Variable # # The string `${filename}` is automatically replaced with the name of the # file provided by the user and is recognized by all form fields. It is # not supported with `starts_with` conditions. # # If the browser or client provides a full or partial path to the file, # only the text following the last slash (/) or backslash (\) will be used # (e.g., "C:\Program Files\directory1\file.txt" will be interpreted # as "file.txt"). If no file or file name is provided, the variable is # replaced with an empty string. # # In the following example, we use `${filename}` to store the original # filename in the `x-amz-meta-` hash with the uploaded object. # # ```ruby # post = Aws::S3::PresignedPost.new(creds, region, bucket, { # key: '/fixed/key', # metadata: { # 'original-filename': '${filename}' # } # }) # ``` # class PresignedPost # @param [Credentials] credentials Security credentials for signing # the post policy. # @param [String] bucket_region Region of the target bucket. # @param [String] bucket_name Name of the target bucket. # @option options [Time] :signature_expiration Specify when the signature on # the post will expire. Defaults to one hour from creation of the # presigned post. May not exceed one week from creation time. # @option options [String] :key See {PresignedPost#key}. # @option options [String] :key_starts_with See {PresignedPost#key_starts_with}. # @option options [String] :acl See {PresignedPost#acl}. # @option options [String] :acl_starts_with See {PresignedPost#acl_starts_with}. # @option options [String] :cache_control See {PresignedPost#cache_control}. # @option options [String] :cache_control_starts_with See {PresignedPost#cache_control_starts_with}. # @option options [String] :content_type See {PresignedPost#content_type}. # @option options [String] :content_type_starts_with See {PresignedPost#content_type_starts_with}. # @option options [String] :content_disposition See {PresignedPost#content_disposition}. # @option options [String] :content_disposition_starts_with See {PresignedPost#content_disposition_starts_with}. # @option options [String] :content_encoding See {PresignedPost#content_encoding}. # @option options [String] :content_encoding_starts_with See {PresignedPost#content_encoding_starts_with}. # @option options [String] :expires See {PresignedPost#expires}. # @option options [String] :expires_starts_with See {PresignedPost#expires_starts_with}. # @option options [Range] :content_length_range See {PresignedPost#content_length_range}. # @option options [String] :success_action_redirect See {PresignedPost#success_action_redirect}. # @option options [String] :success_action_redirect_starts_with See {PresignedPost#success_action_redirect_starts_with}. # @option options [String] :success_action_status See {PresignedPost#success_action_status}. # @option options [String] :storage_class See {PresignedPost#storage_class}. # @option options [String] :website_redirect_location See {PresignedPost#website_redirect_location}. # @option options [Hash] :metadata See {PresignedPost#metadata}. # @option options [Hash] :metadata_starts_with See {PresignedPost#metadata_starts_with}. # @option options [String] :server_side_encryption See {PresignedPost#server_side_encryption}. # @option options [String] :server_side_encryption_aws_kms_key_id See {PresignedPost#server_side_encryption_aws_kms_key_id}. # @option options [String] :server_side_encryption_customer_algorithm See {PresignedPost#server_side_encryption_customer_algorithm}. # @option options [String] :server_side_encryption_customer_key See {PresignedPost#server_side_encryption_customer_key}. def initialize(credentials, bucket_region, bucket_name, options = {}) @credentials = credentials.credentials @bucket_region = bucket_region @bucket_name = bucket_name @url = options.delete(:url) || bucket_url @fields = {} @key_set = false @signature_expiration = Time.now + 3600 @conditions = [{ 'bucket' => @bucket_name }] options.each do |option_name, option_value| case option_name when :allow_any then allow_any(option_value) when :signature_expiration then @signature_expiration = option_value else send("#{option_name}", option_value) end end end # @return [String] The URL to post a file upload to. This should be # the form action. attr_reader :url # @return [Hash] A hash of fields to render in an HTML form # as hidden input fields. def fields check_required_values! datetime = Time.now.utc.strftime("%Y%m%dT%H%M%SZ") fields = @fields.dup fields.update('policy' => policy(datetime)) fields.update(signature_fields(datetime)) fields.update('x-amz-signature' => signature(datetime, fields['policy'])) end # A list of form fields to white-list with any value. # @param [Sting, Array] field_names # @return [self] def allow_any(*field_names) field_names.flatten.each do |field_name| @key_set = true if field_name.to_s == 'key' starts_with(field_name, '') end self end # @api private def self.define_field(field, *args) options = args.last.is_a?(Hash) ? args.pop : {} field_name = args.last || field.to_s define_method("#{field}") do |value| with(field_name, value) end if options[:starts_with] define_method("#{field}_starts_with") do |value| starts_with(field_name, value) end end end # @!group Fields # The key to use for the uploaded object. Use can use `${filename}` # as a variable in the key. This will be replaced with the name # of the file as provided by the user. # # For example, if the key is given as `/user/betty/${filename}` and # the file uploaded is named `lolcatz.jpg`, the resultant key will # be `/user/betty/lolcatz.jpg`. # # @param [String] key # @see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html) # @return [self] def key(key) @key_set = true with('key', key) end # Specify a prefix the uploaded # @param [String] prefix # @see #key # @return [self] def key_starts_with(prefix) @key_set = true starts_with('key', prefix) end # @!method acl(canned_acl) # Specify the cannedl ACL (access control list) for the object. # May be one of the following values: # # * `private` # * `public-read` # * `public-read-write` # * `authenticated-read` # * `bucket-owner-read` # * `bucket-owner-full-control` # # @param [String] canned_acl # @see http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html # @return [self] # # @!method acl_starts_with(prefix) # @param [String] prefix # @see #acl # @return [self] define_field(:acl, starts_with: true) # @!method cache_control(value) # Specify caching behavior along the request/reply chain. # @param [String] value # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9. # @return [self] # # @!method cache_control_starts_with(prefix) # @param [String] prefix # @see #cache_control # @return [self] define_field(:cache_control, 'Cache-Control', starts_with: true) # @return [String] # @!method content_type(value) # A standard MIME type describing the format of the contents. # @param [String] value # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 # @return [self] # # @!method content_type_starts_with(prefix) # @param [String] prefix # @see #content_type # @return [self] define_field(:content_type, 'Content-Type', starts_with: true) # @!method content_disposition(value) # Specifies presentational information for the object. # @param [String] value # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1 # @return [self] # # @!method content_disposition_starts_with(prefix) # @param [String] prefix # @see #content_disposition # @return [self] define_field(:content_disposition, 'Content-Disposition', starts_with: true) # @!method content_encoding(value) # Specifies what content encodings have been applied to the object # and thus what decoding mechanisms must be applied to obtain the # media-type referenced by the Content-Type header field. # @param [String] value # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 # @return [self] # # @!method content_encoding_starts_with(prefix) # @param [String] prefix # @see #content_encoding # @return [self] define_field(:content_encoding, 'Content-Encoding', starts_with: true) # The date and time at which the object is no longer cacheable. # @note This does not affect the expiration of the presigned post # signature. # @param [Time] time # @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 # @return [self] def expires(time) with('Expires', time.httpdate) end # @param [String] prefix # @see #expires # @return [self] def expires_starts_with(prefix) starts_with('Expires', prefix) end # The minimum and maximum allowable size for the uploaded content. # @param [Range] byte_range # @return [self] def content_length_range(byte_range) min = byte_range.begin max = byte_range.end max -= 1 if byte_range.exclude_end? @conditions << ['content-length-range', min, max] self end # @!method success_action_redirect(value) # The URL to which the client is redirected # upon successful upload. If {#success_action_redirect} is not # specified, Amazon S3 returns the empty document type specified # by {#success_action_status}. # # If Amazon S3 cannot interpret the URL, it acts as if the field # is not present. If the upload fails, Amazon S3 displays an error # and does not redirect the user to a URL. # # @param [String] value # @return [self] # # @!method success_action_redirect_starts_with(prefix) # @param [String] prefix # @see #success_action_redirect # @return [self] define_field(:success_action_redirect, starts_with: true) # @!method success_action_status(value) # The status code returned to the client upon # successful upload if {#success_action_redirect} is not # specified. # # Accepts the values `200`, `201`, or `204` (default). # # If the value is set to 200 or 204, Amazon S3 returns an empty # document with a 200 or 204 status code. If the value is set to 201, # Amazon S3 returns an XML document with a 201 status code. # # If the value is not set or if it is set to an invalid value, Amazon # S3 returns an empty document with a 204 status code. # # @param [String] value The status code returned to the client upon # @return [self] define_field(:success_action_status) # @!method storage_class(value) # Storage class to use for storing the object. Defaults to # `STANDARD`. Must be one of: # # * `STANDARD` # * `REDUCED_REDUNDANCY` # # You cannot specify `GLACIER` as the storage class. To transition # objects to the GLACIER storage class you can use lifecycle # configuration. # @param [String] value Storage class to use for storing the # @return [self] define_field(:storage_class, 'x-amz-storage-class') # @!method website_redirect_location(value) # If the bucket is configured as a website, # redirects requests for this object to another object in the # same bucket or to an external URL. Amazon S3 stores this value # in the object metadata. # # The value must be prefixed by, "/", "http://" or "https://". # The length of the value is limited to 2K. # # @param [String] value # @see http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html # @see http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html # @see http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html # @return [self] define_field(:website_redirect_location, 'x-amz-website-redirect-location') # Metadata hash to store with the uploaded object. Hash keys will be # prefixed with "x-amz-meta-". # @param [Hash] hash # @return [self] def metadata(hash) hash.each do |key, value| with("x-amz-meta-#{key}", value) end self end # Specify allowable prefix for each key in the metadata hash. # @param [Hash] hash # @see #metadata # @return [self] def metadata_starts_with(hash) hash.each do |key, value| starts_with("x-amz-meta-#{key}", value) end self end # @!endgroup # @!group Server-Side Encryption Fields # @!method server_side_encryption(value) # Specifies a server-side encryption algorithm to use when Amazon # S3 creates an object. Valid values include: # # * `aws:kms` # * `AES256` # # @param [String] value # @return [self] define_field(:server_side_encryption, 'x-amz-server-side-encryption') # @!method server_side_encryption_aws_kms_key_id(value) # If {#server_side_encryption} is called with the value of `aws:kms`, # this method specifies the ID of the AWS Key Management Service # (KMS) master encryption key to use for the object. # @param [String] value # @return [self] define_field(:server_side_encryption_aws_kms_key_id, 'x-amz-server-side-encryption-aws-kms-key-id') # @!endgroup # @!group Server-Side Encryption with Customer-Provided Key Fields # @!method server_side_encryption_customer_algorithm(value) # Specifies the algorithm to use to when encrypting the object. # Must be set to `AES256` when using customer-provided encryption # keys. Must also call {#server_side_encryption_customer_key}. # @param [String] value # @see #server_side_encryption_customer_key # @return [self] define_field(:server_side_encryption_customer_algorithm, 'x-amz-server-side-encryption-customer-algorithm') # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. # # You must also call {#server_side_encryption_customer_algorithm}. # # @param [String] value # @see #server_side_encryption_customer_algorithm # @return [self] def server_side_encryption_customer_key(value) field_name = 'x-amz-server-side-encryption-customer-key' with(field_name, base64(value)) with(field_name + '-MD5', base64(OpenSSL::Digest::MD5.digest(value))) end # @param [String] prefix # @see #server_side_encryption_customer_key # @return [self] def server_side_encryption_customer_key_starts_with(prefix) field_name = 'x-amz-server-side-encryption-customer-key' starts_with(field_name, prefix) end # @!endgroup private def with(field_name, value) fvar = '${filename}' if index = value.rindex(fvar) if index + fvar.size == value.size @fields[field_name] = value starts_with(field_name, value[0,index]) else msg = "${filename} only supported at the end of #{field_name}" raise ArgumentError, msg end else @fields[field_name] = value.to_s @conditions << { field_name => value.to_s } end self end def starts_with(field_name, value, &block) @conditions << ['starts-with', "$#{field_name}", value.to_s] self end def check_required_values! unless @key_set msg = "key required; you must provide a key via :key, " msg << ":key_starts_with, or :allow_any => ['key']" raise msg end end def bucket_url url = Aws::Partitions::EndpointProvider.resolve(@bucket_region, 's3') url = URI.parse(url) if Plugins::BucketDns.dns_compatible?(@bucket_name, true) url.host = @bucket_name + '.' + url.host else url.path = '/' + @bucket_name end url.to_s end # @return [Hash] def policy(datetime) check_required_values! policy = {} policy['expiration'] = @signature_expiration.utc.iso8601 policy['conditions'] = @conditions.dup signature_fields(datetime).each do |name, value| policy['conditions'] << { name => value } end base64(Json.dump(policy)) end def signature_fields(datetime) fields = {} fields['x-amz-credential'] = credential_scope(datetime) fields['x-amz-algorithm'] = 'AWS4-HMAC-SHA256' fields['x-amz-date'] = datetime if session_token = @credentials.session_token fields['x-amz-security-token'] = session_token end fields end def signature(datetime, string_to_sign) k_secret = @credentials.secret_access_key k_date = hmac("AWS4" + k_secret, datetime[0,8]) k_region = hmac(k_date, @bucket_region) k_service = hmac(k_region, 's3') k_credentials = hmac(k_service, 'aws4_request') hexhmac(k_credentials, string_to_sign) end def hmac(key, value) OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, value) end def hexhmac(key, value) OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), key, value) end def credential_scope(datetime) parts = [] parts << @credentials.access_key_id parts << datetime[0,8] parts << @bucket_region parts << 's3' parts << 'aws4_request' parts.join('/') end def base64(str) Base64.strict_encode64(str) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_region_cache.rb0000644000004100000410000000441713536452011022470 0ustar www-datawww-datarequire 'thread' module Aws module S3 class BucketRegionCache def initialize @regions = {} @listeners = [] @mutex = Mutex.new end # Registers a block as a callback. This listener is called when a # new bucket/region pair is added to the cache. # # S3::BUCKET_REGIONS.bucket_added do |bucket_name, region_name| # # ... # end # # This happens when a request is made against the classic endpoint, # "s3.amazonaws.com" and an error is returned requiring the request # to be resent with Signature Version 4. At this point, multiple # requests are made to discover the bucket region so that a v4 # signature can be generated. # # An application can register listeners here to avoid these extra # requests in the future. By constructing an {S3::Client} with # the proper region, a proper signature can be generated and redirects # avoided. # @return [void] def bucket_added(&block) if block @mutex.synchronize { @listeners << block } else raise ArgumentError, 'missing required block' end end # @param [String] bucket_name # @return [String,nil] Returns the cached region for the named bucket. # Returns `nil` if the bucket is not in the cache. # @api private def [](bucket_name) @mutex.synchronize { @regions[bucket_name] } end # Caches a bucket's region. Calling this method will trigger each # of the {#bucket_added} listener callbacks. # @param [String] bucket_name # @param [String] region_name # @return [void] # @api private def []=(bucket_name, region_name) @mutex.synchronize do @regions[bucket_name] = region_name @listeners.each { |block| block.call(bucket_name, region_name) } end end # @api private def clear @mutex.synchronize { @regions = {} } end # @return [Hash] Returns a hash of cached bucket names and region names. def to_hash @mutex.synchronize do @regions.dup end end alias to_h to_hash end # @api private BUCKET_REGIONS = BucketRegionCache.new end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/file_uploader.rb0000644000004100000410000000276413536452011021342 0ustar www-datawww-datarequire 'pathname' module Aws module S3 # @api private class FileUploader FIFTEEN_MEGABYTES = 15 * 1024 * 1024 # @option options [Client] :client # @option options [Integer] :multipart_threshold Files greater than # `:multipart_threshold` bytes are uploaded using S3 multipart APIs. def initialize(options = {}) @options = options @client = options[:client] || Client.new @multipart_threshold = options[:multipart_threshold] || FIFTEEN_MEGABYTES end # @return [Client] attr_reader :client # @return [Integer] Files larger than this in bytes are uploaded # using a {MultipartFileUploader}. attr_reader :multipart_threshold # @param [String,Pathname,File,Tempfile] source # @option options [required,String] :bucket # @option options [required,String] :key # @return [void] def upload(source, options = {}) if File.size(source) >= multipart_threshold MultipartFileUploader.new(@options).upload(source, options) else put_object(source, options) end end private def put_object(source, options) open_file(source) do |file| @client.put_object(options.merge(body: file)) end end def open_file(source) if String === source || Pathname === source File.open(source, 'rb') { |file| yield(file) } else yield(source) end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_website.rb0000644000004100000410000001763513536452011021532 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketWebsite extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Types::RedirectAllRequestsTo] def redirect_all_requests_to data[:redirect_all_requests_to] end # @return [Types::IndexDocument] def index_document data[:index_document] end # @return [Types::ErrorDocument] def error_document data[:error_document] end # @return [Array] def routing_rules data[:routing_rules] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketWebsite}. # Returns `self` making it possible to chain methods. # # bucket_website.reload.data # # @return [self] def load resp = @client.get_bucket_website(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketWebsiteOutput] # Returns the data for this {BucketWebsite}. Calls # {Client#get_bucket_website} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_website.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.delete_bucket_website(options) resp.data end # @example Request syntax with placeholder values # # bucket_website.put({ # content_md5: "ContentMD5", # website_configuration: { # required # error_document: { # key: "ObjectKey", # required # }, # index_document: { # suffix: "Suffix", # required # }, # redirect_all_requests_to: { # host_name: "HostName", # required # protocol: "http", # accepts http, https # }, # routing_rules: [ # { # condition: { # http_error_code_returned_equals: "HttpErrorCodeReturnedEquals", # key_prefix_equals: "KeyPrefixEquals", # }, # redirect: { # required # host_name: "HostName", # http_redirect_code: "HttpRedirectCode", # protocol: "http", # accepts http, https # replace_key_prefix_with: "ReplaceKeyPrefixWith", # replace_key_with: "ReplaceKeyWith", # }, # }, # ], # }, # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [required, Types::WebsiteConfiguration] :website_configuration # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_website(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/file_downloader.rb0000644000004100000410000000766313536452011021670 0ustar www-datawww-datarequire 'pathname' require 'thread' require 'set' require 'tmpdir' module Aws module S3 # @api private class FileDownloader MIN_CHUNK_SIZE = 5 * 1024 * 1024 MAX_PARTS = 10_000 THREAD_COUNT = 10 def initialize(options = {}) @client = options[:client] || Client.new end # @return [Client] attr_reader :client def download(destination, options = {}) @path = destination @mode = options[:mode] || "auto" @thread_count = options[:thread_count] || THREAD_COUNT @chunk_size = options[:chunk_size] @params = { bucket: options[:bucket], key: options[:key], } @params[:version_id] = options[:version_id] if options[:version_id] case @mode when "auto" then multipart_download when "single_request" then single_request when "get_range" if @chunk_size resp = @client.head_object(@params) multithreaded_get_by_ranges(construct_chunks(resp.content_length)) else msg = "In :get_range mode, :chunk_size must be provided" raise ArgumentError, msg end else msg = "Invalid mode #{@mode} provided, "\ "mode should be :single_request, :get_range or :auto" raise ArgumentError, msg end end private def multipart_download resp = @client.head_object(@params.merge(part_number: 1)) count = resp.parts_count if count.nil? || count <= 1 resp.content_length < MIN_CHUNK_SIZE ? single_request : multithreaded_get_by_ranges(construct_chunks(resp.content_length)) else # partNumber is an option resp = @client.head_object(@params) resp.content_length < MIN_CHUNK_SIZE ? single_request : compute_mode(resp.content_length, count) end end def compute_mode(file_size, count) chunk_size = compute_chunk(file_size) part_size = (file_size.to_f / count.to_f).ceil if chunk_size < part_size multithreaded_get_by_ranges(construct_chunks(file_size)) else multithreaded_get_by_parts(count) end end def construct_chunks(file_size) offset = 0 default_chunk_size = compute_chunk(file_size) chunks = [] while offset <= file_size progress = offset + default_chunk_size chunks << "bytes=#{offset}-#{progress < file_size ? progress : file_size}" offset = progress + 1 end chunks end def compute_chunk(file_size) if @chunk_size && @chunk_size > file_size raise ArgumentError, ":chunk_size shouldn't exceed total file size." else @chunk_size || [(file_size.to_f / MAX_PARTS).ceil, MIN_CHUNK_SIZE].max.to_i end end def batches(chunks, mode) chunks = (1..chunks) if mode.eql? 'part_number' chunks.each_slice(@thread_count).to_a end def multithreaded_get_by_ranges(chunks) thread_batches(chunks, 'range') end def multithreaded_get_by_parts(parts) thread_batches(parts, 'part_number') end def thread_batches(chunks, param) batches(chunks, param).each do |batch| threads = [] batch.each do |chunk| threads << Thread.new do resp = @client.get_object( @params.merge(param.to_sym => chunk) ) write(resp) end end threads.each(&:join) end end def write(resp) range, _ = resp.content_range.split(" ").last.split("/") head, _ = range.split("-").map {|s| s.to_i} IO.write(@path, resp.body.read, head) end def single_request @client.get_object( @params.merge(response_target: @path) ) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/resource.rb0000644000004100000410000000611213536452011020346 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class Resource # @param options ({}) # @option options [Client] :client def initialize(options = {}) @client = options[:client] || Client.new(options) end # @return [Client] def client @client end # @!group Actions # @example Request syntax with placeholder values # # bucket = s3.create_bucket({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # bucket: "BucketName", # required # create_bucket_configuration: { # location_constraint: "EU", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 # }, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # object_lock_enabled_for_bucket: false, # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the bucket. # @option options [required, String] :bucket # @option options [Types::CreateBucketConfiguration] :create_bucket_configuration # @option options [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # @option options [String] :grant_read # Allows grantee to list the objects in the bucket. # @option options [String] :grant_read_acp # Allows grantee to read the bucket ACL. # @option options [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @option options [Boolean] :object_lock_enabled_for_bucket # Specifies whether you want Amazon S3 object lock to be enabled for the # new bucket. # @return [Bucket] def create_bucket(options = {}) resp = @client.create_bucket(options) Bucket.new( name: options[:bucket], client: @client ) end # @!group Associations # @param [String] name # @return [Bucket] def bucket(name) Bucket.new( name: name, client: @client ) end # @example Request syntax with placeholder values # # s3.buckets() # @param [Hash] options ({}) # @return [Bucket::Collection] def buckets(options = {}) batches = Enumerator.new do |y| batch = [] resp = @client.list_buckets(options) resp.data.buckets.each do |b| batch << Bucket.new( name: b.name, data: b, client: @client ) end y.yield(batch) end Bucket::Collection.new(batches) end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/presigner.rb0000644000004100000410000001412213536452011020515 0ustar www-datawww-datamodule Aws module S3 # Allows you to create presigned URLs for S3 operations. # # Example Use: # # signer = Aws::S3::Presigner.new # url = signer.presigned_url(:get_object, bucket: "bucket", key: "key") # class Presigner # @api private ONE_WEEK = 60 * 60 * 24 * 7 # @api private FIFTEEN_MINUTES = 60 * 15 BLACKLISTED_HEADERS = [ 'accept', 'cache-control', 'content-length', # due to a ELB bug 'expect', 'from', 'if-match', 'if-none-match', 'if-modified-since', 'if-unmodified-since', 'if-range', 'max-forwards', 'pragma', 'proxy-authorization', 'referer', 'te', 'user-agent' ].freeze # @option options [Client] :client Optionally provide an existing # S3 client def initialize(options = {}) @client = options[:client] || Aws::S3::Client.new end # @param [Symbol] method Symbolized method name of the operation you want # to presign. # # @option params [Integer] :expires_in (900) The number of seconds # before the presigned URL expires. Defaults to 15 minutes. As signature # version 4 has a maximum expiry time of one week for presigned URLs, # attempts to set this value to greater than one week (604800) will # raise an exception. # # @option params [Time] :time (Time.now) The starting time for when the # presigned url becomes active. # # @option params [Boolean] :secure (true) When `false`, a HTTP URL # is returned instead of the default HTTPS URL. # # @option params [Boolean] :virtual_host (false) When `true`, the # bucket name will be used as the hostname. This will cause # the returned URL to be 'http' and not 'https'. # # @option params [Boolean] :use_accelerate_endpoint (false) When `true`, # Presigner will attempt to use accelerated endpoint. # # @option params [Array] :whitelist_headers ([]) Additional # headers to be included for the signed request. Certain headers beyond # the authorization header could, in theory, be changed for various # reasons (including but not limited to proxies) while in transit and # after signing. This would lead to signature errors being returned, # despite no actual problems with signing. (see BLACKLISTED_HEADERS) # # @raise [ArgumentError] Raises an ArgumentError if `:expires_in` # exceeds one week. # def presigned_url(method, params = {}) if params[:key].nil? or params[:key] == '' raise ArgumentError, ":key must not be blank" end virtual_host = !!params.delete(:virtual_host) time = params.delete(:time) whitelisted_headers = params.delete(:whitelist_headers) || [] unsigned_headers = BLACKLISTED_HEADERS - whitelisted_headers scheme = http_scheme(params, virtual_host) req = @client.build_request(method, params) use_bucket_as_hostname(req) if virtual_host sign_but_dont_send(req, expires_in(params), scheme, time, unsigned_headers) req.send_request.data end private def http_scheme(params, virtual_host) if params.delete(:secure) == false || virtual_host 'http' else @client.config.endpoint.scheme end end def expires_in(params) if (expires_in = params.delete(:expires_in)) if expires_in > ONE_WEEK msg = "expires_in value of #{expires_in} exceeds one-week maximum" raise ArgumentError, msg end expires_in else FIFTEEN_MINUTES end end def use_bucket_as_hostname(req) req.handlers.remove(Plugins::BucketDns::Handler) req.handle do |context| uri = context.http_request.endpoint uri.host = context.params[:bucket] uri.path.sub!("/#{context.params[:bucket]}", '') uri.scheme = 'http' uri.port = 80 @handler.call(context) end end # @param [Seahorse::Client::Request] req def sign_but_dont_send(req, expires_in, scheme, time, unsigned_headers) http_req = req.context.http_request req.handlers.remove(Aws::S3::Plugins::S3Signer::LegacyHandler) req.handlers.remove(Aws::S3::Plugins::S3Signer::V4Handler) req.handlers.remove(Seahorse::Client::Plugins::ContentLength::Handler) signer = build_signer(req.context.config, unsigned_headers) req.context[:presigned_url] = true req.handle(step: :send) do |context| if scheme != http_req.endpoint.scheme endpoint = http_req.endpoint.dup endpoint.scheme = scheme endpoint.port = (scheme == 'http' ? 80 : 443) http_req.endpoint = URI.parse(endpoint.to_s) end # hoist x-amz-* headers to the querystring query = http_req.endpoint.query ? http_req.endpoint.query.split('&') : [] http_req.headers.keys.each do |key| if key.match(/^x-amz/i) value = Aws::Sigv4::Signer.uri_escape(http_req.headers.delete(key)) key = Aws::Sigv4::Signer.uri_escape(key) query << "#{key}=#{value}" end end http_req.endpoint.query = query.join('&') unless query.empty? url = signer.presign_url( http_method: http_req.http_method, url: http_req.endpoint, headers: http_req.headers, body_digest: 'UNSIGNED-PAYLOAD', expires_in: expires_in, time: time ).to_s Seahorse::Client::Response.new(context: context, data: url) end end def build_signer(cfg, unsigned_headers) Aws::Sigv4::Signer.new( service: 's3', region: cfg.region, credentials_provider: cfg.credentials, unsigned_headers: unsigned_headers, uri_escape_path: false ) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/types.rb0000644000004100000410000130322613536452011017672 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 module Types # Specifies the days since the initiation of an incomplete multipart # upload that Amazon S3 will wait before permanently removing all parts # of the upload. For more information, see [ Aborting Incomplete # Multipart Uploads Using a Bucket Lifecycle Policy][1] in the *Amazon # Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config # # @note When making an API call, you may pass AbortIncompleteMultipartUpload # data as a hash: # # { # days_after_initiation: 1, # } # # @!attribute [rw] days_after_initiation # Specifies the number of days after which Amazon S3 aborts an # incomplete multipart upload. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortIncompleteMultipartUpload AWS API Documentation # class AbortIncompleteMultipartUpload < Struct.new( :days_after_initiation) include Aws::Structure end # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUploadOutput AWS API Documentation # class AbortMultipartUploadOutput < Struct.new( :request_charged) include Aws::Structure end # @note When making an API call, you may pass AbortMultipartUploadRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # upload_id: "MultipartUploadId", # required # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # Name of the bucket to which the multipart upload was initiated. # @return [String] # # @!attribute [rw] key # Key of the object for which the multipart upload was initiated. # @return [String] # # @!attribute [rw] upload_id # Upload ID that identifies the multipart upload. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUploadRequest AWS API Documentation # class AbortMultipartUploadRequest < Struct.new( :bucket, :key, :upload_id, :request_payer) include Aws::Structure end # Configures the transfer acceleration state for an Amazon S3 bucket. # For more information, see [Amazon S3 Transfer Acceleration][1] in the # *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html # # @note When making an API call, you may pass AccelerateConfiguration # data as a hash: # # { # status: "Enabled", # accepts Enabled, Suspended # } # # @!attribute [rw] status # Specifies the transfer acceleration status of the bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccelerateConfiguration AWS API Documentation # class AccelerateConfiguration < Struct.new( :status) include Aws::Structure end # Contains the elements that set the ACL permissions for an object per # grantee. # # @note When making an API call, you may pass AccessControlPolicy # data as a hash: # # { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # } # # @!attribute [rw] grants # A list of grants. # @return [Array] # # @!attribute [rw] owner # Container for the bucket owner's display name and ID. # @return [Types::Owner] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccessControlPolicy AWS API Documentation # class AccessControlPolicy < Struct.new( :grants, :owner) include Aws::Structure end # A container for information about access control for replicas. # # @note When making an API call, you may pass AccessControlTranslation # data as a hash: # # { # owner: "Destination", # required, accepts Destination # } # # @!attribute [rw] owner # Specifies the replica ownership. For default and valid values, see # [PUT bucket replication][1] in the *Amazon Simple Storage Service # API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AccessControlTranslation AWS API Documentation # class AccessControlTranslation < Struct.new( :owner) include Aws::Structure end # A conjunction (logical AND) of predicates, which is used in evaluating # a metrics filter. The operator must have at least two predicates in # any combination, and an object must match all of the predicates for # the filter to apply. # # @note When making an API call, you may pass AnalyticsAndOperator # data as a hash: # # { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # } # # @!attribute [rw] prefix # The prefix to use when evaluating an AND predicate: The prefix that # an object must have to be included in the metrics results. # @return [String] # # @!attribute [rw] tags # The list of tags to use when evaluating an AND predicate. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsAndOperator AWS API Documentation # class AnalyticsAndOperator < Struct.new( :prefix, :tags) include Aws::Structure end # Specifies the configuration and any analyses for the analytics filter # of an Amazon S3 bucket. # # For more information, see [GET Bucket analytics][1] in the *Amazon # Simple Storage Service API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETAnalyticsConfig.html # # @note When making an API call, you may pass AnalyticsConfiguration # data as a hash: # # { # id: "AnalyticsId", # required # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # storage_class_analysis: { # required # data_export: { # output_schema_version: "V_1", # required, accepts V_1 # destination: { # required # s3_bucket_destination: { # required # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # }, # }, # }, # }, # } # # @!attribute [rw] id # The ID that identifies the analytics configuration. # @return [String] # # @!attribute [rw] filter # The filter used to describe a set of objects for analyses. A filter # must have exactly one prefix, one tag, or one conjunction # (AnalyticsAndOperator). If no filter is provided, all objects will # be considered in any analysis. # @return [Types::AnalyticsFilter] # # @!attribute [rw] storage_class_analysis # Contains data related to access patterns to be collected and made # available to analyze the tradeoffs between different storage # classes. # @return [Types::StorageClassAnalysis] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsConfiguration AWS API Documentation # class AnalyticsConfiguration < Struct.new( :id, :filter, :storage_class_analysis) include Aws::Structure end # Where to publish the analytics results. # # @note When making an API call, you may pass AnalyticsExportDestination # data as a hash: # # { # s3_bucket_destination: { # required # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # }, # } # # @!attribute [rw] s3_bucket_destination # A destination signifying output to an S3 bucket. # @return [Types::AnalyticsS3BucketDestination] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsExportDestination AWS API Documentation # class AnalyticsExportDestination < Struct.new( :s3_bucket_destination) include Aws::Structure end # @note When making an API call, you may pass AnalyticsFilter # data as a hash: # # { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # } # # @!attribute [rw] prefix # The prefix to use when evaluating an analytics filter. # @return [String] # # @!attribute [rw] tag # The tag to use when evaluating an analytics filter. # @return [Types::Tag] # # @!attribute [rw] and # A conjunction (logical AND) of predicates, which is used in # evaluating an analytics filter. The operator must have at least two # predicates. # @return [Types::AnalyticsAndOperator] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsFilter AWS API Documentation # class AnalyticsFilter < Struct.new( :prefix, :tag, :and) include Aws::Structure end # @note When making an API call, you may pass AnalyticsS3BucketDestination # data as a hash: # # { # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # } # # @!attribute [rw] format # Specifies the file format used when exporting data to Amazon S3. # @return [String] # # @!attribute [rw] bucket_account_id # The account ID that owns the destination bucket. If no account ID is # provided, the owner will not be validated prior to exporting data. # @return [String] # # @!attribute [rw] bucket # The Amazon Resource Name (ARN) of the bucket to which data is # exported. # @return [String] # # @!attribute [rw] prefix # The prefix to use when exporting data. The prefix is prepended to # all results. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsS3BucketDestination AWS API Documentation # class AnalyticsS3BucketDestination < Struct.new( :format, :bucket_account_id, :bucket, :prefix) include Aws::Structure end # @!attribute [rw] name # The name of the bucket. # @return [String] # # @!attribute [rw] creation_date # Date the bucket was created. # @return [Time] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Bucket AWS API Documentation # class Bucket < Struct.new( :name, :creation_date) include Aws::Structure end # Specifies the lifecycle configuration for objects in an Amazon S3 # bucket. For more information, see [Object Lifecycle Management][1] in # the *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html # # @note When making an API call, you may pass BucketLifecycleConfiguration # data as a hash: # # { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # transitions: [ # { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_transitions: [ # { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # } # # @!attribute [rw] rules # A lifecycle rule for individual objects in an Amazon S3 bucket. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/BucketLifecycleConfiguration AWS API Documentation # class BucketLifecycleConfiguration < Struct.new( :rules) include Aws::Structure end # @note When making an API call, you may pass BucketLoggingStatus # data as a hash: # # { # logging_enabled: { # target_bucket: "TargetBucket", # required # target_grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE # }, # ], # target_prefix: "TargetPrefix", # required # }, # } # # @!attribute [rw] logging_enabled # @return [Types::LoggingEnabled] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/BucketLoggingStatus AWS API Documentation # class BucketLoggingStatus < Struct.new( :logging_enabled) include Aws::Structure end # Describes the cross-origin access configuration for objects in an # Amazon S3 bucket. For more information, see [Enabling Cross-Origin # Resource Sharing][1] in the *Amazon Simple Storage Service Developer # Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html # # @note When making an API call, you may pass CORSConfiguration # data as a hash: # # { # cors_rules: [ # required # { # allowed_headers: ["AllowedHeader"], # allowed_methods: ["AllowedMethod"], # required # allowed_origins: ["AllowedOrigin"], # required # expose_headers: ["ExposeHeader"], # max_age_seconds: 1, # }, # ], # } # # @!attribute [rw] cors_rules # A set of allowed origins and methods. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CORSConfiguration AWS API Documentation # class CORSConfiguration < Struct.new( :cors_rules) include Aws::Structure end # Specifies a cross-origin access rule for an Amazon S3 bucket. # # @note When making an API call, you may pass CORSRule # data as a hash: # # { # allowed_headers: ["AllowedHeader"], # allowed_methods: ["AllowedMethod"], # required # allowed_origins: ["AllowedOrigin"], # required # expose_headers: ["ExposeHeader"], # max_age_seconds: 1, # } # # @!attribute [rw] allowed_headers # Headers that are specified in the `Access-Control-Request-Headers` # header. These headers are allowed in a preflight OPTIONS request. In # response to any preflight OPTIONS request, Amazon S3 returns any # requested headers that are allowed. # @return [Array] # # @!attribute [rw] allowed_methods # An HTTP method that you allow the origin to execute. Valid values # are `GET`, `PUT`, `HEAD`, `POST`, and `DELETE`. # @return [Array] # # @!attribute [rw] allowed_origins # One or more origins you want customers to be able to access the # bucket from. # @return [Array] # # @!attribute [rw] expose_headers # One or more headers in the response that you want customers to be # able to access from their applications (for example, from a # JavaScript `XMLHttpRequest` object). # @return [Array] # # @!attribute [rw] max_age_seconds # The time in seconds that your browser is to cache the preflight # response for the specified resource. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CORSRule AWS API Documentation # class CORSRule < Struct.new( :allowed_headers, :allowed_methods, :allowed_origins, :expose_headers, :max_age_seconds) include Aws::Structure end # Describes how a CSV-formatted input object is formatted. # # @note When making an API call, you may pass CSVInput # data as a hash: # # { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # } # # @!attribute [rw] file_header_info # Describes the first line of input. Valid values: None, Ignore, Use. # @return [String] # # @!attribute [rw] comments # The single character used to indicate a row should be ignored when # present at the start of a row. # @return [String] # # @!attribute [rw] quote_escape_character # The single character used for escaping the quote character inside an # already escaped value. # @return [String] # # @!attribute [rw] record_delimiter # The value used to separate individual records. # @return [String] # # @!attribute [rw] field_delimiter # The value used to separate individual fields in a record. # @return [String] # # @!attribute [rw] quote_character # Value used for escaping where the field delimiter is part of the # value. # @return [String] # # @!attribute [rw] allow_quoted_record_delimiter # Specifies that CSV field values may contain quoted record delimiters # and such records should be allowed. Default value is FALSE. Setting # this value to TRUE may lower performance. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CSVInput AWS API Documentation # class CSVInput < Struct.new( :file_header_info, :comments, :quote_escape_character, :record_delimiter, :field_delimiter, :quote_character, :allow_quoted_record_delimiter) include Aws::Structure end # Describes how CSV-formatted results are formatted. # # @note When making an API call, you may pass CSVOutput # data as a hash: # # { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # } # # @!attribute [rw] quote_fields # Indicates whether or not all output fields should be quoted. # @return [String] # # @!attribute [rw] quote_escape_character # Th single character used for escaping the quote character inside an # already escaped value. # @return [String] # # @!attribute [rw] record_delimiter # The value used to separate individual records. # @return [String] # # @!attribute [rw] field_delimiter # The value used to separate individual fields in a record. # @return [String] # # @!attribute [rw] quote_character # The value used for escaping where the field delimiter is part of the # value. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CSVOutput AWS API Documentation # class CSVOutput < Struct.new( :quote_fields, :quote_escape_character, :record_delimiter, :field_delimiter, :quote_character) include Aws::Structure end # @note When making an API call, you may pass CloudFunctionConfiguration # data as a hash: # # { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # cloud_function: "CloudFunction", # invocation_role: "CloudFunctionInvocationRole", # } # # @!attribute [rw] id # An optional unique identifier for configurations in a notification # configuration. If you don't provide one, Amazon S3 will assign an # ID. # @return [String] # # @!attribute [rw] event # The bucket event for which to send notifications. # @return [String] # # @!attribute [rw] events # @return [Array] # # @!attribute [rw] cloud_function # @return [String] # # @!attribute [rw] invocation_role # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CloudFunctionConfiguration AWS API Documentation # class CloudFunctionConfiguration < Struct.new( :id, :event, :events, :cloud_function, :invocation_role) include Aws::Structure end # @!attribute [rw] prefix # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CommonPrefix AWS API Documentation # class CommonPrefix < Struct.new( :prefix) include Aws::Structure end # @!attribute [rw] location # @return [String] # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] expiration # If the object expiration is configured, this will contain the # expiration date (expiry-date) and rule ID (rule-id). The value of # rule-id is URL encoded. # @return [String] # # @!attribute [rw] etag # Entity tag of the object. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] version_id # Version of the object. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUploadOutput AWS API Documentation # class CompleteMultipartUploadOutput < Struct.new( :location, :bucket, :key, :expiration, :etag, :server_side_encryption, :version_id, :ssekms_key_id, :request_charged) include Aws::Structure end # @note When making an API call, you may pass CompleteMultipartUploadRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # multipart_upload: { # parts: [ # { # etag: "ETag", # part_number: 1, # }, # ], # }, # upload_id: "MultipartUploadId", # required # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] multipart_upload # @return [Types::CompletedMultipartUpload] # # @!attribute [rw] upload_id # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUploadRequest AWS API Documentation # class CompleteMultipartUploadRequest < Struct.new( :bucket, :key, :multipart_upload, :upload_id, :request_payer) include Aws::Structure end # @note When making an API call, you may pass CompletedMultipartUpload # data as a hash: # # { # parts: [ # { # etag: "ETag", # part_number: 1, # }, # ], # } # # @!attribute [rw] parts # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompletedMultipartUpload AWS API Documentation # class CompletedMultipartUpload < Struct.new( :parts) include Aws::Structure end # @note When making an API call, you may pass CompletedPart # data as a hash: # # { # etag: "ETag", # part_number: 1, # } # # @!attribute [rw] etag # Entity tag returned when the part was uploaded. # @return [String] # # @!attribute [rw] part_number # Part number that identifies the part. This is a positive integer # between 1 and 10,000. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompletedPart AWS API Documentation # class CompletedPart < Struct.new( :etag, :part_number) include Aws::Structure end # Specifies a condition that must be met for a redirect to apply. # # @note When making an API call, you may pass Condition # data as a hash: # # { # http_error_code_returned_equals: "HttpErrorCodeReturnedEquals", # key_prefix_equals: "KeyPrefixEquals", # } # # @!attribute [rw] http_error_code_returned_equals # The HTTP error code when the redirect is applied. In the event of an # error, if the error code equals this value, then the specified # redirect is applied. Required when parent element `Condition` is # specified and sibling `KeyPrefixEquals` is not specified. If both # are specified, then both must be true for the redirect to be # applied. # @return [String] # # @!attribute [rw] key_prefix_equals # The object key name prefix when the redirect is applied. For # example, to redirect requests for `ExamplePage.html`, the key prefix # will be `ExamplePage.html`. To redirect request for all pages with # the prefix `docs/`, the key prefix will be `/docs`, which identifies # all objects in the docs/ folder. Required when the parent element # `Condition` is specified and sibling `HttpErrorCodeReturnedEquals` # is not specified. If both conditions are specified, both must be # true for the redirect to be applied. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Condition AWS API Documentation # class Condition < Struct.new( :http_error_code_returned_equals, :key_prefix_equals) include Aws::Structure end # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ContinuationEvent AWS API Documentation # class ContinuationEvent < Struct.new( :event_type) include Aws::Structure end # @!attribute [rw] copy_object_result # @return [Types::CopyObjectResult] # # @!attribute [rw] expiration # If the object expiration is configured, the response includes this # header. # @return [String] # # @!attribute [rw] copy_source_version_id # @return [String] # # @!attribute [rw] version_id # Version ID of the newly created copy. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] ssekms_encryption_context # If present, specifies the AWS KMS Encryption Context to use for # object encryption. The value of this header is a base64-encoded # UTF-8 string holding JSON with the encryption context key-value # pairs. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectOutput AWS API Documentation # class CopyObjectOutput < Struct.new( :copy_object_result, :expiration, :copy_source_version_id, :version_id, :server_side_encryption, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :ssekms_encryption_context, :request_charged) include Aws::Structure end # @note When making an API call, you may pass CopyObjectRequest # data as a hash: # # { # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # bucket: "BucketName", # required # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # metadata_directive: "COPY", # accepts COPY, REPLACE # tagging_directive: "COPY", # accepts COPY, REPLACE # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # } # # @!attribute [rw] acl # The canned ACL to apply to the object. # @return [String] # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] cache_control # Specifies caching behavior along the request/reply chain. # @return [String] # # @!attribute [rw] content_disposition # Specifies presentational information for the object. # @return [String] # # @!attribute [rw] content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the # media-type referenced by the Content-Type header field. # @return [String] # # @!attribute [rw] content_language # The language the content is in. # @return [String] # # @!attribute [rw] content_type # A standard MIME type describing the format of the object data. # @return [String] # # @!attribute [rw] copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # @return [String] # # @!attribute [rw] copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified # tag. # @return [String] # # @!attribute [rw] copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # @return [Time] # # @!attribute [rw] copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # @return [String] # # @!attribute [rw] copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # @return [Time] # # @!attribute [rw] expires # The date and time at which the object is no longer cacheable. # @return [Time] # # @!attribute [rw] grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @return [String] # # @!attribute [rw] grant_read # Allows grantee to read the object data and its metadata. # @return [String] # # @!attribute [rw] grant_read_acp # Allows grantee to read the object ACL. # @return [String] # # @!attribute [rw] grant_write_acp # Allows grantee to write the ACL for the applicable object. # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] metadata # A map of metadata to store with the object in S3. # @return [Hash] # # @!attribute [rw] metadata_directive # Specifies whether the metadata is copied from the source object or # replaced with metadata provided in the request. # @return [String] # # @!attribute [rw] tagging_directive # Specifies whether the object tag-set are copied from the source # object or replaced with tag-set provided in the request. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @return [String] # # @!attribute [rw] website_redirect_location # If the bucket is configured as a website, redirects requests for # this object to another object in the same bucket or to an external # URL. Amazon S3 stores the value of this header in the object # metadata. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET # and PUT requests for an object protected by AWS KMS will fail if not # made via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @return [String] # # @!attribute [rw] ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object # encryption. The value of this header is a base64-encoded UTF-8 # string holding JSON with the encryption context key-value pairs. # @return [String] # # @!attribute [rw] copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # @return [String] # # @!attribute [rw] copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # to decrypt the source object. The encryption key provided in this # header must be one that was used when the source object was created. # @return [String] # # @!attribute [rw] copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] tagging # The tag-set for the object destination object this value must be # used in conjunction with the TaggingDirective. The tag-set must be # encoded as URL Query parameters # @return [String] # # @!attribute [rw] object_lock_mode # The object lock mode that you want to apply to the copied object. # @return [String] # # @!attribute [rw] object_lock_retain_until_date # The date and time when you want the copied object's object lock to # expire. # @return [Time] # # @!attribute [rw] object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the copied # object. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectRequest AWS API Documentation # class CopyObjectRequest < Struct.new( :acl, :bucket, :cache_control, :content_disposition, :content_encoding, :content_language, :content_type, :copy_source, :copy_source_if_match, :copy_source_if_modified_since, :copy_source_if_none_match, :copy_source_if_unmodified_since, :expires, :grant_full_control, :grant_read, :grant_read_acp, :grant_write_acp, :key, :metadata, :metadata_directive, :tagging_directive, :server_side_encryption, :storage_class, :website_redirect_location, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :ssekms_key_id, :ssekms_encryption_context, :copy_source_sse_customer_algorithm, :copy_source_sse_customer_key, :copy_source_sse_customer_key_md5, :request_payer, :tagging, :object_lock_mode, :object_lock_retain_until_date, :object_lock_legal_hold_status) include Aws::Structure end # @!attribute [rw] etag # @return [String] # # @!attribute [rw] last_modified # @return [Time] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObjectResult AWS API Documentation # class CopyObjectResult < Struct.new( :etag, :last_modified) include Aws::Structure end # @!attribute [rw] etag # Entity tag of the object. # @return [String] # # @!attribute [rw] last_modified # Date and time at which the object was uploaded. # @return [Time] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyPartResult AWS API Documentation # class CopyPartResult < Struct.new( :etag, :last_modified) include Aws::Structure end # @note When making an API call, you may pass CreateBucketConfiguration # data as a hash: # # { # location_constraint: "EU", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 # } # # @!attribute [rw] location_constraint # Specifies the region where the bucket will be created. If you don't # specify a region, the bucket is created in US East (N. Virginia) # Region (us-east-1). # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketConfiguration AWS API Documentation # class CreateBucketConfiguration < Struct.new( :location_constraint) include Aws::Structure end # @!attribute [rw] location # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketOutput AWS API Documentation # class CreateBucketOutput < Struct.new( :location) include Aws::Structure end # @note When making an API call, you may pass CreateBucketRequest # data as a hash: # # { # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # bucket: "BucketName", # required # create_bucket_configuration: { # location_constraint: "EU", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 # }, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # object_lock_enabled_for_bucket: false, # } # # @!attribute [rw] acl # The canned ACL to apply to the bucket. # @return [String] # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] create_bucket_configuration # @return [Types::CreateBucketConfiguration] # # @!attribute [rw] grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions # on the bucket. # @return [String] # # @!attribute [rw] grant_read # Allows grantee to list the objects in the bucket. # @return [String] # # @!attribute [rw] grant_read_acp # Allows grantee to read the bucket ACL. # @return [String] # # @!attribute [rw] grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @return [String] # # @!attribute [rw] grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @return [String] # # @!attribute [rw] object_lock_enabled_for_bucket # Specifies whether you want Amazon S3 object lock to be enabled for # the new bucket. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucketRequest AWS API Documentation # class CreateBucketRequest < Struct.new( :acl, :bucket, :create_bucket_configuration, :grant_full_control, :grant_read, :grant_read_acp, :grant_write, :grant_write_acp, :object_lock_enabled_for_bucket) include Aws::Structure end # @!attribute [rw] abort_date # Date when multipart upload will become eligible for abort operation # by lifecycle. # @return [Time] # # @!attribute [rw] abort_rule_id # Id of the lifecycle rule that makes a multipart upload eligible for # abort operation. # @return [String] # # @!attribute [rw] bucket # Name of the bucket to which the multipart upload was initiated. # @return [String] # # @!attribute [rw] key # Object key for which the multipart upload was initiated. # @return [String] # # @!attribute [rw] upload_id # ID for the initiated multipart upload. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] ssekms_encryption_context # If present, specifies the AWS KMS Encryption Context to use for # object encryption. The value of this header is a base64-encoded # UTF-8 string holding JSON with the encryption context key-value # pairs. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUploadOutput AWS API Documentation # class CreateMultipartUploadOutput < Struct.new( :abort_date, :abort_rule_id, :bucket, :key, :upload_id, :server_side_encryption, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :ssekms_encryption_context, :request_charged) include Aws::Structure end # @note When making an API call, you may pass CreateMultipartUploadRequest # data as a hash: # # { # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # bucket: "BucketName", # required # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # } # # @!attribute [rw] acl # The canned ACL to apply to the object. # @return [String] # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] cache_control # Specifies caching behavior along the request/reply chain. # @return [String] # # @!attribute [rw] content_disposition # Specifies presentational information for the object. # @return [String] # # @!attribute [rw] content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the # media-type referenced by the Content-Type header field. # @return [String] # # @!attribute [rw] content_language # The language the content is in. # @return [String] # # @!attribute [rw] content_type # A standard MIME type describing the format of the object data. # @return [String] # # @!attribute [rw] expires # The date and time at which the object is no longer cacheable. # @return [Time] # # @!attribute [rw] grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @return [String] # # @!attribute [rw] grant_read # Allows grantee to read the object data and its metadata. # @return [String] # # @!attribute [rw] grant_read_acp # Allows grantee to read the object ACL. # @return [String] # # @!attribute [rw] grant_write_acp # Allows grantee to write the ACL for the applicable object. # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] metadata # A map of metadata to store with the object in S3. # @return [Hash] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @return [String] # # @!attribute [rw] website_redirect_location # If the bucket is configured as a website, redirects requests for # this object to another object in the same bucket or to an external # URL. Amazon S3 stores the value of this header in the object # metadata. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET # and PUT requests for an object protected by AWS KMS will fail if not # made via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @return [String] # # @!attribute [rw] ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object # encryption. The value of this header is a base64-encoded UTF-8 # string holding JSON with the encryption context key-value pairs. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters # @return [String] # # @!attribute [rw] object_lock_mode # Specifies the object lock mode that you want to apply to the # uploaded object. # @return [String] # # @!attribute [rw] object_lock_retain_until_date # Specifies the date and time when you want the object lock to expire. # @return [Time] # # @!attribute [rw] object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the uploaded # object. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUploadRequest AWS API Documentation # class CreateMultipartUploadRequest < Struct.new( :acl, :bucket, :cache_control, :content_disposition, :content_encoding, :content_language, :content_type, :expires, :grant_full_control, :grant_read, :grant_read_acp, :grant_write_acp, :key, :metadata, :server_side_encryption, :storage_class, :website_redirect_location, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :ssekms_key_id, :ssekms_encryption_context, :request_payer, :tagging, :object_lock_mode, :object_lock_retain_until_date, :object_lock_legal_hold_status) include Aws::Structure end # The container element for specifying the default object lock retention # settings for new objects placed in the specified bucket. # # @note When making an API call, you may pass DefaultRetention # data as a hash: # # { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # days: 1, # years: 1, # } # # @!attribute [rw] mode # The default object lock retention mode you want to apply to new # objects placed in the specified bucket. # @return [String] # # @!attribute [rw] days # The number of days that you want to specify for the default # retention period. # @return [Integer] # # @!attribute [rw] years # The number of years that you want to specify for the default # retention period. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DefaultRetention AWS API Documentation # class DefaultRetention < Struct.new( :mode, :days, :years) include Aws::Structure end # @note When making an API call, you may pass Delete # data as a hash: # # { # objects: [ # required # { # key: "ObjectKey", # required # version_id: "ObjectVersionId", # }, # ], # quiet: false, # } # # @!attribute [rw] objects # @return [Array] # # @!attribute [rw] quiet # Element to enable quiet mode for the request. When you add this # element, you must set its value to true. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Delete AWS API Documentation # class Delete < Struct.new( :objects, :quiet) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketAnalyticsConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "AnalyticsId", # required # } # # @!attribute [rw] bucket # The name of the bucket from which an analytics configuration is # deleted. # @return [String] # # @!attribute [rw] id # The ID that identifies the analytics configuration. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfigurationRequest AWS API Documentation # class DeleteBucketAnalyticsConfigurationRequest < Struct.new( :bucket, :id) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketCorsRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCorsRequest AWS API Documentation # class DeleteBucketCorsRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketEncryptionRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The name of the bucket containing the server-side encryption # configuration to delete. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketEncryptionRequest AWS API Documentation # class DeleteBucketEncryptionRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketInventoryConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "InventoryId", # required # } # # @!attribute [rw] bucket # The name of the bucket containing the inventory configuration to # delete. # @return [String] # # @!attribute [rw] id # The ID used to identify the inventory configuration. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfigurationRequest AWS API Documentation # class DeleteBucketInventoryConfigurationRequest < Struct.new( :bucket, :id) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketLifecycleRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycleRequest AWS API Documentation # class DeleteBucketLifecycleRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketMetricsConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "MetricsId", # required # } # # @!attribute [rw] bucket # The name of the bucket containing the metrics configuration to # delete. # @return [String] # # @!attribute [rw] id # The ID used to identify the metrics configuration. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfigurationRequest AWS API Documentation # class DeleteBucketMetricsConfigurationRequest < Struct.new( :bucket, :id) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketPolicyRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicyRequest AWS API Documentation # class DeleteBucketPolicyRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketReplicationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The bucket name. # # It can take a while to propagate the deletion of a replication # configuration to all Amazon S3 systems. # # # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplicationRequest AWS API Documentation # class DeleteBucketReplicationRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketRequest AWS API Documentation # class DeleteBucketRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketTaggingRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTaggingRequest AWS API Documentation # class DeleteBucketTaggingRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass DeleteBucketWebsiteRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsiteRequest AWS API Documentation # class DeleteBucketWebsiteRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] owner # @return [Types::Owner] # # @!attribute [rw] key # The object key. # @return [String] # # @!attribute [rw] version_id # Version ID of an object. # @return [String] # # @!attribute [rw] is_latest # Specifies whether the object is (true) or is not (false) the latest # version of an object. # @return [Boolean] # # @!attribute [rw] last_modified # Date and time the object was last modified. # @return [Time] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteMarkerEntry AWS API Documentation # class DeleteMarkerEntry < Struct.new( :owner, :key, :version_id, :is_latest, :last_modified) include Aws::Structure end # Specifies whether Amazon S3 should replicate delete makers. # # @note When making an API call, you may pass DeleteMarkerReplication # data as a hash: # # { # status: "Enabled", # accepts Enabled, Disabled # } # # @!attribute [rw] status # The status of the delete marker replication. # # In the current implementation, Amazon S3 doesn't replicate the # delete markers. The status must be `Disabled`. # # # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteMarkerReplication AWS API Documentation # class DeleteMarkerReplication < Struct.new( :status) include Aws::Structure end # @!attribute [rw] delete_marker # Specifies whether the versioned object that was permanently deleted # was (true) or was not (false) a delete marker. # @return [Boolean] # # @!attribute [rw] version_id # Returns the version ID of the delete marker created as a result of # the DELETE operation. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectOutput AWS API Documentation # class DeleteObjectOutput < Struct.new( :delete_marker, :version_id, :request_charged) include Aws::Structure end # @note When making an API call, you may pass DeleteObjectRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # mfa: "MFA", # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication # device. # @return [String] # # @!attribute [rw] version_id # VersionId used to reference a specific version of the object. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] bypass_governance_retention # Indicates whether Amazon S3 object lock should bypass # governance-mode restrictions to process this operation. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectRequest AWS API Documentation # class DeleteObjectRequest < Struct.new( :bucket, :key, :mfa, :version_id, :request_payer, :bypass_governance_retention) include Aws::Structure end # @!attribute [rw] version_id # The versionId of the object the tag-set was removed from. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTaggingOutput AWS API Documentation # class DeleteObjectTaggingOutput < Struct.new( :version_id) include Aws::Structure end # @note When making an API call, you may pass DeleteObjectTaggingRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # The versionId of the object that the tag-set will be removed from. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTaggingRequest AWS API Documentation # class DeleteObjectTaggingRequest < Struct.new( :bucket, :key, :version_id) include Aws::Structure end # @!attribute [rw] deleted # @return [Array] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @!attribute [rw] errors # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectsOutput AWS API Documentation # class DeleteObjectsOutput < Struct.new( :deleted, :request_charged, :errors) include Aws::Structure end # @note When making an API call, you may pass DeleteObjectsRequest # data as a hash: # # { # bucket: "BucketName", # required # delete: { # required # objects: [ # required # { # key: "ObjectKey", # required # version_id: "ObjectVersionId", # }, # ], # quiet: false, # }, # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] delete # @return [Types::Delete] # # @!attribute [rw] mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication # device. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] bypass_governance_retention # Specifies whether you want to delete this object even if it has a # Governance-type object lock in place. You must have sufficient # permissions to perform this operation. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectsRequest AWS API Documentation # class DeleteObjectsRequest < Struct.new( :bucket, :delete, :mfa, :request_payer, :bypass_governance_retention) include Aws::Structure end # @note When making an API call, you may pass DeletePublicAccessBlockRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The Amazon S3 bucket whose `PublicAccessBlock` configuration you # want to delete. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletePublicAccessBlockRequest AWS API Documentation # class DeletePublicAccessBlockRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # @return [String] # # @!attribute [rw] delete_marker # @return [Boolean] # # @!attribute [rw] delete_marker_version_id # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletedObject AWS API Documentation # class DeletedObject < Struct.new( :key, :version_id, :delete_marker, :delete_marker_version_id) include Aws::Structure end # Specifies information about where to publish analysis or configuration # results for an Amazon S3 bucket. # # @note When making an API call, you may pass Destination # data as a hash: # # { # bucket: "BucketName", # required # account: "AccountId", # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # access_control_translation: { # owner: "Destination", # required, accepts Destination # }, # encryption_configuration: { # replica_kms_key_id: "ReplicaKmsKeyID", # }, # } # # @!attribute [rw] bucket # The Amazon Resource Name (ARN) of the bucket where you want Amazon # S3 to store replicas of the object identified by the rule. # # A replication configuration can replicate objects to only one # destination bucket. If there are multiple rules in your replication # configuration, all rules must specify the same destination bucket. # @return [String] # # @!attribute [rw] account # Destination bucket owner account ID. In a cross-account scenario, if # you direct Amazon S3 to change replica ownership to the AWS account # that owns the destination bucket by specifying the # `AccessControlTranslation` property, this is the account ID of the # destination bucket owner. For more information, see [Cross-Region # Replication Additional Configuration: Change Replica Owner][1] in # the *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html # @return [String] # # @!attribute [rw] storage_class # The storage class to use when replicating objects, such as standard # or reduced redundancy. By default, Amazon S3 uses the storage class # of the source object to create the object replica. # # For valid values, see the `StorageClass` element of the [PUT Bucket # replication][1] action in the *Amazon Simple Storage Service API # Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html # @return [String] # # @!attribute [rw] access_control_translation # Specify this only in a cross-account scenario (where source and # destination bucket owners are not the same), and you want to change # replica ownership to the AWS account that owns the destination # bucket. If this is not specified in the replication configuration, # the replicas are owned by same AWS account that owns the source # object. # @return [Types::AccessControlTranslation] # # @!attribute [rw] encryption_configuration # A container that provides information about encryption. If # `SourceSelectionCriteria` is specified, you must specify this # element. # @return [Types::EncryptionConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Destination AWS API Documentation # class Destination < Struct.new( :bucket, :account, :storage_class, :access_control_translation, :encryption_configuration) include Aws::Structure end # Describes the server-side encryption that will be applied to the # restore results. # # @note When making an API call, you may pass Encryption # data as a hash: # # { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # } # # @!attribute [rw] encryption_type # The server-side encryption algorithm used when storing job results # in Amazon S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] kms_key_id # If the encryption type is aws:kms, this optional value specifies the # AWS KMS key ID to use for encryption of job results. # @return [String] # # @!attribute [rw] kms_context # If the encryption type is aws:kms, this optional value can be used # to specify the encryption context for the restore results. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Encryption AWS API Documentation # class Encryption < Struct.new( :encryption_type, :kms_key_id, :kms_context) include Aws::Structure end # Specifies encryption-related information for an Amazon S3 bucket that # is a destination for replicated objects. # # @note When making an API call, you may pass EncryptionConfiguration # data as a hash: # # { # replica_kms_key_id: "ReplicaKmsKeyID", # } # # @!attribute [rw] replica_kms_key_id # Specifies the AWS KMS Key ID (Key ARN or Alias ARN) for the # destination bucket. Amazon S3 uses this key to encrypt replica # objects. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/EncryptionConfiguration AWS API Documentation # class EncryptionConfiguration < Struct.new( :replica_kms_key_id) include Aws::Structure end # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/EndEvent AWS API Documentation # class EndEvent < Struct.new( :event_type) include Aws::Structure end # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # @return [String] # # @!attribute [rw] code # @return [String] # # @!attribute [rw] message # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Error AWS API Documentation # class Error < Struct.new( :key, :version_id, :code, :message) include Aws::Structure end # @note When making an API call, you may pass ErrorDocument # data as a hash: # # { # key: "ObjectKey", # required # } # # @!attribute [rw] key # The object key name to use when a 4XX class error occurs. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ErrorDocument AWS API Documentation # class ErrorDocument < Struct.new( :key) include Aws::Structure end # Specifies the Amazon S3 object key name to filter on and whether to # filter on the suffix or prefix of the key name. # # @note When making an API call, you may pass FilterRule # data as a hash: # # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # } # # @!attribute [rw] name # The object key name prefix or suffix identifying one or more objects # to which the filtering rule applies. The maximum length is 1,024 # characters. Overlapping prefixes and suffixes are not supported. For # more information, see [Configuring Event Notifications][1] in the # *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html # @return [String] # # @!attribute [rw] value # The value that the filter searches for in object key names. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/FilterRule AWS API Documentation # class FilterRule < Struct.new( :name, :value) include Aws::Structure end # @!attribute [rw] status # The accelerate configuration of the bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationOutput AWS API Documentation # class GetBucketAccelerateConfigurationOutput < Struct.new( :status) include Aws::Structure end # @note When making an API call, you may pass GetBucketAccelerateConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # Name of the bucket for which the accelerate configuration is # retrieved. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfigurationRequest AWS API Documentation # class GetBucketAccelerateConfigurationRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] owner # @return [Types::Owner] # # @!attribute [rw] grants # A list of grants. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclOutput AWS API Documentation # class GetBucketAclOutput < Struct.new( :owner, :grants) include Aws::Structure end # @note When making an API call, you may pass GetBucketAclRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAclRequest AWS API Documentation # class GetBucketAclRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] analytics_configuration # The configuration and any analyses for the analytics filter. # @return [Types::AnalyticsConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfigurationOutput AWS API Documentation # class GetBucketAnalyticsConfigurationOutput < Struct.new( :analytics_configuration) include Aws::Structure end # @note When making an API call, you may pass GetBucketAnalyticsConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "AnalyticsId", # required # } # # @!attribute [rw] bucket # The name of the bucket from which an analytics configuration is # retrieved. # @return [String] # # @!attribute [rw] id # The ID that identifies the analytics configuration. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfigurationRequest AWS API Documentation # class GetBucketAnalyticsConfigurationRequest < Struct.new( :bucket, :id) include Aws::Structure end # @!attribute [rw] cors_rules # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsOutput AWS API Documentation # class GetBucketCorsOutput < Struct.new( :cors_rules) include Aws::Structure end # @note When making an API call, you may pass GetBucketCorsRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCorsRequest AWS API Documentation # class GetBucketCorsRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] server_side_encryption_configuration # @return [Types::ServerSideEncryptionConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryptionOutput AWS API Documentation # class GetBucketEncryptionOutput < Struct.new( :server_side_encryption_configuration) include Aws::Structure end # @note When making an API call, you may pass GetBucketEncryptionRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The name of the bucket from which the server-side encryption # configuration is retrieved. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryptionRequest AWS API Documentation # class GetBucketEncryptionRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] inventory_configuration # Specifies the inventory configuration. # @return [Types::InventoryConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfigurationOutput AWS API Documentation # class GetBucketInventoryConfigurationOutput < Struct.new( :inventory_configuration) include Aws::Structure end # @note When making an API call, you may pass GetBucketInventoryConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "InventoryId", # required # } # # @!attribute [rw] bucket # The name of the bucket containing the inventory configuration to # retrieve. # @return [String] # # @!attribute [rw] id # The ID used to identify the inventory configuration. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfigurationRequest AWS API Documentation # class GetBucketInventoryConfigurationRequest < Struct.new( :bucket, :id) include Aws::Structure end # @!attribute [rw] rules # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationOutput AWS API Documentation # class GetBucketLifecycleConfigurationOutput < Struct.new( :rules) include Aws::Structure end # @note When making an API call, you may pass GetBucketLifecycleConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfigurationRequest AWS API Documentation # class GetBucketLifecycleConfigurationRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] rules # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleOutput AWS API Documentation # class GetBucketLifecycleOutput < Struct.new( :rules) include Aws::Structure end # @note When making an API call, you may pass GetBucketLifecycleRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleRequest AWS API Documentation # class GetBucketLifecycleRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] location_constraint # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationOutput AWS API Documentation # class GetBucketLocationOutput < Struct.new( :location_constraint) include Aws::Structure end # @note When making an API call, you may pass GetBucketLocationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocationRequest AWS API Documentation # class GetBucketLocationRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] logging_enabled # @return [Types::LoggingEnabled] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingOutput AWS API Documentation # class GetBucketLoggingOutput < Struct.new( :logging_enabled) include Aws::Structure end # @note When making an API call, you may pass GetBucketLoggingRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLoggingRequest AWS API Documentation # class GetBucketLoggingRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] metrics_configuration # Specifies the metrics configuration. # @return [Types::MetricsConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfigurationOutput AWS API Documentation # class GetBucketMetricsConfigurationOutput < Struct.new( :metrics_configuration) include Aws::Structure end # @note When making an API call, you may pass GetBucketMetricsConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "MetricsId", # required # } # # @!attribute [rw] bucket # The name of the bucket containing the metrics configuration to # retrieve. # @return [String] # # @!attribute [rw] id # The ID used to identify the metrics configuration. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfigurationRequest AWS API Documentation # class GetBucketMetricsConfigurationRequest < Struct.new( :bucket, :id) include Aws::Structure end # @note When making an API call, you may pass GetBucketNotificationConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # Name of the bucket to get the notification configuration for. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfigurationRequest AWS API Documentation # class GetBucketNotificationConfigurationRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] policy # The bucket policy as a JSON document. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyOutput AWS API Documentation # class GetBucketPolicyOutput < Struct.new( :policy) include Aws::Structure end # @note When making an API call, you may pass GetBucketPolicyRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyRequest AWS API Documentation # class GetBucketPolicyRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] policy_status # The policy status for the specified bucket. # @return [Types::PolicyStatus] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyStatusOutput AWS API Documentation # class GetBucketPolicyStatusOutput < Struct.new( :policy_status) include Aws::Structure end # @note When making an API call, you may pass GetBucketPolicyStatusRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The name of the Amazon S3 bucket whose policy status you want to # retrieve. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyStatusRequest AWS API Documentation # class GetBucketPolicyStatusRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] replication_configuration # @return [Types::ReplicationConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationOutput AWS API Documentation # class GetBucketReplicationOutput < Struct.new( :replication_configuration) include Aws::Structure end # @note When making an API call, you may pass GetBucketReplicationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplicationRequest AWS API Documentation # class GetBucketReplicationRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] payer # Specifies who pays for the download and request fees. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentOutput AWS API Documentation # class GetBucketRequestPaymentOutput < Struct.new( :payer) include Aws::Structure end # @note When making an API call, you may pass GetBucketRequestPaymentRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPaymentRequest AWS API Documentation # class GetBucketRequestPaymentRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] tag_set # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingOutput AWS API Documentation # class GetBucketTaggingOutput < Struct.new( :tag_set) include Aws::Structure end # @note When making an API call, you may pass GetBucketTaggingRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTaggingRequest AWS API Documentation # class GetBucketTaggingRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] status # The versioning state of the bucket. # @return [String] # # @!attribute [rw] mfa_delete # Specifies whether MFA delete is enabled in the bucket versioning # configuration. This element is only returned if the bucket has been # configured with MFA delete. If the bucket has never been so # configured, this element is not returned. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningOutput AWS API Documentation # class GetBucketVersioningOutput < Struct.new( :status, :mfa_delete) include Aws::Structure end # @note When making an API call, you may pass GetBucketVersioningRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioningRequest AWS API Documentation # class GetBucketVersioningRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] redirect_all_requests_to # @return [Types::RedirectAllRequestsTo] # # @!attribute [rw] index_document # @return [Types::IndexDocument] # # @!attribute [rw] error_document # @return [Types::ErrorDocument] # # @!attribute [rw] routing_rules # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteOutput AWS API Documentation # class GetBucketWebsiteOutput < Struct.new( :redirect_all_requests_to, :index_document, :error_document, :routing_rules) include Aws::Structure end # @note When making an API call, you may pass GetBucketWebsiteRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsiteRequest AWS API Documentation # class GetBucketWebsiteRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] owner # @return [Types::Owner] # # @!attribute [rw] grants # A list of grants. # @return [Array] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAclOutput AWS API Documentation # class GetObjectAclOutput < Struct.new( :owner, :grants, :request_charged) include Aws::Structure end # @note When making an API call, you may pass GetObjectAclRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # VersionId used to reference a specific version of the object. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAclRequest AWS API Documentation # class GetObjectAclRequest < Struct.new( :bucket, :key, :version_id, :request_payer) include Aws::Structure end # @!attribute [rw] legal_hold # The current Legal Hold status for the specified object. # @return [Types::ObjectLockLegalHold] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLegalHoldOutput AWS API Documentation # class GetObjectLegalHoldOutput < Struct.new( :legal_hold) include Aws::Structure end # @note When making an API call, you may pass GetObjectLegalHoldRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # The bucket containing the object whose Legal Hold status you want to # retrieve. # @return [String] # # @!attribute [rw] key # The key name for the object whose Legal Hold status you want to # retrieve. # @return [String] # # @!attribute [rw] version_id # The version ID of the object whose Legal Hold status you want to # retrieve. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLegalHoldRequest AWS API Documentation # class GetObjectLegalHoldRequest < Struct.new( :bucket, :key, :version_id, :request_payer) include Aws::Structure end # @!attribute [rw] object_lock_configuration # The specified bucket's object lock configuration. # @return [Types::ObjectLockConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLockConfigurationOutput AWS API Documentation # class GetObjectLockConfigurationOutput < Struct.new( :object_lock_configuration) include Aws::Structure end # @note When making an API call, you may pass GetObjectLockConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The bucket whose object lock configuration you want to retrieve. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLockConfigurationRequest AWS API Documentation # class GetObjectLockConfigurationRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] body # Object data. # @return [IO] # # @!attribute [rw] delete_marker # Specifies whether the object retrieved was (true) or was not (false) # a Delete Marker. If false, this response header does not appear in # the response. # @return [Boolean] # # @!attribute [rw] accept_ranges # @return [String] # # @!attribute [rw] expiration # If the object expiration is configured (see PUT Bucket lifecycle), # the response includes this header. It includes the expiry-date and # rule-id key value pairs providing object expiration information. The # value of the rule-id is URL encoded. # @return [String] # # @!attribute [rw] restore # Provides information about object restoration operation and # expiration time of the restored object copy. # @return [String] # # @!attribute [rw] last_modified # Last modified date of the object # @return [Time] # # @!attribute [rw] content_length # Size of the body in bytes. # @return [Integer] # # @!attribute [rw] etag # An ETag is an opaque identifier assigned by a web server to a # specific version of a resource found at a URL # @return [String] # # @!attribute [rw] missing_meta # This is set to the number of metadata entries not returned in # x-amz-meta headers. This can happen if you create metadata using an # API like SOAP that supports more flexible metadata than the REST # API. For example, using SOAP, you can create metadata whose values # are not legal HTTP headers. # @return [Integer] # # @!attribute [rw] version_id # Version of the object. # @return [String] # # @!attribute [rw] cache_control # Specifies caching behavior along the request/reply chain. # @return [String] # # @!attribute [rw] content_disposition # Specifies presentational information for the object. # @return [String] # # @!attribute [rw] content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the # media-type referenced by the Content-Type header field. # @return [String] # # @!attribute [rw] content_language # The language the content is in. # @return [String] # # @!attribute [rw] content_range # The portion of the object returned in the response. # @return [String] # # @!attribute [rw] content_type # A standard MIME type describing the format of the object data. # @return [String] # # @!attribute [rw] expires # The date and time at which the object is no longer cacheable. # @return [Time] # # @!attribute [rw] expires_string # @return [String] # # @!attribute [rw] website_redirect_location # If the bucket is configured as a website, redirects requests for # this object to another object in the same bucket or to an external # URL. Amazon S3 stores the value of this header in the object # metadata. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] metadata # A map of metadata to store with the object in S3. # @return [Hash] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] storage_class # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @!attribute [rw] replication_status # @return [String] # # @!attribute [rw] parts_count # The count of parts this object has. # @return [Integer] # # @!attribute [rw] tag_count # The number of tags, if any, on the object. # @return [Integer] # # @!attribute [rw] object_lock_mode # The object lock mode currently in place for this object. # @return [String] # # @!attribute [rw] object_lock_retain_until_date # The date and time when this object's object lock will expire. # @return [Time] # # @!attribute [rw] object_lock_legal_hold_status # Indicates whether this object has an active legal hold. This field # is only returned if you have permission to view an object's legal # hold status. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectOutput AWS API Documentation # class GetObjectOutput < Struct.new( :body, :delete_marker, :accept_ranges, :expiration, :restore, :last_modified, :content_length, :etag, :missing_meta, :version_id, :cache_control, :content_disposition, :content_encoding, :content_language, :content_range, :content_type, :expires, :expires_string, :website_redirect_location, :server_side_encryption, :metadata, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :storage_class, :request_charged, :replication_status, :parts_count, :tag_count, :object_lock_mode, :object_lock_retain_until_date, :object_lock_legal_hold_status) include Aws::Structure end # @note When making an API call, you may pass GetObjectRequest # data as a hash: # # { # bucket: "BucketName", # required # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # key: "ObjectKey", # required # range: "Range", # response_cache_control: "ResponseCacheControl", # response_content_disposition: "ResponseContentDisposition", # response_content_encoding: "ResponseContentEncoding", # response_content_language: "ResponseContentLanguage", # response_content_type: "ResponseContentType", # response_expires: Time.now, # version_id: "ObjectVersionId", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] if_match # Return the object only if its entity tag (ETag) is the same as the # one specified, otherwise return a 412 (precondition failed). # @return [String] # # @!attribute [rw] if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # @return [Time] # # @!attribute [rw] if_none_match # Return the object only if its entity tag (ETag) is different from # the one specified, otherwise return a 304 (not modified). # @return [String] # # @!attribute [rw] if_unmodified_since # Return the object only if it has not been modified since the # specified time, otherwise return a 412 (precondition failed). # @return [Time] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] range # Downloads the specified range bytes of an object. For more # information about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # @return [String] # # @!attribute [rw] response_cache_control # Sets the Cache-Control header of the response. # @return [String] # # @!attribute [rw] response_content_disposition # Sets the Content-Disposition header of the response # @return [String] # # @!attribute [rw] response_content_encoding # Sets the Content-Encoding header of the response. # @return [String] # # @!attribute [rw] response_content_language # Sets the Content-Language header of the response. # @return [String] # # @!attribute [rw] response_content_type # Sets the Content-Type header of the response. # @return [String] # # @!attribute [rw] response_expires # Sets the Expires header of the response. # @return [Time] # # @!attribute [rw] version_id # VersionId used to reference a specific version of the object. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' GET request # for the part specified. Useful for downloading just a part of an # object. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRequest AWS API Documentation # class GetObjectRequest < Struct.new( :bucket, :if_match, :if_modified_since, :if_none_match, :if_unmodified_since, :key, :range, :response_cache_control, :response_content_disposition, :response_content_encoding, :response_content_language, :response_content_type, :response_expires, :version_id, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :request_payer, :part_number) include Aws::Structure end # @!attribute [rw] retention # The container element for an object's retention settings. # @return [Types::ObjectLockRetention] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRetentionOutput AWS API Documentation # class GetObjectRetentionOutput < Struct.new( :retention) include Aws::Structure end # @note When making an API call, you may pass GetObjectRetentionRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # The bucket containing the object whose retention settings you want # to retrieve. # @return [String] # # @!attribute [rw] key # The key name for the object whose retention settings you want to # retrieve. # @return [String] # # @!attribute [rw] version_id # The version ID for the object whose retention settings you want to # retrieve. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRetentionRequest AWS API Documentation # class GetObjectRetentionRequest < Struct.new( :bucket, :key, :version_id, :request_payer) include Aws::Structure end # @!attribute [rw] version_id # @return [String] # # @!attribute [rw] tag_set # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTaggingOutput AWS API Documentation # class GetObjectTaggingOutput < Struct.new( :version_id, :tag_set) include Aws::Structure end # @note When making an API call, you may pass GetObjectTaggingRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTaggingRequest AWS API Documentation # class GetObjectTaggingRequest < Struct.new( :bucket, :key, :version_id) include Aws::Structure end # @!attribute [rw] body # @return [IO] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrentOutput AWS API Documentation # class GetObjectTorrentOutput < Struct.new( :body, :request_charged) include Aws::Structure end # @note When making an API call, you may pass GetObjectTorrentRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrentRequest AWS API Documentation # class GetObjectTorrentRequest < Struct.new( :bucket, :key, :request_payer) include Aws::Structure end # @!attribute [rw] public_access_block_configuration # The `PublicAccessBlock` configuration currently in effect for this # Amazon S3 bucket. # @return [Types::PublicAccessBlockConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetPublicAccessBlockOutput AWS API Documentation # class GetPublicAccessBlockOutput < Struct.new( :public_access_block_configuration) include Aws::Structure end # @note When making an API call, you may pass GetPublicAccessBlockRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # The name of the Amazon S3 bucket whose `PublicAccessBlock` # configuration you want to retrieve. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetPublicAccessBlockRequest AWS API Documentation # class GetPublicAccessBlockRequest < Struct.new( :bucket) include Aws::Structure end # @note When making an API call, you may pass GlacierJobParameters # data as a hash: # # { # tier: "Standard", # required, accepts Standard, Bulk, Expedited # } # # @!attribute [rw] tier # Glacier retrieval tier at which the restore will be processed. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GlacierJobParameters AWS API Documentation # class GlacierJobParameters < Struct.new( :tier) include Aws::Structure end # @note When making an API call, you may pass Grant # data as a hash: # # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # } # # @!attribute [rw] grantee # @return [Types::Grantee] # # @!attribute [rw] permission # Specifies the permission given to the grantee. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Grant AWS API Documentation # class Grant < Struct.new( :grantee, :permission) include Aws::Structure end # @note When making an API call, you may pass Grantee # data as a hash: # # { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # } # # @!attribute [rw] display_name # Screen name of the grantee. # @return [String] # # @!attribute [rw] email_address # Email address of the grantee. # @return [String] # # @!attribute [rw] id # The canonical user ID of the grantee. # @return [String] # # @!attribute [rw] type # Type of grantee # @return [String] # # @!attribute [rw] uri # URI of the grantee group. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Grantee AWS API Documentation # class Grantee < Struct.new( :display_name, :email_address, :id, :type, :uri) include Aws::Structure end # @note When making an API call, you may pass HeadBucketRequest # data as a hash: # # { # bucket: "BucketName", # required # } # # @!attribute [rw] bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucketRequest AWS API Documentation # class HeadBucketRequest < Struct.new( :bucket) include Aws::Structure end # @!attribute [rw] delete_marker # Specifies whether the object retrieved was (true) or was not (false) # a Delete Marker. If false, this response header does not appear in # the response. # @return [Boolean] # # @!attribute [rw] accept_ranges # @return [String] # # @!attribute [rw] expiration # If the object expiration is configured (see PUT Bucket lifecycle), # the response includes this header. It includes the expiry-date and # rule-id key value pairs providing object expiration information. The # value of the rule-id is URL encoded. # @return [String] # # @!attribute [rw] restore # Provides information about object restoration operation and # expiration time of the restored object copy. # @return [String] # # @!attribute [rw] last_modified # Last modified date of the object # @return [Time] # # @!attribute [rw] content_length # Size of the body in bytes. # @return [Integer] # # @!attribute [rw] etag # An ETag is an opaque identifier assigned by a web server to a # specific version of a resource found at a URL # @return [String] # # @!attribute [rw] missing_meta # This is set to the number of metadata entries not returned in # x-amz-meta headers. This can happen if you create metadata using an # API like SOAP that supports more flexible metadata than the REST # API. For example, using SOAP, you can create metadata whose values # are not legal HTTP headers. # @return [Integer] # # @!attribute [rw] version_id # Version of the object. # @return [String] # # @!attribute [rw] cache_control # Specifies caching behavior along the request/reply chain. # @return [String] # # @!attribute [rw] content_disposition # Specifies presentational information for the object. # @return [String] # # @!attribute [rw] content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the # media-type referenced by the Content-Type header field. # @return [String] # # @!attribute [rw] content_language # The language the content is in. # @return [String] # # @!attribute [rw] content_type # A standard MIME type describing the format of the object data. # @return [String] # # @!attribute [rw] expires # The date and time at which the object is no longer cacheable. # @return [Time] # # @!attribute [rw] expires_string # @return [String] # # @!attribute [rw] website_redirect_location # If the bucket is configured as a website, redirects requests for # this object to another object in the same bucket or to an external # URL. Amazon S3 stores the value of this header in the object # metadata. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] metadata # A map of metadata to store with the object in S3. # @return [Hash] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] storage_class # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @!attribute [rw] replication_status # @return [String] # # @!attribute [rw] parts_count # The count of parts this object has. # @return [Integer] # # @!attribute [rw] object_lock_mode # The object lock mode currently in place for this object. # @return [String] # # @!attribute [rw] object_lock_retain_until_date # The date and time when this object's object lock expires. # @return [Time] # # @!attribute [rw] object_lock_legal_hold_status # The Legal Hold status for the specified object. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObjectOutput AWS API Documentation # class HeadObjectOutput < Struct.new( :delete_marker, :accept_ranges, :expiration, :restore, :last_modified, :content_length, :etag, :missing_meta, :version_id, :cache_control, :content_disposition, :content_encoding, :content_language, :content_type, :expires, :expires_string, :website_redirect_location, :server_side_encryption, :metadata, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :storage_class, :request_charged, :replication_status, :parts_count, :object_lock_mode, :object_lock_retain_until_date, :object_lock_legal_hold_status) include Aws::Structure end # @note When making an API call, you may pass HeadObjectRequest # data as a hash: # # { # bucket: "BucketName", # required # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # key: "ObjectKey", # required # range: "Range", # version_id: "ObjectVersionId", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] if_match # Return the object only if its entity tag (ETag) is the same as the # one specified, otherwise return a 412 (precondition failed). # @return [String] # # @!attribute [rw] if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # @return [Time] # # @!attribute [rw] if_none_match # Return the object only if its entity tag (ETag) is different from # the one specified, otherwise return a 304 (not modified). # @return [String] # # @!attribute [rw] if_unmodified_since # Return the object only if it has not been modified since the # specified time, otherwise return a 412 (precondition failed). # @return [Time] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] range # Downloads the specified range bytes of an object. For more # information about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # @return [String] # # @!attribute [rw] version_id # VersionId used to reference a specific version of the object. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' HEAD request # for the part specified. Useful querying about the size of the part # and the number of parts in this object. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObjectRequest AWS API Documentation # class HeadObjectRequest < Struct.new( :bucket, :if_match, :if_modified_since, :if_none_match, :if_unmodified_since, :key, :range, :version_id, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :request_payer, :part_number) include Aws::Structure end # @note When making an API call, you may pass IndexDocument # data as a hash: # # { # suffix: "Suffix", # required # } # # @!attribute [rw] suffix # A suffix that is appended to a request that is for a directory on # the website endpoint (e.g. if the suffix is index.html and you make # a request to samplebucket/images/ the data that is returned will be # for the object with the key name images/index.html) The suffix must # not be empty and must not include a slash character. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/IndexDocument AWS API Documentation # class IndexDocument < Struct.new( :suffix) include Aws::Structure end # @!attribute [rw] id # If the principal is an AWS account, it provides the Canonical User # ID. If the principal is an IAM User, it provides a user ARN value. # @return [String] # # @!attribute [rw] display_name # Name of the Principal. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Initiator AWS API Documentation # class Initiator < Struct.new( :id, :display_name) include Aws::Structure end # Describes the serialization format of the object. # # @note When making an API call, you may pass InputSerialization # data as a hash: # # { # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # } # # @!attribute [rw] csv # Describes the serialization of a CSV-encoded object. # @return [Types::CSVInput] # # @!attribute [rw] compression_type # Specifies object's compression format. Valid values: NONE, GZIP, # BZIP2. Default Value: NONE. # @return [String] # # @!attribute [rw] json # Specifies JSON as object's input serialization format. # @return [Types::JSONInput] # # @!attribute [rw] parquet # Specifies Parquet as object's input serialization format. # @return [Types::ParquetInput] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InputSerialization AWS API Documentation # class InputSerialization < Struct.new( :csv, :compression_type, :json, :parquet) include Aws::Structure end # Specifies the inventory configuration for an Amazon S3 bucket. For # more information, see [GET Bucket inventory][1] in the *Amazon Simple # Storage Service API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html # # @note When making an API call, you may pass InventoryConfiguration # data as a hash: # # { # destination: { # required # s3_bucket_destination: { # required # account_id: "AccountId", # bucket: "BucketName", # required # format: "CSV", # required, accepts CSV, ORC, Parquet # prefix: "Prefix", # encryption: { # sses3: { # }, # ssekms: { # key_id: "SSEKMSKeyId", # required # }, # }, # }, # }, # is_enabled: false, # required # filter: { # prefix: "Prefix", # required # }, # id: "InventoryId", # required # included_object_versions: "All", # required, accepts All, Current # optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus # schedule: { # required # frequency: "Daily", # required, accepts Daily, Weekly # }, # } # # @!attribute [rw] destination # Contains information about where to publish the inventory results. # @return [Types::InventoryDestination] # # @!attribute [rw] is_enabled # Specifies whether the inventory is enabled or disabled. If set to # `True`, an inventory list is generated. If set to `False`, no # inventory list is generated. # @return [Boolean] # # @!attribute [rw] filter # Specifies an inventory filter. The inventory only includes objects # that meet the filter's criteria. # @return [Types::InventoryFilter] # # @!attribute [rw] id # The ID used to identify the inventory configuration. # @return [String] # # @!attribute [rw] included_object_versions # Object versions to include in the inventory list. If set to `All`, # the list includes all the object versions, which adds the # version-related fields `VersionId`, `IsLatest`, and `DeleteMarker` # to the list. If set to `Current`, the list does not contain these # version-related fields. # @return [String] # # @!attribute [rw] optional_fields # Contains the optional fields that are included in the inventory # results. # @return [Array] # # @!attribute [rw] schedule # Specifies the schedule for generating inventory results. # @return [Types::InventorySchedule] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryConfiguration AWS API Documentation # class InventoryConfiguration < Struct.new( :destination, :is_enabled, :filter, :id, :included_object_versions, :optional_fields, :schedule) include Aws::Structure end # @note When making an API call, you may pass InventoryDestination # data as a hash: # # { # s3_bucket_destination: { # required # account_id: "AccountId", # bucket: "BucketName", # required # format: "CSV", # required, accepts CSV, ORC, Parquet # prefix: "Prefix", # encryption: { # sses3: { # }, # ssekms: { # key_id: "SSEKMSKeyId", # required # }, # }, # }, # } # # @!attribute [rw] s3_bucket_destination # Contains the bucket name, file format, bucket owner (optional), and # prefix (optional) where inventory results are published. # @return [Types::InventoryS3BucketDestination] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryDestination AWS API Documentation # class InventoryDestination < Struct.new( :s3_bucket_destination) include Aws::Structure end # Contains the type of server-side encryption used to encrypt the # inventory results. # # @note When making an API call, you may pass InventoryEncryption # data as a hash: # # { # sses3: { # }, # ssekms: { # key_id: "SSEKMSKeyId", # required # }, # } # # @!attribute [rw] sses3 # Specifies the use of SSE-S3 to encrypt delivered Inventory reports. # @return [Types::SSES3] # # @!attribute [rw] ssekms # Specifies the use of SSE-KMS to encrypt delivered Inventory reports. # @return [Types::SSEKMS] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryEncryption AWS API Documentation # class InventoryEncryption < Struct.new( :sses3, :ssekms) include Aws::Structure end # @note When making an API call, you may pass InventoryFilter # data as a hash: # # { # prefix: "Prefix", # required # } # # @!attribute [rw] prefix # The prefix that an object must have to be included in the inventory # results. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryFilter AWS API Documentation # class InventoryFilter < Struct.new( :prefix) include Aws::Structure end # @note When making an API call, you may pass InventoryS3BucketDestination # data as a hash: # # { # account_id: "AccountId", # bucket: "BucketName", # required # format: "CSV", # required, accepts CSV, ORC, Parquet # prefix: "Prefix", # encryption: { # sses3: { # }, # ssekms: { # key_id: "SSEKMSKeyId", # required # }, # }, # } # # @!attribute [rw] account_id # The ID of the account that owns the destination bucket. # @return [String] # # @!attribute [rw] bucket # The Amazon resource name (ARN) of the bucket where inventory results # will be published. # @return [String] # # @!attribute [rw] format # Specifies the output format of the inventory results. # @return [String] # # @!attribute [rw] prefix # The prefix that is prepended to all inventory results. # @return [String] # # @!attribute [rw] encryption # Contains the type of server-side encryption used to encrypt the # inventory results. # @return [Types::InventoryEncryption] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventoryS3BucketDestination AWS API Documentation # class InventoryS3BucketDestination < Struct.new( :account_id, :bucket, :format, :prefix, :encryption) include Aws::Structure end # @note When making an API call, you may pass InventorySchedule # data as a hash: # # { # frequency: "Daily", # required, accepts Daily, Weekly # } # # @!attribute [rw] frequency # Specifies how frequently inventory results are produced. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/InventorySchedule AWS API Documentation # class InventorySchedule < Struct.new( :frequency) include Aws::Structure end # @note When making an API call, you may pass JSONInput # data as a hash: # # { # type: "DOCUMENT", # accepts DOCUMENT, LINES # } # # @!attribute [rw] type # The type of JSON. Valid values: Document, Lines. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/JSONInput AWS API Documentation # class JSONInput < Struct.new( :type) include Aws::Structure end # @note When making an API call, you may pass JSONOutput # data as a hash: # # { # record_delimiter: "RecordDelimiter", # } # # @!attribute [rw] record_delimiter # The value used to separate individual records in the output. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/JSONOutput AWS API Documentation # class JSONOutput < Struct.new( :record_delimiter) include Aws::Structure end # A container for specifying the configuration for AWS Lambda # notifications. # # @note When making an API call, you may pass LambdaFunctionConfiguration # data as a hash: # # { # id: "NotificationId", # lambda_function_arn: "LambdaFunctionArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # } # # @!attribute [rw] id # An optional unique identifier for configurations in a notification # configuration. If you don't provide one, Amazon S3 will assign an # ID. # @return [String] # # @!attribute [rw] lambda_function_arn # The Amazon Resource Name (ARN) of the AWS Lambda function that # Amazon S3 invokes when the specified event type occurs. # @return [String] # # @!attribute [rw] events # The Amazon S3 bucket event for which to invoke the AWS Lambda # function. For more information, see [Supported Event Types][1] in # the *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html # @return [Array] # # @!attribute [rw] filter # @return [Types::NotificationConfigurationFilter] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LambdaFunctionConfiguration AWS API Documentation # class LambdaFunctionConfiguration < Struct.new( :id, :lambda_function_arn, :events, :filter) include Aws::Structure end # @note When making an API call, you may pass LifecycleConfiguration # data as a hash: # # { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # required # status: "Enabled", # required, accepts Enabled, Disabled # transition: { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_transition: { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # } # # @!attribute [rw] rules # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleConfiguration AWS API Documentation # class LifecycleConfiguration < Struct.new( :rules) include Aws::Structure end # @note When making an API call, you may pass LifecycleExpiration # data as a hash: # # { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # } # # @!attribute [rw] date # Indicates at what date the object is to be moved or deleted. Should # be in GMT ISO 8601 Format. # @return [Time] # # @!attribute [rw] days # Indicates the lifetime, in days, of the objects that are subject to # the rule. The value must be a non-zero positive integer. # @return [Integer] # # @!attribute [rw] expired_object_delete_marker # Indicates whether Amazon S3 will remove a delete marker with no # noncurrent versions. If set to true, the delete marker will be # expired; if set to false the policy takes no action. This cannot be # specified with Days or Date in a Lifecycle Expiration Policy. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleExpiration AWS API Documentation # class LifecycleExpiration < Struct.new( :date, :days, :expired_object_delete_marker) include Aws::Structure end # @note When making an API call, you may pass LifecycleRule # data as a hash: # # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # transitions: [ # { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_transitions: [ # { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # } # # @!attribute [rw] expiration # @return [Types::LifecycleExpiration] # # @!attribute [rw] id # Unique identifier for the rule. The value cannot be longer than 255 # characters. # @return [String] # # @!attribute [rw] prefix # Prefix identifying one or more objects to which the rule applies. # This is No longer used; use Filter instead. # @return [String] # # @!attribute [rw] filter # @return [Types::LifecycleRuleFilter] # # @!attribute [rw] status # If 'Enabled', the rule is currently being applied. If # 'Disabled', the rule is not currently being applied. # @return [String] # # @!attribute [rw] transitions # @return [Array] # # @!attribute [rw] noncurrent_version_transitions # @return [Array] # # @!attribute [rw] noncurrent_version_expiration # @return [Types::NoncurrentVersionExpiration] # # @!attribute [rw] abort_incomplete_multipart_upload # @return [Types::AbortIncompleteMultipartUpload] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRule AWS API Documentation # class LifecycleRule < Struct.new( :expiration, :id, :prefix, :filter, :status, :transitions, :noncurrent_version_transitions, :noncurrent_version_expiration, :abort_incomplete_multipart_upload) include Aws::Structure end # This is used in a Lifecycle Rule Filter to apply a logical AND to two # or more predicates. The Lifecycle Rule will apply to any object # matching all of the predicates configured inside the And operator. # # @note When making an API call, you may pass LifecycleRuleAndOperator # data as a hash: # # { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # } # # @!attribute [rw] prefix # @return [String] # # @!attribute [rw] tags # All of these tags must exist in the object's tag set in order for # the rule to apply. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleAndOperator AWS API Documentation # class LifecycleRuleAndOperator < Struct.new( :prefix, :tags) include Aws::Structure end # The Filter is used to identify objects that a Lifecycle Rule applies # to. A Filter must have exactly one of Prefix, Tag, or And specified. # # @note When making an API call, you may pass LifecycleRuleFilter # data as a hash: # # { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # } # # @!attribute [rw] prefix # Prefix identifying one or more objects to which the rule applies. # @return [String] # # @!attribute [rw] tag # This tag must exist in the object's tag set in order for the rule # to apply. # @return [Types::Tag] # # @!attribute [rw] and # @return [Types::LifecycleRuleAndOperator] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LifecycleRuleFilter AWS API Documentation # class LifecycleRuleFilter < Struct.new( :prefix, :tag, :and) include Aws::Structure end # @!attribute [rw] is_truncated # Indicates whether the returned list of analytics configurations is # complete. A value of true indicates that the list is not complete # and the NextContinuationToken will be provided for a subsequent # request. # @return [Boolean] # # @!attribute [rw] continuation_token # The ContinuationToken that represents where this request began. # @return [String] # # @!attribute [rw] next_continuation_token # NextContinuationToken is sent when isTruncated is true, which # indicates that there are more analytics configurations to list. The # next request must include this NextContinuationToken. The token is # obfuscated and is not a usable value. # @return [String] # # @!attribute [rw] analytics_configuration_list # The list of analytics configurations for a bucket. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurationsOutput AWS API Documentation # class ListBucketAnalyticsConfigurationsOutput < Struct.new( :is_truncated, :continuation_token, :next_continuation_token, :analytics_configuration_list) include Aws::Structure end # @note When making an API call, you may pass ListBucketAnalyticsConfigurationsRequest # data as a hash: # # { # bucket: "BucketName", # required # continuation_token: "Token", # } # # @!attribute [rw] bucket # The name of the bucket from which analytics configurations are # retrieved. # @return [String] # # @!attribute [rw] continuation_token # The ContinuationToken that represents a placeholder from where this # request should begin. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurationsRequest AWS API Documentation # class ListBucketAnalyticsConfigurationsRequest < Struct.new( :bucket, :continuation_token) include Aws::Structure end # @!attribute [rw] continuation_token # If sent in the request, the marker that is used as a starting point # for this inventory configuration list response. # @return [String] # # @!attribute [rw] inventory_configuration_list # The list of inventory configurations for a bucket. # @return [Array] # # @!attribute [rw] is_truncated # Indicates whether the returned list of inventory configurations is # truncated in this response. A value of true indicates that the list # is truncated. # @return [Boolean] # # @!attribute [rw] next_continuation_token # The marker used to continue this inventory configuration listing. # Use the NextContinuationToken from this response to continue the # listing in a subsequent request. The continuation token is an opaque # value that Amazon S3 understands. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurationsOutput AWS API Documentation # class ListBucketInventoryConfigurationsOutput < Struct.new( :continuation_token, :inventory_configuration_list, :is_truncated, :next_continuation_token) include Aws::Structure end # @note When making an API call, you may pass ListBucketInventoryConfigurationsRequest # data as a hash: # # { # bucket: "BucketName", # required # continuation_token: "Token", # } # # @!attribute [rw] bucket # The name of the bucket containing the inventory configurations to # retrieve. # @return [String] # # @!attribute [rw] continuation_token # The marker used to continue an inventory configuration listing that # has been truncated. Use the NextContinuationToken from a previously # truncated list response to continue the listing. The continuation # token is an opaque value that Amazon S3 understands. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurationsRequest AWS API Documentation # class ListBucketInventoryConfigurationsRequest < Struct.new( :bucket, :continuation_token) include Aws::Structure end # @!attribute [rw] is_truncated # Indicates whether the returned list of metrics configurations is # complete. A value of true indicates that the list is not complete # and the NextContinuationToken will be provided for a subsequent # request. # @return [Boolean] # # @!attribute [rw] continuation_token # The marker that is used as a starting point for this metrics # configuration list response. This value is present if it was sent in # the request. # @return [String] # # @!attribute [rw] next_continuation_token # The marker used to continue a metrics configuration listing that has # been truncated. Use the NextContinuationToken from a previously # truncated list response to continue the listing. The continuation # token is an opaque value that Amazon S3 understands. # @return [String] # # @!attribute [rw] metrics_configuration_list # The list of metrics configurations for a bucket. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurationsOutput AWS API Documentation # class ListBucketMetricsConfigurationsOutput < Struct.new( :is_truncated, :continuation_token, :next_continuation_token, :metrics_configuration_list) include Aws::Structure end # @note When making an API call, you may pass ListBucketMetricsConfigurationsRequest # data as a hash: # # { # bucket: "BucketName", # required # continuation_token: "Token", # } # # @!attribute [rw] bucket # The name of the bucket containing the metrics configurations to # retrieve. # @return [String] # # @!attribute [rw] continuation_token # The marker that is used to continue a metrics configuration listing # that has been truncated. Use the NextContinuationToken from a # previously truncated list response to continue the listing. The # continuation token is an opaque value that Amazon S3 understands. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurationsRequest AWS API Documentation # class ListBucketMetricsConfigurationsRequest < Struct.new( :bucket, :continuation_token) include Aws::Structure end # @!attribute [rw] buckets # @return [Array] # # @!attribute [rw] owner # @return [Types::Owner] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketsOutput AWS API Documentation # class ListBucketsOutput < Struct.new( :buckets, :owner) include Aws::Structure end # @!attribute [rw] bucket # Name of the bucket to which the multipart upload was initiated. # @return [String] # # @!attribute [rw] key_marker # The key at or after which the listing began. # @return [String] # # @!attribute [rw] upload_id_marker # Upload ID after which listing began. # @return [String] # # @!attribute [rw] next_key_marker # When a list is truncated, this element specifies the value that # should be used for the key-marker request parameter in a subsequent # request. # @return [String] # # @!attribute [rw] prefix # When a prefix is provided in the request, this field contains the # specified prefix. The result contains only keys starting with the # specified prefix. # @return [String] # # @!attribute [rw] delimiter # @return [String] # # @!attribute [rw] next_upload_id_marker # When a list is truncated, this element specifies the value that # should be used for the upload-id-marker request parameter in a # subsequent request. # @return [String] # # @!attribute [rw] max_uploads # Maximum number of multipart uploads that could have been included in # the response. # @return [Integer] # # @!attribute [rw] is_truncated # Indicates whether the returned list of multipart uploads is # truncated. A value of true indicates that the list was truncated. # The list can be truncated if the number of multipart uploads exceeds # the limit allowed or specified by max uploads. # @return [Boolean] # # @!attribute [rw] uploads # @return [Array] # # @!attribute [rw] common_prefixes # @return [Array] # # @!attribute [rw] encoding_type # Encoding type used by Amazon S3 to encode object keys in the # response. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploadsOutput AWS API Documentation # class ListMultipartUploadsOutput < Struct.new( :bucket, :key_marker, :upload_id_marker, :next_key_marker, :prefix, :delimiter, :next_upload_id_marker, :max_uploads, :is_truncated, :uploads, :common_prefixes, :encoding_type) include Aws::Structure end # @note When making an API call, you may pass ListMultipartUploadsRequest # data as a hash: # # { # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # key_marker: "KeyMarker", # max_uploads: 1, # prefix: "Prefix", # upload_id_marker: "UploadIdMarker", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] delimiter # Character you use to group keys. # @return [String] # # @!attribute [rw] encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # @return [String] # # @!attribute [rw] key_marker # Together with upload-id-marker, this parameter specifies the # multipart upload after which listing should begin. # @return [String] # # @!attribute [rw] max_uploads # Sets the maximum number of multipart uploads, from 1 to 1,000, to # return in the response body. 1,000 is the maximum number of uploads # that can be returned in a response. # @return [Integer] # # @!attribute [rw] prefix # Lists in-progress uploads only for those keys that begin with the # specified prefix. # @return [String] # # @!attribute [rw] upload_id_marker # Together with key-marker, specifies the multipart upload after which # listing should begin. If key-marker is not specified, the # upload-id-marker parameter is ignored. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploadsRequest AWS API Documentation # class ListMultipartUploadsRequest < Struct.new( :bucket, :delimiter, :encoding_type, :key_marker, :max_uploads, :prefix, :upload_id_marker) include Aws::Structure end # @!attribute [rw] is_truncated # A flag that indicates whether or not Amazon S3 returned all of the # results that satisfied the search criteria. If your results were # truncated, you can make a follow-up paginated request using the # NextKeyMarker and NextVersionIdMarker response parameters as a # starting place in another request to return the rest of the results. # @return [Boolean] # # @!attribute [rw] key_marker # Marks the last Key returned in a truncated response. # @return [String] # # @!attribute [rw] version_id_marker # @return [String] # # @!attribute [rw] next_key_marker # Use this value for the key marker request parameter in a subsequent # request. # @return [String] # # @!attribute [rw] next_version_id_marker # Use this value for the next version id marker parameter in a # subsequent request. # @return [String] # # @!attribute [rw] versions # @return [Array] # # @!attribute [rw] delete_markers # @return [Array] # # @!attribute [rw] name # @return [String] # # @!attribute [rw] prefix # @return [String] # # @!attribute [rw] delimiter # @return [String] # # @!attribute [rw] max_keys # @return [Integer] # # @!attribute [rw] common_prefixes # @return [Array] # # @!attribute [rw] encoding_type # Encoding type used by Amazon S3 to encode object keys in the # response. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersionsOutput AWS API Documentation # class ListObjectVersionsOutput < Struct.new( :is_truncated, :key_marker, :version_id_marker, :next_key_marker, :next_version_id_marker, :versions, :delete_markers, :name, :prefix, :delimiter, :max_keys, :common_prefixes, :encoding_type) include Aws::Structure end # @note When making an API call, you may pass ListObjectVersionsRequest # data as a hash: # # { # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # key_marker: "KeyMarker", # max_keys: 1, # prefix: "Prefix", # version_id_marker: "VersionIdMarker", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] delimiter # A delimiter is a character you use to group keys. # @return [String] # # @!attribute [rw] encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # @return [String] # # @!attribute [rw] key_marker # Specifies the key to start with when listing objects in a bucket. # @return [String] # # @!attribute [rw] max_keys # Sets the maximum number of keys returned in the response. The # response might contain fewer keys but will never contain more. # @return [Integer] # # @!attribute [rw] prefix # Limits the response to keys that begin with the specified prefix. # @return [String] # # @!attribute [rw] version_id_marker # Specifies the object version you want to start listing from. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersionsRequest AWS API Documentation # class ListObjectVersionsRequest < Struct.new( :bucket, :delimiter, :encoding_type, :key_marker, :max_keys, :prefix, :version_id_marker) include Aws::Structure end # @!attribute [rw] is_truncated # A flag that indicates whether or not Amazon S3 returned all of the # results that satisfied the search criteria. # @return [Boolean] # # @!attribute [rw] marker # @return [String] # # @!attribute [rw] next_marker # When response is truncated (the IsTruncated element value in the # response is true), you can use the key name in this field as marker # in the subsequent request to get next set of objects. Amazon S3 # lists objects in alphabetical order Note: This element is returned # only if you have delimiter request parameter specified. If response # does not include the NextMaker and it is truncated, you can use the # value of the last Key in the response as the marker in the # subsequent request to get the next set of object keys. # @return [String] # # @!attribute [rw] contents # @return [Array] # # @!attribute [rw] name # @return [String] # # @!attribute [rw] prefix # @return [String] # # @!attribute [rw] delimiter # @return [String] # # @!attribute [rw] max_keys # @return [Integer] # # @!attribute [rw] common_prefixes # @return [Array] # # @!attribute [rw] encoding_type # Encoding type used by Amazon S3 to encode object keys in the # response. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsOutput AWS API Documentation # class ListObjectsOutput < Struct.new( :is_truncated, :marker, :next_marker, :contents, :name, :prefix, :delimiter, :max_keys, :common_prefixes, :encoding_type) include Aws::Structure end # @note When making an API call, you may pass ListObjectsRequest # data as a hash: # # { # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # marker: "Marker", # max_keys: 1, # prefix: "Prefix", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] delimiter # A delimiter is a character you use to group keys. # @return [String] # # @!attribute [rw] encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # @return [String] # # @!attribute [rw] marker # Specifies the key to start with when listing objects in a bucket. # @return [String] # # @!attribute [rw] max_keys # Sets the maximum number of keys returned in the response. The # response might contain fewer keys but will never contain more. # @return [Integer] # # @!attribute [rw] prefix # Limits the response to keys that begin with the specified prefix. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the list objects request. Bucket owners need not specify this # parameter in their requests. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsRequest AWS API Documentation # class ListObjectsRequest < Struct.new( :bucket, :delimiter, :encoding_type, :marker, :max_keys, :prefix, :request_payer) include Aws::Structure end # @!attribute [rw] is_truncated # A flag that indicates whether or not Amazon S3 returned all of the # results that satisfied the search criteria. # @return [Boolean] # # @!attribute [rw] contents # Metadata about each object returned. # @return [Array] # # @!attribute [rw] name # Name of the bucket to list. # @return [String] # # @!attribute [rw] prefix # Limits the response to keys that begin with the specified prefix. # @return [String] # # @!attribute [rw] delimiter # A delimiter is a character you use to group keys. # @return [String] # # @!attribute [rw] max_keys # Sets the maximum number of keys returned in the response. The # response might contain fewer keys but will never contain more. # @return [Integer] # # @!attribute [rw] common_prefixes # CommonPrefixes contains all (if there are any) keys between Prefix # and the next occurrence of the string specified by delimiter # @return [Array] # # @!attribute [rw] encoding_type # Encoding type used by Amazon S3 to encode object keys in the # response. # @return [String] # # @!attribute [rw] key_count # KeyCount is the number of keys returned with this request. KeyCount # will always be less than equals to MaxKeys field. Say you ask for 50 # keys, your result will include less than equals 50 keys # @return [Integer] # # @!attribute [rw] continuation_token # ContinuationToken indicates Amazon S3 that the list is being # continued on this bucket with a token. ContinuationToken is # obfuscated and is not a real key # @return [String] # # @!attribute [rw] next_continuation_token # NextContinuationToken is sent when isTruncated is true which means # there are more keys in the bucket that can be listed. The next list # requests to Amazon S3 can be continued with this # NextContinuationToken. NextContinuationToken is obfuscated and is # not a real key # @return [String] # # @!attribute [rw] start_after # StartAfter is where you want Amazon S3 to start listing from. Amazon # S3 starts listing after this specified key. StartAfter can be any # key in the bucket # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2Output AWS API Documentation # class ListObjectsV2Output < Struct.new( :is_truncated, :contents, :name, :prefix, :delimiter, :max_keys, :common_prefixes, :encoding_type, :key_count, :continuation_token, :next_continuation_token, :start_after) include Aws::Structure end # @note When making an API call, you may pass ListObjectsV2Request # data as a hash: # # { # bucket: "BucketName", # required # delimiter: "Delimiter", # encoding_type: "url", # accepts url # max_keys: 1, # prefix: "Prefix", # continuation_token: "Token", # fetch_owner: false, # start_after: "StartAfter", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # Name of the bucket to list. # @return [String] # # @!attribute [rw] delimiter # A delimiter is a character you use to group keys. # @return [String] # # @!attribute [rw] encoding_type # Encoding type used by Amazon S3 to encode object keys in the # response. # @return [String] # # @!attribute [rw] max_keys # Sets the maximum number of keys returned in the response. The # response might contain fewer keys but will never contain more. # @return [Integer] # # @!attribute [rw] prefix # Limits the response to keys that begin with the specified prefix. # @return [String] # # @!attribute [rw] continuation_token # ContinuationToken indicates Amazon S3 that the list is being # continued on this bucket with a token. ContinuationToken is # obfuscated and is not a real key # @return [String] # # @!attribute [rw] fetch_owner # The owner field is not present in listV2 by default, if you want to # return owner field with each key in the result then set the fetch # owner field to true # @return [Boolean] # # @!attribute [rw] start_after # StartAfter is where you want Amazon S3 to start listing from. Amazon # S3 starts listing after this specified key. StartAfter can be any # key in the bucket # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the list objects request in V2 style. Bucket owners need not specify # this parameter in their requests. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2Request AWS API Documentation # class ListObjectsV2Request < Struct.new( :bucket, :delimiter, :encoding_type, :max_keys, :prefix, :continuation_token, :fetch_owner, :start_after, :request_payer) include Aws::Structure end # @!attribute [rw] abort_date # Date when multipart upload will become eligible for abort operation # by lifecycle. # @return [Time] # # @!attribute [rw] abort_rule_id # Id of the lifecycle rule that makes a multipart upload eligible for # abort operation. # @return [String] # # @!attribute [rw] bucket # Name of the bucket to which the multipart upload was initiated. # @return [String] # # @!attribute [rw] key # Object key for which the multipart upload was initiated. # @return [String] # # @!attribute [rw] upload_id # Upload ID identifying the multipart upload whose parts are being # listed. # @return [String] # # @!attribute [rw] part_number_marker # Part number after which listing begins. # @return [Integer] # # @!attribute [rw] next_part_number_marker # When a list is truncated, this element specifies the last part in # the list, as well as the value to use for the part-number-marker # request parameter in a subsequent request. # @return [Integer] # # @!attribute [rw] max_parts # Maximum number of parts that were allowed in the response. # @return [Integer] # # @!attribute [rw] is_truncated # Indicates whether the returned list of parts is truncated. # @return [Boolean] # # @!attribute [rw] parts # @return [Array] # # @!attribute [rw] initiator # Identifies who initiated the multipart upload. # @return [Types::Initiator] # # @!attribute [rw] owner # @return [Types::Owner] # # @!attribute [rw] storage_class # The class of storage used to store the object. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListPartsOutput AWS API Documentation # class ListPartsOutput < Struct.new( :abort_date, :abort_rule_id, :bucket, :key, :upload_id, :part_number_marker, :next_part_number_marker, :max_parts, :is_truncated, :parts, :initiator, :owner, :storage_class, :request_charged) include Aws::Structure end # @note When making an API call, you may pass ListPartsRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # max_parts: 1, # part_number_marker: 1, # upload_id: "MultipartUploadId", # required # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] max_parts # Sets the maximum number of parts to return. # @return [Integer] # # @!attribute [rw] part_number_marker # Specifies the part after which listing should begin. Only parts with # higher part numbers will be listed. # @return [Integer] # # @!attribute [rw] upload_id # Upload ID identifying the multipart upload whose parts are being # listed. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListPartsRequest AWS API Documentation # class ListPartsRequest < Struct.new( :bucket, :key, :max_parts, :part_number_marker, :upload_id, :request_payer) include Aws::Structure end # Describes where logs are stored and the prefix that Amazon S3 assigns # to all log object keys for a bucket. For more information, see [PUT # Bucket logging][1] in the *Amazon Simple Storage Service API # Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html # # @note When making an API call, you may pass LoggingEnabled # data as a hash: # # { # target_bucket: "TargetBucket", # required # target_grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE # }, # ], # target_prefix: "TargetPrefix", # required # } # # @!attribute [rw] target_bucket # Specifies the bucket where you want Amazon S3 to store server access # logs. You can have your logs delivered to any bucket that you own, # including the same bucket that is being logged. You can also # configure multiple buckets to deliver their logs to the same target # bucket. In this case you should choose a different TargetPrefix for # each source bucket so that the delivered log files can be # distinguished by key. # @return [String] # # @!attribute [rw] target_grants # @return [Array] # # @!attribute [rw] target_prefix # A prefix for all log object keys. If you store log files from # multiple Amazon S3 buckets in a single bucket, you can use a prefix # to distinguish which log files came from which bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/LoggingEnabled AWS API Documentation # class LoggingEnabled < Struct.new( :target_bucket, :target_grants, :target_prefix) include Aws::Structure end # A metadata key-value pair to store with an object. # # @note When making an API call, you may pass MetadataEntry # data as a hash: # # { # name: "MetadataKey", # value: "MetadataValue", # } # # @!attribute [rw] name # @return [String] # # @!attribute [rw] value # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetadataEntry AWS API Documentation # class MetadataEntry < Struct.new( :name, :value) include Aws::Structure end # @note When making an API call, you may pass MetricsAndOperator # data as a hash: # # { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # } # # @!attribute [rw] prefix # The prefix used when evaluating an AND predicate. # @return [String] # # @!attribute [rw] tags # The list of tags used when evaluating an AND predicate. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsAndOperator AWS API Documentation # class MetricsAndOperator < Struct.new( :prefix, :tags) include Aws::Structure end # Specifies a metrics configuration for the CloudWatch request metrics # (specified by the metrics configuration ID) from an Amazon S3 bucket. # If you're updating an existing metrics configuration, note that this # is a full replacement of the existing metrics configuration. If you # don't include the elements you want to keep, they are erased. For # more information, see [ PUT Bucket metrics][1] in the *Amazon Simple # Storage Service API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html # # @note When making an API call, you may pass MetricsConfiguration # data as a hash: # # { # id: "MetricsId", # required # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # } # # @!attribute [rw] id # The ID used to identify the metrics configuration. # @return [String] # # @!attribute [rw] filter # Specifies a metrics configuration filter. The metrics configuration # will only include objects that meet the filter's criteria. A filter # must be a prefix, a tag, or a conjunction (MetricsAndOperator). # @return [Types::MetricsFilter] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsConfiguration AWS API Documentation # class MetricsConfiguration < Struct.new( :id, :filter) include Aws::Structure end # @note When making an API call, you may pass MetricsFilter # data as a hash: # # { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # } # # @!attribute [rw] prefix # The prefix used when evaluating a metrics filter. # @return [String] # # @!attribute [rw] tag # The tag used when evaluating a metrics filter. # @return [Types::Tag] # # @!attribute [rw] and # A conjunction (logical AND) of predicates, which is used in # evaluating a metrics filter. The operator must have at least two # predicates, and an object must match all of the predicates in order # for the filter to apply. # @return [Types::MetricsAndOperator] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MetricsFilter AWS API Documentation # class MetricsFilter < Struct.new( :prefix, :tag, :and) include Aws::Structure end # @!attribute [rw] upload_id # Upload ID that identifies the multipart upload. # @return [String] # # @!attribute [rw] key # Key of the object for which the multipart upload was initiated. # @return [String] # # @!attribute [rw] initiated # Date and time at which the multipart upload was initiated. # @return [Time] # # @!attribute [rw] storage_class # The class of storage used to store the object. # @return [String] # # @!attribute [rw] owner # @return [Types::Owner] # # @!attribute [rw] initiator # Identifies who initiated the multipart upload. # @return [Types::Initiator] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/MultipartUpload AWS API Documentation # class MultipartUpload < Struct.new( :upload_id, :key, :initiated, :storage_class, :owner, :initiator) include Aws::Structure end # Specifies when noncurrent object versions expire. Upon expiration, # Amazon S3 permanently deletes the noncurrent object versions. You set # this lifecycle configuration action on a bucket that has versioning # enabled (or suspended) to request that Amazon S3 delete noncurrent # object versions at a specific period in the object's lifetime. # # @note When making an API call, you may pass NoncurrentVersionExpiration # data as a hash: # # { # noncurrent_days: 1, # } # # @!attribute [rw] noncurrent_days # Specifies the number of days an object is noncurrent before Amazon # S3 can perform the associated action. For information about the # noncurrent days calculations, see [How Amazon S3 Calculates When an # Object Became Noncurrent][1] in the Amazon Simple Storage Service # Developer Guide. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionExpiration AWS API Documentation # class NoncurrentVersionExpiration < Struct.new( :noncurrent_days) include Aws::Structure end # Container for the transition rule that describes when noncurrent # objects transition to the `STANDARD_IA`, `ONEZONE_IA`, # `INTELLIGENT_TIERING`, `GLACIER`, or `DEEP_ARCHIVE` storage class. If # your bucket is versioning-enabled (or versioning is suspended), you # can set this action to request that Amazon S3 transition noncurrent # object versions to the `STANDARD_IA`, `ONEZONE_IA`, # `INTELLIGENT_TIERING`, `GLACIER`, or `DEEP_ARCHIVE` storage class at a # specific period in the object's lifetime. # # @note When making an API call, you may pass NoncurrentVersionTransition # data as a hash: # # { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # } # # @!attribute [rw] noncurrent_days # Specifies the number of days an object is noncurrent before Amazon # S3 can perform the associated action. For information about the # noncurrent days calculations, see [How Amazon S3 Calculates When an # Object Became Noncurrent][1] in the *Amazon Simple Storage Service # Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html # @return [Integer] # # @!attribute [rw] storage_class # The class of storage used to store the object. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NoncurrentVersionTransition AWS API Documentation # class NoncurrentVersionTransition < Struct.new( :noncurrent_days, :storage_class) include Aws::Structure end # A container for specifying the notification configuration of the # bucket. If this element is empty, notifications are turned off for the # bucket. # # @note When making an API call, you may pass NotificationConfiguration # data as a hash: # # { # topic_configurations: [ # { # id: "NotificationId", # topic_arn: "TopicArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # queue_configurations: [ # { # id: "NotificationId", # queue_arn: "QueueArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # lambda_function_configurations: [ # { # id: "NotificationId", # lambda_function_arn: "LambdaFunctionArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # } # # @!attribute [rw] topic_configurations # The topic to which notifications are sent and the events for which # notifications are generated. # @return [Array] # # @!attribute [rw] queue_configurations # The Amazon Simple Queue Service queues to publish messages to and # the events for which to publish messages. # @return [Array] # # @!attribute [rw] lambda_function_configurations # Describes the AWS Lambda functions to invoke and the events for # which to invoke them. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfiguration AWS API Documentation # class NotificationConfiguration < Struct.new( :topic_configurations, :queue_configurations, :lambda_function_configurations) include Aws::Structure end # @note When making an API call, you may pass NotificationConfigurationDeprecated # data as a hash: # # { # topic_configuration: { # id: "NotificationId", # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # topic: "TopicArn", # }, # queue_configuration: { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # queue: "QueueArn", # }, # cloud_function_configuration: { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # cloud_function: "CloudFunction", # invocation_role: "CloudFunctionInvocationRole", # }, # } # # @!attribute [rw] topic_configuration # @return [Types::TopicConfigurationDeprecated] # # @!attribute [rw] queue_configuration # @return [Types::QueueConfigurationDeprecated] # # @!attribute [rw] cloud_function_configuration # @return [Types::CloudFunctionConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfigurationDeprecated AWS API Documentation # class NotificationConfigurationDeprecated < Struct.new( :topic_configuration, :queue_configuration, :cloud_function_configuration) include Aws::Structure end # Specifies object key name filtering rules. For information about key # name filtering, see [Configuring Event Notifications][1] in the # *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html # # @note When making an API call, you may pass NotificationConfigurationFilter # data as a hash: # # { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # } # # @!attribute [rw] key # @return [Types::S3KeyFilter] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/NotificationConfigurationFilter AWS API Documentation # class NotificationConfigurationFilter < Struct.new( :key) include Aws::Structure end # @!attribute [rw] key # @return [String] # # @!attribute [rw] last_modified # @return [Time] # # @!attribute [rw] etag # @return [String] # # @!attribute [rw] size # @return [Integer] # # @!attribute [rw] storage_class # The class of storage used to store the object. # @return [String] # # @!attribute [rw] owner # @return [Types::Owner] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Object AWS API Documentation # class Object < Struct.new( :key, :last_modified, :etag, :size, :storage_class, :owner) include Aws::Structure end # @note When making an API call, you may pass ObjectIdentifier # data as a hash: # # { # key: "ObjectKey", # required # version_id: "ObjectVersionId", # } # # @!attribute [rw] key # Key name of the object to delete. # @return [String] # # @!attribute [rw] version_id # VersionId for the specific version of the object to delete. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectIdentifier AWS API Documentation # class ObjectIdentifier < Struct.new( :key, :version_id) include Aws::Structure end # The container element for object lock configuration parameters. # # @note When making an API call, you may pass ObjectLockConfiguration # data as a hash: # # { # object_lock_enabled: "Enabled", # accepts Enabled # rule: { # default_retention: { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # days: 1, # years: 1, # }, # }, # } # # @!attribute [rw] object_lock_enabled # Indicates whether this bucket has an object lock configuration # enabled. # @return [String] # # @!attribute [rw] rule # The object lock rule in place for the specified object. # @return [Types::ObjectLockRule] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectLockConfiguration AWS API Documentation # class ObjectLockConfiguration < Struct.new( :object_lock_enabled, :rule) include Aws::Structure end # A Legal Hold configuration for an object. # # @note When making an API call, you may pass ObjectLockLegalHold # data as a hash: # # { # status: "ON", # accepts ON, OFF # } # # @!attribute [rw] status # Indicates whether the specified object has a Legal Hold in place. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectLockLegalHold AWS API Documentation # class ObjectLockLegalHold < Struct.new( :status) include Aws::Structure end # A Retention configuration for an object. # # @note When making an API call, you may pass ObjectLockRetention # data as a hash: # # { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # retain_until_date: Time.now, # } # # @!attribute [rw] mode # Indicates the Retention mode for the specified object. # @return [String] # # @!attribute [rw] retain_until_date # The date on which this object lock retention expires. # @return [Time] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectLockRetention AWS API Documentation # class ObjectLockRetention < Struct.new( :mode, :retain_until_date) include Aws::Structure end # The container element for an object lock rule. # # @note When making an API call, you may pass ObjectLockRule # data as a hash: # # { # default_retention: { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # days: 1, # years: 1, # }, # } # # @!attribute [rw] default_retention # The default retention period that you want to apply to new objects # placed in the specified bucket. # @return [Types::DefaultRetention] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectLockRule AWS API Documentation # class ObjectLockRule < Struct.new( :default_retention) include Aws::Structure end # @!attribute [rw] etag # @return [String] # # @!attribute [rw] size # Size in bytes of the object. # @return [Integer] # # @!attribute [rw] storage_class # The class of storage used to store the object. # @return [String] # # @!attribute [rw] key # The object key. # @return [String] # # @!attribute [rw] version_id # Version ID of an object. # @return [String] # # @!attribute [rw] is_latest # Specifies whether the object is (true) or is not (false) the latest # version of an object. # @return [Boolean] # # @!attribute [rw] last_modified # Date and time the object was last modified. # @return [Time] # # @!attribute [rw] owner # @return [Types::Owner] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ObjectVersion AWS API Documentation # class ObjectVersion < Struct.new( :etag, :size, :storage_class, :key, :version_id, :is_latest, :last_modified, :owner) include Aws::Structure end # Describes the location where the restore job's output is stored. # # @note When making an API call, you may pass OutputLocation # data as a hash: # # { # s3: { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # }, # } # # @!attribute [rw] s3 # Describes an S3 location that will receive the results of the # restore request. # @return [Types::S3Location] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/OutputLocation AWS API Documentation # class OutputLocation < Struct.new( :s3) include Aws::Structure end # Describes how results of the Select job are serialized. # # @note When making an API call, you may pass OutputSerialization # data as a hash: # # { # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # } # # @!attribute [rw] csv # Describes the serialization of CSV-encoded Select results. # @return [Types::CSVOutput] # # @!attribute [rw] json # Specifies JSON as request's output serialization format. # @return [Types::JSONOutput] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/OutputSerialization AWS API Documentation # class OutputSerialization < Struct.new( :csv, :json) include Aws::Structure end # @note When making an API call, you may pass Owner # data as a hash: # # { # display_name: "DisplayName", # id: "ID", # } # # @!attribute [rw] display_name # @return [String] # # @!attribute [rw] id # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Owner AWS API Documentation # class Owner < Struct.new( :display_name, :id) include Aws::Structure end # @api private # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ParquetInput AWS API Documentation # class ParquetInput < Aws::EmptyStructure; end # @!attribute [rw] part_number # Part number identifying the part. This is a positive integer between # 1 and 10,000. # @return [Integer] # # @!attribute [rw] last_modified # Date and time at which the part was uploaded. # @return [Time] # # @!attribute [rw] etag # Entity tag returned when the part was uploaded. # @return [String] # # @!attribute [rw] size # Size in bytes of the uploaded part data. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Part AWS API Documentation # class Part < Struct.new( :part_number, :last_modified, :etag, :size) include Aws::Structure end # The container element for a bucket's policy status. # # @!attribute [rw] is_public # The policy status for this bucket. `TRUE` indicates that this bucket # is public. `FALSE` indicates that the bucket is not public. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PolicyStatus AWS API Documentation # class PolicyStatus < Struct.new( :is_public) include Aws::Structure end # @!attribute [rw] bytes_scanned # The current number of object bytes scanned. # @return [Integer] # # @!attribute [rw] bytes_processed # The current number of uncompressed object bytes processed. # @return [Integer] # # @!attribute [rw] bytes_returned # The current number of bytes of records payload data returned. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Progress AWS API Documentation # class Progress < Struct.new( :bytes_scanned, :bytes_processed, :bytes_returned) include Aws::Structure end # @!attribute [rw] details # The Progress event details. # @return [Types::Progress] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ProgressEvent AWS API Documentation # class ProgressEvent < Struct.new( :details, :event_type) include Aws::Structure end # Specifies the Block Public Access configuration for an Amazon S3 # bucket. # # @note When making an API call, you may pass PublicAccessBlockConfiguration # data as a hash: # # { # block_public_acls: false, # ignore_public_acls: false, # block_public_policy: false, # restrict_public_buckets: false, # } # # @!attribute [rw] block_public_acls # Specifies whether Amazon S3 should block public access control lists # (ACLs) for this bucket and objects in this bucket. Setting this # element to `TRUE` causes the following behavior: # # * PUT Bucket acl and PUT Object acl calls fail if the specified ACL # is public. # # * PUT Object calls fail if the request includes a public ACL. # # Enabling this setting doesn't affect existing policies or ACLs. # @return [Boolean] # # @!attribute [rw] ignore_public_acls # Specifies whether Amazon S3 should ignore public ACLs for this # bucket and objects in this bucket. Setting this element to `TRUE` # causes Amazon S3 to ignore all public ACLs on this bucket and # objects in this bucket. # # Enabling this setting doesn't affect the persistence of any # existing ACLs and doesn't prevent new public ACLs from being set. # @return [Boolean] # # @!attribute [rw] block_public_policy # Specifies whether Amazon S3 should block public bucket policies for # this bucket. Setting this element to `TRUE` causes Amazon S3 to # reject calls to PUT Bucket policy if the specified bucket policy # allows public access. # # Enabling this setting doesn't affect existing bucket policies. # @return [Boolean] # # @!attribute [rw] restrict_public_buckets # Specifies whether Amazon S3 should restrict public bucket policies # for this bucket. Setting this element to `TRUE` restricts access to # this bucket to only AWS services and authorized users within this # account if the bucket has a public policy. # # Enabling this setting doesn't affect previously stored bucket # policies, except that public and cross-account access within any # public bucket policy, including non-public delegation to specific # accounts, is blocked. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PublicAccessBlockConfiguration AWS API Documentation # class PublicAccessBlockConfiguration < Struct.new( :block_public_acls, :ignore_public_acls, :block_public_policy, :restrict_public_buckets) include Aws::Structure end # @note When making an API call, you may pass PutBucketAccelerateConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # accelerate_configuration: { # required # status: "Enabled", # accepts Enabled, Suspended # }, # } # # @!attribute [rw] bucket # Name of the bucket for which the accelerate configuration is set. # @return [String] # # @!attribute [rw] accelerate_configuration # Specifies the Accelerate Configuration you want to set for the # bucket. # @return [Types::AccelerateConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfigurationRequest AWS API Documentation # class PutBucketAccelerateConfigurationRequest < Struct.new( :bucket, :accelerate_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketAclRequest # data as a hash: # # { # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # access_control_policy: { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # }, # bucket: "BucketName", # required # content_md5: "ContentMD5", # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # } # # @!attribute [rw] acl # The canned ACL to apply to the bucket. # @return [String] # # @!attribute [rw] access_control_policy # Contains the elements that set the ACL permissions for an object per # grantee. # @return [Types::AccessControlPolicy] # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions # on the bucket. # @return [String] # # @!attribute [rw] grant_read # Allows grantee to list the objects in the bucket. # @return [String] # # @!attribute [rw] grant_read_acp # Allows grantee to read the bucket ACL. # @return [String] # # @!attribute [rw] grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @return [String] # # @!attribute [rw] grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAclRequest AWS API Documentation # class PutBucketAclRequest < Struct.new( :acl, :access_control_policy, :bucket, :content_md5, :grant_full_control, :grant_read, :grant_read_acp, :grant_write, :grant_write_acp) include Aws::Structure end # @note When making an API call, you may pass PutBucketAnalyticsConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "AnalyticsId", # required # analytics_configuration: { # required # id: "AnalyticsId", # required # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # storage_class_analysis: { # required # data_export: { # output_schema_version: "V_1", # required, accepts V_1 # destination: { # required # s3_bucket_destination: { # required # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # }, # }, # }, # }, # }, # } # # @!attribute [rw] bucket # The name of the bucket to which an analytics configuration is # stored. # @return [String] # # @!attribute [rw] id # The ID that identifies the analytics configuration. # @return [String] # # @!attribute [rw] analytics_configuration # The configuration and any analyses for the analytics filter. # @return [Types::AnalyticsConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfigurationRequest AWS API Documentation # class PutBucketAnalyticsConfigurationRequest < Struct.new( :bucket, :id, :analytics_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketCorsRequest # data as a hash: # # { # bucket: "BucketName", # required # cors_configuration: { # required # cors_rules: [ # required # { # allowed_headers: ["AllowedHeader"], # allowed_methods: ["AllowedMethod"], # required # allowed_origins: ["AllowedOrigin"], # required # expose_headers: ["ExposeHeader"], # max_age_seconds: 1, # }, # ], # }, # content_md5: "ContentMD5", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] cors_configuration # @return [Types::CORSConfiguration] # # @!attribute [rw] content_md5 # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCorsRequest AWS API Documentation # class PutBucketCorsRequest < Struct.new( :bucket, :cors_configuration, :content_md5) include Aws::Structure end # @note When making an API call, you may pass PutBucketEncryptionRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # server_side_encryption_configuration: { # required # rules: [ # required # { # apply_server_side_encryption_by_default: { # sse_algorithm: "AES256", # required, accepts AES256, aws:kms # kms_master_key_id: "SSEKMSKeyId", # }, # }, # ], # }, # } # # @!attribute [rw] bucket # Specifies default encryption for a bucket using server-side # encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed # keys (SSE-KMS). For information about the Amazon S3 default # encryption feature, see [Amazon S3 Default Bucket Encryption][1] in # the *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html # @return [String] # # @!attribute [rw] content_md5 # The base64-encoded 128-bit MD5 digest of the server-side encryption # configuration. This parameter is auto-populated when using the # command from the CLI. # @return [String] # # @!attribute [rw] server_side_encryption_configuration # @return [Types::ServerSideEncryptionConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketEncryptionRequest AWS API Documentation # class PutBucketEncryptionRequest < Struct.new( :bucket, :content_md5, :server_side_encryption_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketInventoryConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "InventoryId", # required # inventory_configuration: { # required # destination: { # required # s3_bucket_destination: { # required # account_id: "AccountId", # bucket: "BucketName", # required # format: "CSV", # required, accepts CSV, ORC, Parquet # prefix: "Prefix", # encryption: { # sses3: { # }, # ssekms: { # key_id: "SSEKMSKeyId", # required # }, # }, # }, # }, # is_enabled: false, # required # filter: { # prefix: "Prefix", # required # }, # id: "InventoryId", # required # included_object_versions: "All", # required, accepts All, Current # optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus # schedule: { # required # frequency: "Daily", # required, accepts Daily, Weekly # }, # }, # } # # @!attribute [rw] bucket # The name of the bucket where the inventory configuration will be # stored. # @return [String] # # @!attribute [rw] id # The ID used to identify the inventory configuration. # @return [String] # # @!attribute [rw] inventory_configuration # Specifies the inventory configuration. # @return [Types::InventoryConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfigurationRequest AWS API Documentation # class PutBucketInventoryConfigurationRequest < Struct.new( :bucket, :id, :inventory_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketLifecycleConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # lifecycle_configuration: { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # transitions: [ # { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_transitions: [ # { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # ], # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] lifecycle_configuration # @return [Types::BucketLifecycleConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfigurationRequest AWS API Documentation # class PutBucketLifecycleConfigurationRequest < Struct.new( :bucket, :lifecycle_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketLifecycleRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # lifecycle_configuration: { # rules: [ # required # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # required # status: "Enabled", # required, accepts Enabled, Disabled # transition: { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_transition: { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # }, # ], # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] lifecycle_configuration # @return [Types::LifecycleConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleRequest AWS API Documentation # class PutBucketLifecycleRequest < Struct.new( :bucket, :content_md5, :lifecycle_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketLoggingRequest # data as a hash: # # { # bucket: "BucketName", # required # bucket_logging_status: { # required # logging_enabled: { # target_bucket: "TargetBucket", # required # target_grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE # }, # ], # target_prefix: "TargetPrefix", # required # }, # }, # content_md5: "ContentMD5", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] bucket_logging_status # @return [Types::BucketLoggingStatus] # # @!attribute [rw] content_md5 # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLoggingRequest AWS API Documentation # class PutBucketLoggingRequest < Struct.new( :bucket, :bucket_logging_status, :content_md5) include Aws::Structure end # @note When making an API call, you may pass PutBucketMetricsConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # id: "MetricsId", # required # metrics_configuration: { # required # id: "MetricsId", # required # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # }, # } # # @!attribute [rw] bucket # The name of the bucket for which the metrics configuration is set. # @return [String] # # @!attribute [rw] id # The ID used to identify the metrics configuration. # @return [String] # # @!attribute [rw] metrics_configuration # Specifies the metrics configuration. # @return [Types::MetricsConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfigurationRequest AWS API Documentation # class PutBucketMetricsConfigurationRequest < Struct.new( :bucket, :id, :metrics_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketNotificationConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # notification_configuration: { # required # topic_configurations: [ # { # id: "NotificationId", # topic_arn: "TopicArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # queue_configurations: [ # { # id: "NotificationId", # queue_arn: "QueueArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # lambda_function_configurations: [ # { # id: "NotificationId", # lambda_function_arn: "LambdaFunctionArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] notification_configuration # @return [Types::NotificationConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfigurationRequest AWS API Documentation # class PutBucketNotificationConfigurationRequest < Struct.new( :bucket, :notification_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketNotificationRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # notification_configuration: { # required # topic_configuration: { # id: "NotificationId", # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # topic: "TopicArn", # }, # queue_configuration: { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # queue: "QueueArn", # }, # cloud_function_configuration: { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # cloud_function: "CloudFunction", # invocation_role: "CloudFunctionInvocationRole", # }, # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] notification_configuration # @return [Types::NotificationConfigurationDeprecated] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationRequest AWS API Documentation # class PutBucketNotificationRequest < Struct.new( :bucket, :content_md5, :notification_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketPolicyRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # confirm_remove_self_bucket_access: false, # policy: "Policy", # required # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] confirm_remove_self_bucket_access # Set this parameter to true to confirm that you want to remove your # permissions to change this bucket policy in the future. # @return [Boolean] # # @!attribute [rw] policy # The bucket policy as a JSON document. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicyRequest AWS API Documentation # class PutBucketPolicyRequest < Struct.new( :bucket, :content_md5, :confirm_remove_self_bucket_access, :policy) include Aws::Structure end # @note When making an API call, you may pass PutBucketReplicationRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # replication_configuration: { # required # role: "Role", # required # rules: [ # required # { # id: "ID", # priority: 1, # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # source_selection_criteria: { # sse_kms_encrypted_objects: { # status: "Enabled", # required, accepts Enabled, Disabled # }, # }, # destination: { # required # bucket: "BucketName", # required # account: "AccountId", # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # access_control_translation: { # owner: "Destination", # required, accepts Destination # }, # encryption_configuration: { # replica_kms_key_id: "ReplicaKmsKeyID", # }, # }, # delete_marker_replication: { # status: "Enabled", # accepts Enabled, Disabled # }, # }, # ], # }, # token: "ObjectLockToken", # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # The base64-encoded 128-bit MD5 digest of the data. You must use this # header as a message integrity check to verify that the request body # was not corrupted in transit. # @return [String] # # @!attribute [rw] replication_configuration # @return [Types::ReplicationConfiguration] # # @!attribute [rw] token # A token that allows Amazon S3 object lock to be enabled for an # existing bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplicationRequest AWS API Documentation # class PutBucketReplicationRequest < Struct.new( :bucket, :content_md5, :replication_configuration, :token) include Aws::Structure end # @note When making an API call, you may pass PutBucketRequestPaymentRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # request_payment_configuration: { # required # payer: "Requester", # required, accepts Requester, BucketOwner # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] request_payment_configuration # @return [Types::RequestPaymentConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPaymentRequest AWS API Documentation # class PutBucketRequestPaymentRequest < Struct.new( :bucket, :content_md5, :request_payment_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketTaggingRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # tagging: { # required # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] tagging # @return [Types::Tagging] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTaggingRequest AWS API Documentation # class PutBucketTaggingRequest < Struct.new( :bucket, :content_md5, :tagging) include Aws::Structure end # @note When making an API call, you may pass PutBucketVersioningRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # mfa: "MFA", # versioning_configuration: { # required # mfa_delete: "Enabled", # accepts Enabled, Disabled # status: "Enabled", # accepts Enabled, Suspended # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication # device. # @return [String] # # @!attribute [rw] versioning_configuration # @return [Types::VersioningConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioningRequest AWS API Documentation # class PutBucketVersioningRequest < Struct.new( :bucket, :content_md5, :mfa, :versioning_configuration) include Aws::Structure end # @note When making an API call, you may pass PutBucketWebsiteRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # website_configuration: { # required # error_document: { # key: "ObjectKey", # required # }, # index_document: { # suffix: "Suffix", # required # }, # redirect_all_requests_to: { # host_name: "HostName", # required # protocol: "http", # accepts http, https # }, # routing_rules: [ # { # condition: { # http_error_code_returned_equals: "HttpErrorCodeReturnedEquals", # key_prefix_equals: "KeyPrefixEquals", # }, # redirect: { # required # host_name: "HostName", # http_redirect_code: "HttpRedirectCode", # protocol: "http", # accepts http, https # replace_key_prefix_with: "ReplaceKeyPrefixWith", # replace_key_with: "ReplaceKeyWith", # }, # }, # ], # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] website_configuration # @return [Types::WebsiteConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsiteRequest AWS API Documentation # class PutBucketWebsiteRequest < Struct.new( :bucket, :content_md5, :website_configuration) include Aws::Structure end # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAclOutput AWS API Documentation # class PutObjectAclOutput < Struct.new( :request_charged) include Aws::Structure end # @note When making an API call, you may pass PutObjectAclRequest # data as a hash: # # { # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_policy: { # grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # owner: { # display_name: "DisplayName", # id: "ID", # }, # }, # bucket: "BucketName", # required # content_md5: "ContentMD5", # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # } # # @!attribute [rw] acl # The canned ACL to apply to the object. # @return [String] # # @!attribute [rw] access_control_policy # Contains the elements that set the ACL permissions for an object per # grantee. # @return [Types::AccessControlPolicy] # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions # on the bucket. # @return [String] # # @!attribute [rw] grant_read # Allows grantee to list the objects in the bucket. # @return [String] # # @!attribute [rw] grant_read_acp # Allows grantee to read the bucket ACL. # @return [String] # # @!attribute [rw] grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @return [String] # # @!attribute [rw] grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] version_id # VersionId used to reference a specific version of the object. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAclRequest AWS API Documentation # class PutObjectAclRequest < Struct.new( :acl, :access_control_policy, :bucket, :content_md5, :grant_full_control, :grant_read, :grant_read_acp, :grant_write, :grant_write_acp, :key, :request_payer, :version_id) include Aws::Structure end # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLegalHoldOutput AWS API Documentation # class PutObjectLegalHoldOutput < Struct.new( :request_charged) include Aws::Structure end # @note When making an API call, you may pass PutObjectLegalHoldRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # legal_hold: { # status: "ON", # accepts ON, OFF # }, # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # content_md5: "ContentMD5", # } # # @!attribute [rw] bucket # The bucket containing the object that you want to place a Legal Hold # on. # @return [String] # # @!attribute [rw] key # The key name for the object that you want to place a Legal Hold on. # @return [String] # # @!attribute [rw] legal_hold # Container element for the Legal Hold configuration you want to apply # to the specified object. # @return [Types::ObjectLockLegalHold] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] version_id # The version ID of the object that you want to place a Legal Hold on. # @return [String] # # @!attribute [rw] content_md5 # The MD5 hash for the request body. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLegalHoldRequest AWS API Documentation # class PutObjectLegalHoldRequest < Struct.new( :bucket, :key, :legal_hold, :request_payer, :version_id, :content_md5) include Aws::Structure end # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLockConfigurationOutput AWS API Documentation # class PutObjectLockConfigurationOutput < Struct.new( :request_charged) include Aws::Structure end # @note When making an API call, you may pass PutObjectLockConfigurationRequest # data as a hash: # # { # bucket: "BucketName", # required # object_lock_configuration: { # object_lock_enabled: "Enabled", # accepts Enabled # rule: { # default_retention: { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # days: 1, # years: 1, # }, # }, # }, # request_payer: "requester", # accepts requester # token: "ObjectLockToken", # content_md5: "ContentMD5", # } # # @!attribute [rw] bucket # The bucket whose object lock configuration you want to create or # replace. # @return [String] # # @!attribute [rw] object_lock_configuration # The object lock configuration that you want to apply to the # specified bucket. # @return [Types::ObjectLockConfiguration] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] token # A token to allow Amazon S3 object lock to be enabled for an existing # bucket. # @return [String] # # @!attribute [rw] content_md5 # The MD5 hash for the request body. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLockConfigurationRequest AWS API Documentation # class PutObjectLockConfigurationRequest < Struct.new( :bucket, :object_lock_configuration, :request_payer, :token, :content_md5) include Aws::Structure end # @!attribute [rw] expiration # If the object expiration is configured, this will contain the # expiration date (expiry-date) and rule ID (rule-id). The value of # rule-id is URL encoded. # @return [String] # # @!attribute [rw] etag # Entity tag for the uploaded object. # @return [String] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] version_id # Version of the object. # @return [String] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] ssekms_encryption_context # If present, specifies the AWS KMS Encryption Context to use for # object encryption. The value of this header is a base64-encoded # UTF-8 string holding JSON with the encryption context key-value # pairs. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectOutput AWS API Documentation # class PutObjectOutput < Struct.new( :expiration, :etag, :server_side_encryption, :version_id, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :ssekms_encryption_context, :request_charged) include Aws::Structure end # @note When making an API call, you may pass PutObjectRequest # data as a hash: # # { # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # body: source_file, # bucket: "BucketName", # required # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_length: 1, # content_md5: "ContentMD5", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # } # # @!attribute [rw] acl # The canned ACL to apply to the object. # @return [String] # # @!attribute [rw] body # Object data. # @return [IO] # # @!attribute [rw] bucket # Name of the bucket to which the PUT operation was initiated. # @return [String] # # @!attribute [rw] cache_control # Specifies caching behavior along the request/reply chain. # @return [String] # # @!attribute [rw] content_disposition # Specifies presentational information for the object. # @return [String] # # @!attribute [rw] content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the # media-type referenced by the Content-Type header field. # @return [String] # # @!attribute [rw] content_language # The language the content is in. # @return [String] # # @!attribute [rw] content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # @return [Integer] # # @!attribute [rw] content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This # parameter is auto-populated when using the command from the CLI. # This parameted is required if object lock parameters are specified. # @return [String] # # @!attribute [rw] content_type # A standard MIME type describing the format of the object data. # @return [String] # # @!attribute [rw] expires # The date and time at which the object is no longer cacheable. # @return [Time] # # @!attribute [rw] grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @return [String] # # @!attribute [rw] grant_read # Allows grantee to read the object data and its metadata. # @return [String] # # @!attribute [rw] grant_read_acp # Allows grantee to read the object ACL. # @return [String] # # @!attribute [rw] grant_write_acp # Allows grantee to write the ACL for the applicable object. # @return [String] # # @!attribute [rw] key # Object key for which the PUT operation was initiated. # @return [String] # # @!attribute [rw] metadata # A map of metadata to store with the object in S3. # @return [Hash] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @return [String] # # @!attribute [rw] website_redirect_location # If the bucket is configured as a website, redirects requests for # this object to another object in the same bucket or to an external # URL. Amazon S3 stores the value of this header in the object # metadata. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET # and PUT requests for an object protected by AWS KMS will fail if not # made via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @return [String] # # @!attribute [rw] ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object # encryption. The value of this header is a base64-encoded UTF-8 # string holding JSON with the encryption context key-value pairs. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters. (For example, "Key1=Value1") # @return [String] # # @!attribute [rw] object_lock_mode # The object lock mode that you want to apply to this object. # @return [String] # # @!attribute [rw] object_lock_retain_until_date # The date and time when you want this object's object lock to # expire. # @return [Time] # # @!attribute [rw] object_lock_legal_hold_status # The Legal Hold status that you want to apply to the specified # object. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRequest AWS API Documentation # class PutObjectRequest < Struct.new( :acl, :body, :bucket, :cache_control, :content_disposition, :content_encoding, :content_language, :content_length, :content_md5, :content_type, :expires, :grant_full_control, :grant_read, :grant_read_acp, :grant_write_acp, :key, :metadata, :server_side_encryption, :storage_class, :website_redirect_location, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :ssekms_key_id, :ssekms_encryption_context, :request_payer, :tagging, :object_lock_mode, :object_lock_retain_until_date, :object_lock_legal_hold_status) include Aws::Structure end # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRetentionOutput AWS API Documentation # class PutObjectRetentionOutput < Struct.new( :request_charged) include Aws::Structure end # @note When making an API call, you may pass PutObjectRetentionRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # retention: { # mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # retain_until_date: Time.now, # }, # request_payer: "requester", # accepts requester # version_id: "ObjectVersionId", # bypass_governance_retention: false, # content_md5: "ContentMD5", # } # # @!attribute [rw] bucket # The bucket that contains the object you want to apply this Object # Retention configuration to. # @return [String] # # @!attribute [rw] key # The key name for the object that you want to apply this Object # Retention configuration to. # @return [String] # # @!attribute [rw] retention # The container element for the Object Retention configuration. # @return [Types::ObjectLockRetention] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @!attribute [rw] version_id # The version ID for the object that you want to apply this Object # Retention configuration to. # @return [String] # # @!attribute [rw] bypass_governance_retention # Indicates whether this operation should bypass Governance-mode # restrictions.j # @return [Boolean] # # @!attribute [rw] content_md5 # The MD5 hash for the request body. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRetentionRequest AWS API Documentation # class PutObjectRetentionRequest < Struct.new( :bucket, :key, :retention, :request_payer, :version_id, :bypass_governance_retention, :content_md5) include Aws::Structure end # @!attribute [rw] version_id # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTaggingOutput AWS API Documentation # class PutObjectTaggingOutput < Struct.new( :version_id) include Aws::Structure end # @note When making an API call, you may pass PutObjectTaggingRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # content_md5: "ContentMD5", # tagging: { # required # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # @return [String] # # @!attribute [rw] content_md5 # @return [String] # # @!attribute [rw] tagging # @return [Types::Tagging] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTaggingRequest AWS API Documentation # class PutObjectTaggingRequest < Struct.new( :bucket, :key, :version_id, :content_md5, :tagging) include Aws::Structure end # @note When making an API call, you may pass PutPublicAccessBlockRequest # data as a hash: # # { # bucket: "BucketName", # required # content_md5: "ContentMD5", # public_access_block_configuration: { # required # block_public_acls: false, # ignore_public_acls: false, # block_public_policy: false, # restrict_public_buckets: false, # }, # } # # @!attribute [rw] bucket # The name of the Amazon S3 bucket whose `PublicAccessBlock` # configuration you want to set. # @return [String] # # @!attribute [rw] content_md5 # The MD5 hash of the `PutPublicAccessBlock` request body. # @return [String] # # @!attribute [rw] public_access_block_configuration # The `PublicAccessBlock` configuration that you want to apply to this # Amazon S3 bucket. You can enable the configuration options in any # combination. For more information about when Amazon S3 considers a # bucket or object public, see [The Meaning of "Public"][1] in the # *Amazon Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status # @return [Types::PublicAccessBlockConfiguration] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutPublicAccessBlockRequest AWS API Documentation # class PutPublicAccessBlockRequest < Struct.new( :bucket, :content_md5, :public_access_block_configuration) include Aws::Structure end # Specifies the configuration for publishing messages to an Amazon # Simple Queue Service (Amazon SQS) queue when Amazon S3 detects # specified events. # # @note When making an API call, you may pass QueueConfiguration # data as a hash: # # { # id: "NotificationId", # queue_arn: "QueueArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # } # # @!attribute [rw] id # An optional unique identifier for configurations in a notification # configuration. If you don't provide one, Amazon S3 will assign an # ID. # @return [String] # # @!attribute [rw] queue_arn # The Amazon Resource Name (ARN) of the Amazon SQS queue to which # Amazon S3 publishes a message when it detects events of the # specified type. # @return [String] # # @!attribute [rw] events # @return [Array] # # @!attribute [rw] filter # @return [Types::NotificationConfigurationFilter] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/QueueConfiguration AWS API Documentation # class QueueConfiguration < Struct.new( :id, :queue_arn, :events, :filter) include Aws::Structure end # @note When making an API call, you may pass QueueConfigurationDeprecated # data as a hash: # # { # id: "NotificationId", # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # queue: "QueueArn", # } # # @!attribute [rw] id # An optional unique identifier for configurations in a notification # configuration. If you don't provide one, Amazon S3 will assign an # ID. # @return [String] # # @!attribute [rw] event # The bucket event for which to send notifications. # @return [String] # # @!attribute [rw] events # @return [Array] # # @!attribute [rw] queue # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/QueueConfigurationDeprecated AWS API Documentation # class QueueConfigurationDeprecated < Struct.new( :id, :event, :events, :queue) include Aws::Structure end # @!attribute [rw] payload # The byte array of partial, one or more result records. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RecordsEvent AWS API Documentation # class RecordsEvent < Struct.new( :payload, :event_type) include Aws::Structure end # Specifies how requests are redirected. In the event of an error, you # can specify a different error code to return. # # @note When making an API call, you may pass Redirect # data as a hash: # # { # host_name: "HostName", # http_redirect_code: "HttpRedirectCode", # protocol: "http", # accepts http, https # replace_key_prefix_with: "ReplaceKeyPrefixWith", # replace_key_with: "ReplaceKeyWith", # } # # @!attribute [rw] host_name # The host name to use in the redirect request. # @return [String] # # @!attribute [rw] http_redirect_code # The HTTP redirect code to use on the response. Not required if one # of the siblings is present. # @return [String] # # @!attribute [rw] protocol # Protocol to use when redirecting requests. The default is the # protocol that is used in the original request. # @return [String] # # @!attribute [rw] replace_key_prefix_with # The object key prefix to use in the redirect request. For example, # to redirect requests for all pages with prefix `docs/` (objects in # the `docs/` folder) to `documents/`, you can set a condition block # with `KeyPrefixEquals` set to `docs/` and in the Redirect set # `ReplaceKeyPrefixWith` to `/documents`. Not required if one of the # siblings is present. Can be present only if `ReplaceKeyWith` is not # provided. # @return [String] # # @!attribute [rw] replace_key_with # The specific object key to use in the redirect request. For example, # redirect request to `error.html`. Not required if one of the # siblings is present. Can be present only if `ReplaceKeyPrefixWith` # is not provided. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Redirect AWS API Documentation # class Redirect < Struct.new( :host_name, :http_redirect_code, :protocol, :replace_key_prefix_with, :replace_key_with) include Aws::Structure end # Specifies the redirect behavior of all requests to a website endpoint # of an Amazon S3 bucket. # # @note When making an API call, you may pass RedirectAllRequestsTo # data as a hash: # # { # host_name: "HostName", # required # protocol: "http", # accepts http, https # } # # @!attribute [rw] host_name # Name of the host where requests are redirected. # @return [String] # # @!attribute [rw] protocol # Protocol to use when redirecting requests. The default is the # protocol that is used in the original request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RedirectAllRequestsTo AWS API Documentation # class RedirectAllRequestsTo < Struct.new( :host_name, :protocol) include Aws::Structure end # A container for replication rules. You can add up to 1,000 rules. The # maximum size of a replication configuration is 2 MB. # # @note When making an API call, you may pass ReplicationConfiguration # data as a hash: # # { # role: "Role", # required # rules: [ # required # { # id: "ID", # priority: 1, # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # source_selection_criteria: { # sse_kms_encrypted_objects: { # status: "Enabled", # required, accepts Enabled, Disabled # }, # }, # destination: { # required # bucket: "BucketName", # required # account: "AccountId", # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # access_control_translation: { # owner: "Destination", # required, accepts Destination # }, # encryption_configuration: { # replica_kms_key_id: "ReplicaKmsKeyID", # }, # }, # delete_marker_replication: { # status: "Enabled", # accepts Enabled, Disabled # }, # }, # ], # } # # @!attribute [rw] role # The Amazon Resource Name (ARN) of the AWS Identity and Access # Management (IAM) role that Amazon S3 assumes when replicating # objects. For more information, see [How to Set Up Cross-Region # Replication][1] in the *Amazon Simple Storage Service Developer # Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-how-setup.html # @return [String] # # @!attribute [rw] rules # A container for one or more replication rules. A replication # configuration must have at least one rule and can contain a maximum # of 1,000 rules. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationConfiguration AWS API Documentation # class ReplicationConfiguration < Struct.new( :role, :rules) include Aws::Structure end # Specifies which Amazon S3 objects to replicate and where to store the # replicas. # # @note When making an API call, you may pass ReplicationRule # data as a hash: # # { # id: "ID", # priority: 1, # prefix: "Prefix", # filter: { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }, # status: "Enabled", # required, accepts Enabled, Disabled # source_selection_criteria: { # sse_kms_encrypted_objects: { # status: "Enabled", # required, accepts Enabled, Disabled # }, # }, # destination: { # required # bucket: "BucketName", # required # account: "AccountId", # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # access_control_translation: { # owner: "Destination", # required, accepts Destination # }, # encryption_configuration: { # replica_kms_key_id: "ReplicaKmsKeyID", # }, # }, # delete_marker_replication: { # status: "Enabled", # accepts Enabled, Disabled # }, # } # # @!attribute [rw] id # A unique identifier for the rule. The maximum value is 255 # characters. # @return [String] # # @!attribute [rw] priority # The priority associated with the rule. If you specify multiple rules # in a replication configuration, Amazon S3 prioritizes the rules to # prevent conflicts when filtering. If two or more rules identify the # same object based on a specified filter, the rule with higher # priority takes precedence. For example: # # * Same object quality prefix based filter criteria If prefixes you # specified in multiple rules overlap # # * Same object qualify tag based filter criteria specified in # multiple rules # # For more information, see [Cross-Region Replication (CRR)][1] in the # *Amazon S3 Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html # @return [Integer] # # @!attribute [rw] prefix # An object keyname prefix that identifies the object or objects to # which the rule applies. The maximum prefix length is 1,024 # characters. To include all objects in a bucket, specify an empty # string. # @return [String] # # @!attribute [rw] filter # @return [Types::ReplicationRuleFilter] # # @!attribute [rw] status # Specifies whether the rule is enabled. # @return [String] # # @!attribute [rw] source_selection_criteria # A container that describes additional filters for identifying the # source objects that you want to replicate. You can choose to enable # or disable the replication of these objects. Currently, Amazon S3 # supports only the filter that you can specify for objects created # with server-side encryption using an AWS KMS-Managed Key (SSE-KMS). # @return [Types::SourceSelectionCriteria] # # @!attribute [rw] destination # A container for information about the replication destination. # @return [Types::Destination] # # @!attribute [rw] delete_marker_replication # @return [Types::DeleteMarkerReplication] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationRule AWS API Documentation # class ReplicationRule < Struct.new( :id, :priority, :prefix, :filter, :status, :source_selection_criteria, :destination, :delete_marker_replication) include Aws::Structure end # @note When making an API call, you may pass ReplicationRuleAndOperator # data as a hash: # # { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # } # # @!attribute [rw] prefix # @return [String] # # @!attribute [rw] tags # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationRuleAndOperator AWS API Documentation # class ReplicationRuleAndOperator < Struct.new( :prefix, :tags) include Aws::Structure end # A filter that identifies the subset of objects to which the # replication rule applies. A `Filter` must specify exactly one # `Prefix`, `Tag`, or an `And` child element. # # @note When making an API call, you may pass ReplicationRuleFilter # data as a hash: # # { # prefix: "Prefix", # tag: { # key: "ObjectKey", # required # value: "Value", # required # }, # and: { # prefix: "Prefix", # tags: [ # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # } # # @!attribute [rw] prefix # An object keyname prefix that identifies the subset of objects to # which the rule applies. # @return [String] # # @!attribute [rw] tag # A container for specifying a tag key and value. # # The rule applies only to objects that have the tag in their tag set. # @return [Types::Tag] # # @!attribute [rw] and # A container for specifying rule filters. The filters determine the # subset of objects to which the rule applies. This element is # required only if you specify more than one filter. For example: # # * If you specify both a `Prefix` and a `Tag` filter, wrap these # filters in an `And` tag. # # * If you specify a filter based on multiple tags, wrap the `Tag` # elements in an `And` tag. # @return [Types::ReplicationRuleAndOperator] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ReplicationRuleFilter AWS API Documentation # class ReplicationRuleFilter < Struct.new( :prefix, :tag, :and) include Aws::Structure end # @note When making an API call, you may pass RequestPaymentConfiguration # data as a hash: # # { # payer: "Requester", # required, accepts Requester, BucketOwner # } # # @!attribute [rw] payer # Specifies who pays for the download and request fees. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RequestPaymentConfiguration AWS API Documentation # class RequestPaymentConfiguration < Struct.new( :payer) include Aws::Structure end # @note When making an API call, you may pass RequestProgress # data as a hash: # # { # enabled: false, # } # # @!attribute [rw] enabled # Specifies whether periodic QueryProgress frames should be sent. # Valid values: TRUE, FALSE. Default value: FALSE. # @return [Boolean] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RequestProgress AWS API Documentation # class RequestProgress < Struct.new( :enabled) include Aws::Structure end # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @!attribute [rw] restore_output_path # Indicates the path in the provided S3 output location where Select # results will be restored to. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObjectOutput AWS API Documentation # class RestoreObjectOutput < Struct.new( :request_charged, :restore_output_path) include Aws::Structure end # @note When making an API call, you may pass RestoreObjectRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # version_id: "ObjectVersionId", # restore_request: { # days: 1, # glacier_job_parameters: { # tier: "Standard", # required, accepts Standard, Bulk, Expedited # }, # type: "SELECT", # accepts SELECT # tier: "Standard", # accepts Standard, Bulk, Expedited # description: "Description", # select_parameters: { # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # expression_type: "SQL", # required, accepts SQL # expression: "Expression", # required # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # }, # output_location: { # s3: { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # }, # }, # }, # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] version_id # @return [String] # # @!attribute [rw] restore_request # @return [Types::RestoreRequest] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObjectRequest AWS API Documentation # class RestoreObjectRequest < Struct.new( :bucket, :key, :version_id, :restore_request, :request_payer) include Aws::Structure end # Container for restore job parameters. # # @note When making an API call, you may pass RestoreRequest # data as a hash: # # { # days: 1, # glacier_job_parameters: { # tier: "Standard", # required, accepts Standard, Bulk, Expedited # }, # type: "SELECT", # accepts SELECT # tier: "Standard", # accepts Standard, Bulk, Expedited # description: "Description", # select_parameters: { # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # expression_type: "SQL", # required, accepts SQL # expression: "Expression", # required # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # }, # output_location: { # s3: { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # }, # }, # } # # @!attribute [rw] days # Lifetime of the active copy in days. Do not use with restores that # specify OutputLocation. # @return [Integer] # # @!attribute [rw] glacier_job_parameters # Glacier related parameters pertaining to this job. Do not use with # restores that specify OutputLocation. # @return [Types::GlacierJobParameters] # # @!attribute [rw] type # Type of restore request. # @return [String] # # @!attribute [rw] tier # Glacier retrieval tier at which the restore will be processed. # @return [String] # # @!attribute [rw] description # The optional description for the job. # @return [String] # # @!attribute [rw] select_parameters # Describes the parameters for Select job types. # @return [Types::SelectParameters] # # @!attribute [rw] output_location # Describes the location where the restore job's output is stored. # @return [Types::OutputLocation] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreRequest AWS API Documentation # class RestoreRequest < Struct.new( :days, :glacier_job_parameters, :type, :tier, :description, :select_parameters, :output_location) include Aws::Structure end # Specifies the redirect behavior and when a redirect is applied. # # @note When making an API call, you may pass RoutingRule # data as a hash: # # { # condition: { # http_error_code_returned_equals: "HttpErrorCodeReturnedEquals", # key_prefix_equals: "KeyPrefixEquals", # }, # redirect: { # required # host_name: "HostName", # http_redirect_code: "HttpRedirectCode", # protocol: "http", # accepts http, https # replace_key_prefix_with: "ReplaceKeyPrefixWith", # replace_key_with: "ReplaceKeyWith", # }, # } # # @!attribute [rw] condition # A container for describing a condition that must be met for the # specified redirect to apply. For example, 1. If request is for pages # in the `/docs` folder, redirect to the `/documents` folder. 2. If # request results in HTTP error 4xx, redirect request to another host # where you might process the error. # @return [Types::Condition] # # @!attribute [rw] redirect # Container for redirect information. You can redirect requests to # another host, to another page, or with another protocol. In the # event of an error, you can specify a different error code to return. # @return [Types::Redirect] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RoutingRule AWS API Documentation # class RoutingRule < Struct.new( :condition, :redirect) include Aws::Structure end # Specifies lifecycle rules for an Amazon S3 bucket. For more # information, see [PUT Bucket lifecycle][1] in the *Amazon Simple # Storage Service API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html # # @note When making an API call, you may pass Rule # data as a hash: # # { # expiration: { # date: Time.now, # days: 1, # expired_object_delete_marker: false, # }, # id: "ID", # prefix: "Prefix", # required # status: "Enabled", # required, accepts Enabled, Disabled # transition: { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_transition: { # noncurrent_days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # }, # noncurrent_version_expiration: { # noncurrent_days: 1, # }, # abort_incomplete_multipart_upload: { # days_after_initiation: 1, # }, # } # # @!attribute [rw] expiration # @return [Types::LifecycleExpiration] # # @!attribute [rw] id # Unique identifier for the rule. The value can't be longer than 255 # characters. # @return [String] # # @!attribute [rw] prefix # Object key prefix that identifies one or more objects to which this # rule applies. # @return [String] # # @!attribute [rw] status # If `Enabled`, the rule is currently being applied. If `Disabled`, # the rule is not currently being applied. # @return [String] # # @!attribute [rw] transition # @return [Types::Transition] # # @!attribute [rw] noncurrent_version_transition # @return [Types::NoncurrentVersionTransition] # # @!attribute [rw] noncurrent_version_expiration # @return [Types::NoncurrentVersionExpiration] # # @!attribute [rw] abort_incomplete_multipart_upload # @return [Types::AbortIncompleteMultipartUpload] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Rule AWS API Documentation # class Rule < Struct.new( :expiration, :id, :prefix, :status, :transition, :noncurrent_version_transition, :noncurrent_version_expiration, :abort_incomplete_multipart_upload) include Aws::Structure end # A container for object key name prefix and suffix filtering rules. # # @note When making an API call, you may pass S3KeyFilter # data as a hash: # # { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # } # # @!attribute [rw] filter_rules # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/S3KeyFilter AWS API Documentation # class S3KeyFilter < Struct.new( :filter_rules) include Aws::Structure end # Describes an S3 location that will receive the results of the restore # request. # # @note When making an API call, you may pass S3Location # data as a hash: # # { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # } # # @!attribute [rw] bucket_name # The name of the bucket where the restore results will be placed. # @return [String] # # @!attribute [rw] prefix # The prefix that is prepended to the restore results for this # request. # @return [String] # # @!attribute [rw] encryption # @return [Types::Encryption] # # @!attribute [rw] canned_acl # The canned ACL to apply to the restore results. # @return [String] # # @!attribute [rw] access_control_list # A list of grants that control access to the staged results. # @return [Array] # # @!attribute [rw] tagging # The tag-set that is applied to the restore results. # @return [Types::Tagging] # # @!attribute [rw] user_metadata # A list of metadata to store with the restore results in S3. # @return [Array] # # @!attribute [rw] storage_class # The class of storage used to store the restore results. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/S3Location AWS API Documentation # class S3Location < Struct.new( :bucket_name, :prefix, :encryption, :canned_acl, :access_control_list, :tagging, :user_metadata, :storage_class) include Aws::Structure end # Specifies the use of SSE-KMS to encrypt delivered Inventory reports. # # @note When making an API call, you may pass SSEKMS # data as a hash: # # { # key_id: "SSEKMSKeyId", # required # } # # @!attribute [rw] key_id # Specifies the ID of the AWS Key Management Service (KMS) master # encryption key to use for encrypting Inventory reports. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SSEKMS AWS API Documentation # class SSEKMS < Struct.new( :key_id) include Aws::Structure end # Specifies the use of SSE-S3 to encrypt delivered Inventory reports. # # @api private # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SSES3 AWS API Documentation # class SSES3 < Aws::EmptyStructure; end # @!attribute [rw] payload # @return [Types::SelectObjectContentEventStream] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContentOutput AWS API Documentation # class SelectObjectContentOutput < Struct.new( :payload) include Aws::Structure end # Request to filter the contents of an Amazon S3 object based on a # simple Structured Query Language (SQL) statement. In the request, # along with the SQL expression, you must specify a data serialization # format (JSON or CSV) of the object. Amazon S3 uses this to parse # object data into records. It returns only records that match the # specified SQL expression. You must also specify the data serialization # format for the response. For more information, see [S3Select API # Documentation][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html # # @note When making an API call, you may pass SelectObjectContentRequest # data as a hash: # # { # bucket: "BucketName", # required # key: "ObjectKey", # required # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # expression: "Expression", # required # expression_type: "SQL", # required, accepts SQL # request_progress: { # enabled: false, # }, # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # } # # @!attribute [rw] bucket # The S3 bucket. # @return [String] # # @!attribute [rw] key # The object key. # @return [String] # # @!attribute [rw] sse_customer_algorithm # The SSE Algorithm used to encrypt the object. For more information, # see [ Server-Side Encryption (Using Customer-Provided Encryption # Keys][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html # @return [String] # # @!attribute [rw] sse_customer_key # The SSE Customer Key. For more information, see [ Server-Side # Encryption (Using Customer-Provided Encryption Keys][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html # @return [String] # # @!attribute [rw] sse_customer_key_md5 # The SSE Customer Key MD5. For more information, see [ Server-Side # Encryption (Using Customer-Provided Encryption Keys][1]. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html # @return [String] # # @!attribute [rw] expression # The expression that is used to query the object. # @return [String] # # @!attribute [rw] expression_type # The type of the provided expression (for example., SQL). # @return [String] # # @!attribute [rw] request_progress # Specifies if periodic request progress information should be # enabled. # @return [Types::RequestProgress] # # @!attribute [rw] input_serialization # Describes the format of the data in the object that is being # queried. # @return [Types::InputSerialization] # # @!attribute [rw] output_serialization # Describes the format of the data that you want Amazon S3 to return # in response. # @return [Types::OutputSerialization] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContentRequest AWS API Documentation # class SelectObjectContentRequest < Struct.new( :bucket, :key, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :expression, :expression_type, :request_progress, :input_serialization, :output_serialization) include Aws::Structure end # Describes the parameters for Select job types. # # @note When making an API call, you may pass SelectParameters # data as a hash: # # { # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # expression_type: "SQL", # required, accepts SQL # expression: "Expression", # required # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # } # # @!attribute [rw] input_serialization # Describes the serialization format of the object. # @return [Types::InputSerialization] # # @!attribute [rw] expression_type # The type of the provided expression (e.g., SQL). # @return [String] # # @!attribute [rw] expression # The expression that is used to query the object. # @return [String] # # @!attribute [rw] output_serialization # Describes how the results of the Select job are serialized. # @return [Types::OutputSerialization] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectParameters AWS API Documentation # class SelectParameters < Struct.new( :input_serialization, :expression_type, :expression, :output_serialization) include Aws::Structure end # Describes the default server-side encryption to apply to new objects # in the bucket. If a PUT Object request doesn't specify any # server-side encryption, this default encryption will be applied. For # more information, see [PUT Bucket encryption][1] in the *Amazon Simple # Storage Service API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html # # @note When making an API call, you may pass ServerSideEncryptionByDefault # data as a hash: # # { # sse_algorithm: "AES256", # required, accepts AES256, aws:kms # kms_master_key_id: "SSEKMSKeyId", # } # # @!attribute [rw] sse_algorithm # Server-side encryption algorithm to use for the default encryption. # @return [String] # # @!attribute [rw] kms_master_key_id # KMS master key ID to use for the default encryption. This parameter # is allowed if and only if `SSEAlgorithm` is set to `aws:kms`. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ServerSideEncryptionByDefault AWS API Documentation # class ServerSideEncryptionByDefault < Struct.new( :sse_algorithm, :kms_master_key_id) include Aws::Structure end # Specifies the default server-side-encryption configuration. # # @note When making an API call, you may pass ServerSideEncryptionConfiguration # data as a hash: # # { # rules: [ # required # { # apply_server_side_encryption_by_default: { # sse_algorithm: "AES256", # required, accepts AES256, aws:kms # kms_master_key_id: "SSEKMSKeyId", # }, # }, # ], # } # # @!attribute [rw] rules # Container for information about a particular server-side encryption # configuration rule. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ServerSideEncryptionConfiguration AWS API Documentation # class ServerSideEncryptionConfiguration < Struct.new( :rules) include Aws::Structure end # Specifies the default server-side encryption configuration. # # @note When making an API call, you may pass ServerSideEncryptionRule # data as a hash: # # { # apply_server_side_encryption_by_default: { # sse_algorithm: "AES256", # required, accepts AES256, aws:kms # kms_master_key_id: "SSEKMSKeyId", # }, # } # # @!attribute [rw] apply_server_side_encryption_by_default # Specifies the default server-side encryption to apply to new objects # in the bucket. If a PUT Object request doesn't specify any # server-side encryption, this default encryption will be applied. # @return [Types::ServerSideEncryptionByDefault] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ServerSideEncryptionRule AWS API Documentation # class ServerSideEncryptionRule < Struct.new( :apply_server_side_encryption_by_default) include Aws::Structure end # A container that describes additional filters for identifying the # source objects that you want to replicate. You can choose to enable or # disable the replication of these objects. Currently, Amazon S3 # supports only the filter that you can specify for objects created with # server-side encryption using an AWS KMS-Managed Key (SSE-KMS). # # @note When making an API call, you may pass SourceSelectionCriteria # data as a hash: # # { # sse_kms_encrypted_objects: { # status: "Enabled", # required, accepts Enabled, Disabled # }, # } # # @!attribute [rw] sse_kms_encrypted_objects # A container for filter information for the selection of Amazon S3 # objects encrypted with AWS KMS. If you include # `SourceSelectionCriteria` in the replication configuration, this # element is required. # @return [Types::SseKmsEncryptedObjects] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SourceSelectionCriteria AWS API Documentation # class SourceSelectionCriteria < Struct.new( :sse_kms_encrypted_objects) include Aws::Structure end # A container for filter information for the selection of S3 objects # encrypted with AWS KMS. # # @note When making an API call, you may pass SseKmsEncryptedObjects # data as a hash: # # { # status: "Enabled", # required, accepts Enabled, Disabled # } # # @!attribute [rw] status # Specifies whether Amazon S3 replicates objects created with # server-side encryption using an AWS KMS-managed key. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SseKmsEncryptedObjects AWS API Documentation # class SseKmsEncryptedObjects < Struct.new( :status) include Aws::Structure end # @!attribute [rw] bytes_scanned # The total number of object bytes scanned. # @return [Integer] # # @!attribute [rw] bytes_processed # The total number of uncompressed object bytes processed. # @return [Integer] # # @!attribute [rw] bytes_returned # The total number of bytes of records payload data returned. # @return [Integer] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Stats AWS API Documentation # class Stats < Struct.new( :bytes_scanned, :bytes_processed, :bytes_returned) include Aws::Structure end # @!attribute [rw] details # The Stats event details. # @return [Types::Stats] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StatsEvent AWS API Documentation # class StatsEvent < Struct.new( :details, :event_type) include Aws::Structure end # Specifies data related to access patterns to be collected and made # available to analyze the tradeoffs between different storage classes # for an Amazon S3 bucket. # # @note When making an API call, you may pass StorageClassAnalysis # data as a hash: # # { # data_export: { # output_schema_version: "V_1", # required, accepts V_1 # destination: { # required # s3_bucket_destination: { # required # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # }, # }, # }, # } # # @!attribute [rw] data_export # Specifies how data related to the storage class analysis for an # Amazon S3 bucket should be exported. # @return [Types::StorageClassAnalysisDataExport] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StorageClassAnalysis AWS API Documentation # class StorageClassAnalysis < Struct.new( :data_export) include Aws::Structure end # @note When making an API call, you may pass StorageClassAnalysisDataExport # data as a hash: # # { # output_schema_version: "V_1", # required, accepts V_1 # destination: { # required # s3_bucket_destination: { # required # format: "CSV", # required, accepts CSV # bucket_account_id: "AccountId", # bucket: "BucketName", # required # prefix: "Prefix", # }, # }, # } # # @!attribute [rw] output_schema_version # The version of the output schema to use when exporting data. Must be # `V_1`. # @return [String] # # @!attribute [rw] destination # The place to store the data for an analysis. # @return [Types::AnalyticsExportDestination] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/StorageClassAnalysisDataExport AWS API Documentation # class StorageClassAnalysisDataExport < Struct.new( :output_schema_version, :destination) include Aws::Structure end # @note When making an API call, you may pass Tag # data as a hash: # # { # key: "ObjectKey", # required # value: "Value", # required # } # # @!attribute [rw] key # Name of the tag. # @return [String] # # @!attribute [rw] value # Value of the tag. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Tag AWS API Documentation # class Tag < Struct.new( :key, :value) include Aws::Structure end # @note When making an API call, you may pass Tagging # data as a hash: # # { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # } # # @!attribute [rw] tag_set # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Tagging AWS API Documentation # class Tagging < Struct.new( :tag_set) include Aws::Structure end # @note When making an API call, you may pass TargetGrant # data as a hash: # # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE # } # # @!attribute [rw] grantee # @return [Types::Grantee] # # @!attribute [rw] permission # Logging permissions assigned to the Grantee for the bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TargetGrant AWS API Documentation # class TargetGrant < Struct.new( :grantee, :permission) include Aws::Structure end # A container for specifying the configuration for publication of # messages to an Amazon Simple Notification Service (Amazon SNS) topic # when Amazon S3 detects specified events. # # @note When making an API call, you may pass TopicConfiguration # data as a hash: # # { # id: "NotificationId", # topic_arn: "TopicArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # } # # @!attribute [rw] id # An optional unique identifier for configurations in a notification # configuration. If you don't provide one, Amazon S3 will assign an # ID. # @return [String] # # @!attribute [rw] topic_arn # The Amazon Resource Name (ARN) of the Amazon SNS topic to which # Amazon S3 publishes a message when it detects events of the # specified type. # @return [String] # # @!attribute [rw] events # The Amazon S3 bucket event about which to send notifications. For # more information, see [Supported Event Types][1] in the *Amazon # Simple Storage Service Developer Guide*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html # @return [Array] # # @!attribute [rw] filter # @return [Types::NotificationConfigurationFilter] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfiguration AWS API Documentation # class TopicConfiguration < Struct.new( :id, :topic_arn, :events, :filter) include Aws::Structure end # @note When making an API call, you may pass TopicConfigurationDeprecated # data as a hash: # # { # id: "NotificationId", # events: ["s3:ReducedRedundancyLostObject"], # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # event: "s3:ReducedRedundancyLostObject", # accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # topic: "TopicArn", # } # # @!attribute [rw] id # An optional unique identifier for configurations in a notification # configuration. If you don't provide one, Amazon S3 will assign an # ID. # @return [String] # # @!attribute [rw] events # @return [Array] # # @!attribute [rw] event # Bucket event for which to send notifications. # @return [String] # # @!attribute [rw] topic # Amazon SNS topic to which Amazon S3 will publish a message to report # the specified events for the bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/TopicConfigurationDeprecated AWS API Documentation # class TopicConfigurationDeprecated < Struct.new( :id, :events, :event, :topic) include Aws::Structure end # Specifies when an object transitions to a specified storage class. # # @note When making an API call, you may pass Transition # data as a hash: # # { # date: Time.now, # days: 1, # storage_class: "GLACIER", # accepts GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE # } # # @!attribute [rw] date # Indicates when objects are transitioned to the specified storage # class. The date value must be in ISO 8601 format. The time is always # midnight UTC. # @return [Time] # # @!attribute [rw] days # Indicates the number of days after creation when objects are # transitioned to the specified storage class. The value must be a # positive integer. # @return [Integer] # # @!attribute [rw] storage_class # The storage class to which you want the object to transition. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/Transition AWS API Documentation # class Transition < Struct.new( :date, :days, :storage_class) include Aws::Structure end # @!attribute [rw] copy_source_version_id # The version of the source object that was copied, if you have # enabled versioning on the source bucket. # @return [String] # # @!attribute [rw] copy_part_result # @return [Types::CopyPartResult] # # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopyOutput AWS API Documentation # class UploadPartCopyOutput < Struct.new( :copy_source_version_id, :copy_part_result, :server_side_encryption, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :request_charged) include Aws::Structure end # @note When making an API call, you may pass UploadPartCopyRequest # data as a hash: # # { # bucket: "BucketName", # required # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # copy_source_range: "CopySourceRange", # key: "ObjectKey", # required # part_number: 1, # required # upload_id: "MultipartUploadId", # required # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] bucket # @return [String] # # @!attribute [rw] copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # @return [String] # # @!attribute [rw] copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified # tag. # @return [String] # # @!attribute [rw] copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # @return [Time] # # @!attribute [rw] copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # @return [String] # # @!attribute [rw] copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # @return [Time] # # @!attribute [rw] copy_source_range # The range of bytes to copy from the source object. The range value # must use the form bytes=first-last, where the first and last are the # zero-based byte offsets to copy. For example, bytes=0-9 indicates # that you want to copy the first ten bytes of the source. You can # copy a range only if the source object is greater than 5 MB. # @return [String] # # @!attribute [rw] key # @return [String] # # @!attribute [rw] part_number # Part number of part being copied. This is a positive integer between # 1 and 10,000. # @return [Integer] # # @!attribute [rw] upload_id # Upload ID identifying the multipart upload whose part is being # copied. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. This must # be the same encryption key specified in the initiate multipart # upload request. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # @return [String] # # @!attribute [rw] copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # to decrypt the source object. The encryption key provided in this # header must be one that was used when the source object was created. # @return [String] # # @!attribute [rw] copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopyRequest AWS API Documentation # class UploadPartCopyRequest < Struct.new( :bucket, :copy_source, :copy_source_if_match, :copy_source_if_modified_since, :copy_source_if_none_match, :copy_source_if_unmodified_since, :copy_source_range, :key, :part_number, :upload_id, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :copy_source_sse_customer_algorithm, :copy_source_sse_customer_key, :copy_source_sse_customer_key_md5, :request_payer) include Aws::Structure end # @!attribute [rw] server_side_encryption # The Server-side encryption algorithm used when storing this object # in S3 (e.g., AES256, aws:kms). # @return [String] # # @!attribute [rw] etag # Entity tag for the uploaded object. # @return [String] # # @!attribute [rw] sse_customer_algorithm # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header confirming the # encryption algorithm used. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # If server-side encryption with a customer-provided encryption key # was requested, the response will include this header to provide # round trip message integrity verification of the customer-provided # encryption key. # @return [String] # # @!attribute [rw] ssekms_key_id # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] # # @!attribute [rw] request_charged # If present, indicates that the requester was successfully charged # for the request. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartOutput AWS API Documentation # class UploadPartOutput < Struct.new( :server_side_encryption, :etag, :sse_customer_algorithm, :sse_customer_key_md5, :ssekms_key_id, :request_charged) include Aws::Structure end # @note When making an API call, you may pass UploadPartRequest # data as a hash: # # { # body: source_file, # bucket: "BucketName", # required # content_length: 1, # content_md5: "ContentMD5", # key: "ObjectKey", # required # part_number: 1, # required # upload_id: "MultipartUploadId", # required # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # } # # @!attribute [rw] body # Object data. # @return [IO] # # @!attribute [rw] bucket # Name of the bucket to which the multipart upload was initiated. # @return [String] # # @!attribute [rw] content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # @return [Integer] # # @!attribute [rw] content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This # parameter is auto-populated when using the command from the CLI. # This parameted is required if object lock parameters are specified. # @return [String] # # @!attribute [rw] key # Object key for which the multipart upload was initiated. # @return [String] # # @!attribute [rw] part_number # Part number of part being uploaded. This is a positive integer # between 1 and 10,000. # @return [Integer] # # @!attribute [rw] upload_id # Upload ID identifying the multipart upload whose part is being # uploaded. # @return [String] # # @!attribute [rw] sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @return [String] # # @!attribute [rw] sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use # in encrypting data. This value is used to store the object and then # it is discarded; Amazon does not store the encryption key. The key # must be appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. This must # be the same encryption key specified in the initiate multipart # upload request. # @return [String] # # @!attribute [rw] sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check # to ensure the encryption key was transmitted without error. # @return [String] # # @!attribute [rw] request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartRequest AWS API Documentation # class UploadPartRequest < Struct.new( :body, :bucket, :content_length, :content_md5, :key, :part_number, :upload_id, :sse_customer_algorithm, :sse_customer_key, :sse_customer_key_md5, :request_payer) include Aws::Structure end # Describes the versioning state of an Amazon S3 bucket. For more # information, see [PUT Bucket versioning][1] in the *Amazon Simple # Storage Service API Reference*. # # # # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html # # @note When making an API call, you may pass VersioningConfiguration # data as a hash: # # { # mfa_delete: "Enabled", # accepts Enabled, Disabled # status: "Enabled", # accepts Enabled, Suspended # } # # @!attribute [rw] mfa_delete # Specifies whether MFA delete is enabled in the bucket versioning # configuration. This element is only returned if the bucket has been # configured with MFA delete. If the bucket has never been so # configured, this element is not returned. # @return [String] # # @!attribute [rw] status # The versioning state of the bucket. # @return [String] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/VersioningConfiguration AWS API Documentation # class VersioningConfiguration < Struct.new( :mfa_delete, :status) include Aws::Structure end # Specifies website configuration parameters for an Amazon S3 bucket. # # @note When making an API call, you may pass WebsiteConfiguration # data as a hash: # # { # error_document: { # key: "ObjectKey", # required # }, # index_document: { # suffix: "Suffix", # required # }, # redirect_all_requests_to: { # host_name: "HostName", # required # protocol: "http", # accepts http, https # }, # routing_rules: [ # { # condition: { # http_error_code_returned_equals: "HttpErrorCodeReturnedEquals", # key_prefix_equals: "KeyPrefixEquals", # }, # redirect: { # required # host_name: "HostName", # http_redirect_code: "HttpRedirectCode", # protocol: "http", # accepts http, https # replace_key_prefix_with: "ReplaceKeyPrefixWith", # replace_key_with: "ReplaceKeyWith", # }, # }, # ], # } # # @!attribute [rw] error_document # The name of the error document for the website. # @return [Types::ErrorDocument] # # @!attribute [rw] index_document # The name of the index document for the website. # @return [Types::IndexDocument] # # @!attribute [rw] redirect_all_requests_to # The redirect behavior for every request to this bucket's website # endpoint. # # If you specify this property, you can't specify any other property. # @return [Types::RedirectAllRequestsTo] # # @!attribute [rw] routing_rules # Rules that define when a redirect is applied and the redirect # behavior. # @return [Array] # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WebsiteConfiguration AWS API Documentation # class WebsiteConfiguration < Struct.new( :error_document, :index_document, :redirect_all_requests_to, :routing_rules) include Aws::Structure end # EventStream is an Enumerator of Events. # #event_types #=> Array, returns all modeled event types in the stream # # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContentEventStream AWS API Documentation # class SelectObjectContentEventStream < Enumerator def event_types [ :records, :stats, :progress, :cont, :end ] end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket.rb0000644000004100000410000006353313536452011020006 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class Bucket extend Aws::Deprecations # @overload def initialize(name, options = {}) # @param [String] name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @name = extract_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def name @name end # Date the bucket was created. # @return [Time] def creation_date data[:creation_date] end # @!endgroup # @return [Client] def client @client end # @raise [NotImplementedError] # @api private def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end alias :reload :load # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`. # @return [Types::Bucket] # Returns the data for this {Bucket}. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @param [Hash] options ({}) # @return [Boolean] # Returns `true` if the Bucket exists. def exists?(options = {}) begin wait_until_exists(options.merge(max_attempts: 1)) true rescue Aws::Waiters::Errors::UnexpectedError => e raise e.error rescue Aws::Waiters::Errors::WaiterFailed false end end # @param [Hash] options ({}) # @option options [Integer] :max_attempts (20) # @option options [Float] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait # @return [Bucket] def wait_until_exists(options = {}, &block) options, params = separate_params_and_options(options) waiter = Waiters::BucketExists.new(options) yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(bucket: @name)) Bucket.new({ name: @name, client: @client }) end # @param [Hash] options ({}) # @option options [Integer] :max_attempts (20) # @option options [Float] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait # @return [Bucket] def wait_until_not_exists(options = {}, &block) options, params = separate_params_and_options(options) waiter = Waiters::BucketNotExists.new(options) yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(bucket: @name)) Bucket.new({ name: @name, client: @client }) end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket.create({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read # create_bucket_configuration: { # location_constraint: "EU", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1 # }, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write: "GrantWrite", # grant_write_acp: "GrantWriteACP", # object_lock_enabled_for_bucket: false, # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the bucket. # @option options [Types::CreateBucketConfiguration] :create_bucket_configuration # @option options [String] :grant_full_control # Allows grantee the read, write, read ACP, and write ACP permissions on # the bucket. # @option options [String] :grant_read # Allows grantee to list the objects in the bucket. # @option options [String] :grant_read_acp # Allows grantee to read the bucket ACL. # @option options [String] :grant_write # Allows grantee to create, overwrite, and delete any object in the # bucket. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable bucket. # @option options [Boolean] :object_lock_enabled_for_bucket # Specifies whether you want Amazon S3 object lock to be enabled for the # new bucket. # @return [Types::CreateBucketOutput] def create(options = {}) options = options.merge(bucket: @name) resp = @client.create_bucket(options) resp.data end # @example Request syntax with placeholder values # # bucket.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @name) resp = @client.delete_bucket(options) resp.data end # @example Request syntax with placeholder values # # bucket.delete_objects({ # delete: { # required # objects: [ # required # { # key: "ObjectKey", # required # version_id: "ObjectVersionId", # }, # ], # quiet: false, # }, # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param [Hash] options ({}) # @option options [required, Types::Delete] :delete # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Specifies whether you want to delete this object even if it has a # Governance-type object lock in place. You must have sufficient # permissions to perform this operation. # @return [Types::DeleteObjectsOutput] def delete_objects(options = {}) options = options.merge(bucket: @name) resp = @client.delete_objects(options) resp.data end # @example Request syntax with placeholder values # # object = bucket.put_object({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # body: source_file, # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_length: 1, # content_md5: "ContentMD5", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # key: "ObjectKey", # required # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String, IO] :body # Object data. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [Integer] :content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # @option options [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This parameter # is auto-populated when using the command from the CLI. This parameted # is required if object lock parameters are specified. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [required, String] :key # Object key for which the PUT operation was initiated. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters. (For example, "Key1=Value1") # @option options [String] :object_lock_mode # The object lock mode that you want to apply to this object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want this object's object lock to expire. # @option options [String] :object_lock_legal_hold_status # The Legal Hold status that you want to apply to the specified object. # @return [Object] def put_object(options = {}) options = options.merge(bucket: @name) resp = @client.put_object(options) Object.new( bucket_name: @name, key: options[:key], client: @client ) end # @!group Associations # @return [BucketAcl] def acl BucketAcl.new( bucket_name: @name, client: @client ) end # @return [BucketCors] def cors BucketCors.new( bucket_name: @name, client: @client ) end # @return [BucketLifecycle] def lifecycle BucketLifecycle.new( bucket_name: @name, client: @client ) end # @return [BucketLifecycleConfiguration] def lifecycle_configuration BucketLifecycleConfiguration.new( bucket_name: @name, client: @client ) end # @return [BucketLogging] def logging BucketLogging.new( bucket_name: @name, client: @client ) end # @example Request syntax with placeholder values # # multipart_uploads = bucket.multipart_uploads({ # delimiter: "Delimiter", # encoding_type: "url", # accepts url # key_marker: "KeyMarker", # prefix: "Prefix", # upload_id_marker: "UploadIdMarker", # }) # @param [Hash] options ({}) # @option options [String] :delimiter # Character you use to group keys. # @option options [String] :encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # @option options [String] :key_marker # Together with upload-id-marker, this parameter specifies the multipart # upload after which listing should begin. # @option options [String] :prefix # Lists in-progress uploads only for those keys that begin with the # specified prefix. # @option options [String] :upload_id_marker # Together with key-marker, specifies the multipart upload after which # listing should begin. If key-marker is not specified, the # upload-id-marker parameter is ignored. # @return [MultipartUpload::Collection] def multipart_uploads(options = {}) batches = Enumerator.new do |y| options = options.merge(bucket: @name) resp = @client.list_multipart_uploads(options) resp.each_page do |page| batch = [] page.data.uploads.each do |u| batch << MultipartUpload.new( bucket_name: @name, object_key: u.key, id: u.upload_id, data: u, client: @client ) end y.yield(batch) end end MultipartUpload::Collection.new(batches) end # @return [BucketNotification] def notification BucketNotification.new( bucket_name: @name, client: @client ) end # @param [String] key # @return [Object] def object(key) Object.new( bucket_name: @name, key: key, client: @client ) end # @example Request syntax with placeholder values # # object_versions = bucket.object_versions({ # delimiter: "Delimiter", # encoding_type: "url", # accepts url # key_marker: "KeyMarker", # prefix: "Prefix", # version_id_marker: "VersionIdMarker", # }) # @param [Hash] options ({}) # @option options [String] :delimiter # A delimiter is a character you use to group keys. # @option options [String] :encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # @option options [String] :key_marker # Specifies the key to start with when listing objects in a bucket. # @option options [String] :prefix # Limits the response to keys that begin with the specified prefix. # @option options [String] :version_id_marker # Specifies the object version you want to start listing from. # @return [ObjectVersion::Collection] def object_versions(options = {}) batches = Enumerator.new do |y| options = options.merge(bucket: @name) resp = @client.list_object_versions(options) resp.each_page do |page| batch = [] page.data.versions_delete_markers.each do |v| batch << ObjectVersion.new( bucket_name: @name, object_key: v.key, id: v.version_id, data: v, client: @client ) end y.yield(batch) end end ObjectVersion::Collection.new(batches) end # @example Request syntax with placeholder values # # objects = bucket.objects({ # delimiter: "Delimiter", # encoding_type: "url", # accepts url # prefix: "Prefix", # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [String] :delimiter # A delimiter is a character you use to group keys. # @option options [String] :encoding_type # Requests Amazon S3 to encode the object keys in the response and # specifies the encoding method to use. An object key may contain any # Unicode character; however, XML 1.0 parser cannot parse some # characters, such as characters with an ASCII value from 0 to 10. For # characters that are not supported in XML 1.0, you can add this # parameter to request that Amazon S3 encode the keys in the response. # @option options [String] :prefix # Limits the response to keys that begin with the specified prefix. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the list objects request. Bucket owners need not specify this # parameter in their requests. # @return [ObjectSummary::Collection] def objects(options = {}) batches = Enumerator.new do |y| options = options.merge(bucket: @name) resp = @client.list_objects(options) resp.each_page do |page| batch = [] page.data.contents.each do |c| batch << ObjectSummary.new( bucket_name: @name, key: c.key, data: c, client: @client ) end y.yield(batch) end end ObjectSummary::Collection.new(batches) end # @return [BucketPolicy] def policy BucketPolicy.new( bucket_name: @name, client: @client ) end # @return [BucketRequestPayment] def request_payment BucketRequestPayment.new( bucket_name: @name, client: @client ) end # @return [BucketTagging] def tagging BucketTagging.new( bucket_name: @name, client: @client ) end # @return [BucketVersioning] def versioning BucketVersioning.new( bucket_name: @name, client: @client ) end # @return [BucketWebsite] def website BucketWebsite.new( bucket_name: @name, client: @client ) end # @deprecated # @api private def identifiers { name: @name } end deprecated(:identifiers) private def extract_name(args, options) value = args[0] || options.delete(:name) case value when String then value when nil then raise ArgumentError, "missing required option :name" else msg = "expected :name to be a String, got #{value.class}" raise ArgumentError, msg end end def yield_waiter_and_warn(waiter, &block) if !@waiter_block_warned msg = "pass options to configure the waiter; " msg << "yielding the waiter is deprecated" warn(msg) @waiter_block_warned = true end yield(waiter.waiter) end def separate_params_and_options(options) opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait]) waiter_opts = {} waiter_params = {} options.each_pair do |key, value| if opts.include?(key) waiter_opts[key] = value else waiter_params[key] = value end end waiter_opts[:client] ||= @client [waiter_opts, waiter_params] end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/waiters.rb0000644000004100000410000001132013536452011020172 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'aws-sdk-core/waiters' module Aws::S3 module Waiters class BucketExists # @param [Hash] options # @option options [required, Client] :client # @option options [Integer] :max_attempts (20) # @option options [Integer] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait def initialize(options) @client = options.fetch(:client) @waiter = Aws::Waiters::Waiter.new({ max_attempts: 20, delay: 5, poller: Aws::Waiters::Poller.new( operation_name: :head_bucket, acceptors: [ { "expected" => 200, "matcher" => "status", "state" => "success" }, { "expected" => 301, "matcher" => "status", "state" => "success" }, { "expected" => 403, "matcher" => "status", "state" => "success" }, { "expected" => 404, "matcher" => "status", "state" => "retry" } ] ) }.merge(options)) end # @option (see Client#head_bucket) # @return (see Client#head_bucket) def wait(params = {}) @waiter.wait(client: @client, params: params) end # @api private attr_reader :waiter end class BucketNotExists # @param [Hash] options # @option options [required, Client] :client # @option options [Integer] :max_attempts (20) # @option options [Integer] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait def initialize(options) @client = options.fetch(:client) @waiter = Aws::Waiters::Waiter.new({ max_attempts: 20, delay: 5, poller: Aws::Waiters::Poller.new( operation_name: :head_bucket, acceptors: [{ "expected" => 404, "matcher" => "status", "state" => "success" }] ) }.merge(options)) end # @option (see Client#head_bucket) # @return (see Client#head_bucket) def wait(params = {}) @waiter.wait(client: @client, params: params) end # @api private attr_reader :waiter end class ObjectExists # @param [Hash] options # @option options [required, Client] :client # @option options [Integer] :max_attempts (20) # @option options [Integer] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait def initialize(options) @client = options.fetch(:client) @waiter = Aws::Waiters::Waiter.new({ max_attempts: 20, delay: 5, poller: Aws::Waiters::Poller.new( operation_name: :head_object, acceptors: [ { "expected" => 200, "matcher" => "status", "state" => "success" }, { "expected" => 404, "matcher" => "status", "state" => "retry" } ] ) }.merge(options)) end # @option (see Client#head_object) # @return (see Client#head_object) def wait(params = {}) @waiter.wait(client: @client, params: params) end # @api private attr_reader :waiter end class ObjectNotExists # @param [Hash] options # @option options [required, Client] :client # @option options [Integer] :max_attempts (20) # @option options [Integer] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait def initialize(options) @client = options.fetch(:client) @waiter = Aws::Waiters::Waiter.new({ max_attempts: 20, delay: 5, poller: Aws::Waiters::Poller.new( operation_name: :head_object, acceptors: [{ "expected" => 404, "matcher" => "status", "state" => "success" }] ) }.merge(options)) end # @option (see Client#head_object) # @return (see Client#head_object) def wait(params = {}) @waiter.wait(client: @client, params: params) end # @api private attr_reader :waiter end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/encryption.rb0000644000004100000410000000122513536452011020711 0ustar www-datawww-datarequire 'aws-sdk-s3/encryption/client' require 'aws-sdk-s3/encryption/decrypt_handler' require 'aws-sdk-s3/encryption/default_cipher_provider' require 'aws-sdk-s3/encryption/encrypt_handler' require 'aws-sdk-s3/encryption/errors' require 'aws-sdk-s3/encryption/io_encrypter' require 'aws-sdk-s3/encryption/io_decrypter' require 'aws-sdk-s3/encryption/io_auth_decrypter' require 'aws-sdk-s3/encryption/key_provider' require 'aws-sdk-s3/encryption/kms_cipher_provider' require 'aws-sdk-s3/encryption/materials' require 'aws-sdk-s3/encryption/utils' require 'aws-sdk-s3/encryption/default_key_provider' module Aws module S3 module Encryption; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/object_summary.rb0000644000004100000410000012711113536452011021545 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class ObjectSummary extend Aws::Deprecations # @overload def initialize(bucket_name, key, options = {}) # @param [String] bucket_name # @param [String] key # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [required, String] :key # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @key = extract_key(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [String] def key @key end # @return [Time] def last_modified data[:last_modified] end # @return [String] def etag data[:etag] end # @return [Integer] def size data[:size] end # The class of storage used to store the object. # @return [String] def storage_class data[:storage_class] end # @return [Types::Owner] def owner data[:owner] end # @!endgroup # @return [Client] def client @client end # @raise [NotImplementedError] # @api private def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end alias :reload :load # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`. # @return [Types::Object] # Returns the data for this {ObjectSummary}. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @param [Hash] options ({}) # @return [Boolean] # Returns `true` if the ObjectSummary exists. def exists?(options = {}) begin wait_until_exists(options.merge(max_attempts: 1)) true rescue Aws::Waiters::Errors::UnexpectedError => e raise e.error rescue Aws::Waiters::Errors::WaiterFailed false end end # @param [Hash] options ({}) # @option options [Integer] :max_attempts (20) # @option options [Float] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait # @return [ObjectSummary] def wait_until_exists(options = {}, &block) options, params = separate_params_and_options(options) waiter = Waiters::ObjectExists.new(options) yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(bucket: @bucket_name, key: @key)) ObjectSummary.new({ bucket_name: @bucket_name, key: @key, client: @client }) end # @param [Hash] options ({}) # @option options [Integer] :max_attempts (20) # @option options [Float] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait # @return [ObjectSummary] def wait_until_not_exists(options = {}, &block) options, params = separate_params_and_options(options) waiter = Waiters::ObjectNotExists.new(options) yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(bucket: @bucket_name, key: @key)) ObjectSummary.new({ bucket_name: @bucket_name, key: @key, client: @client }) end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # object_summary.copy_from({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # metadata: { # "MetadataKey" => "MetadataValue", # }, # metadata_directive: "COPY", # accepts COPY, REPLACE # tagging_directive: "COPY", # accepts COPY, REPLACE # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [required, String] :copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # @option options [String] :copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified tag. # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # @option options [String] :copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :metadata_directive # Specifies whether the metadata is copied from the source object or # replaced with metadata provided in the request. # @option options [String] :tagging_directive # Specifies whether the object tag-set are copied from the source object # or replaced with tag-set provided in the request. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # @option options [String] :copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use to # decrypt the source object. The encryption key provided in this header # must be one that was used when the source object was created. # @option options [String] :copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object destination object this value must be used # in conjunction with the TaggingDirective. The tag-set must be encoded # as URL Query parameters # @option options [String] :object_lock_mode # The object lock mode that you want to apply to the copied object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want the copied object's object lock to # expire. # @option options [String] :object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the copied object. # @return [Types::CopyObjectOutput] def copy_from(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.copy_object(options) resp.data end # @example Request syntax with placeholder values # # object_summary.delete({ # mfa: "MFA", # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param [Hash] options ({}) # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :version_id # VersionId used to reference a specific version of the object. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Indicates whether Amazon S3 object lock should bypass governance-mode # restrictions to process this operation. # @return [Types::DeleteObjectOutput] def delete(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.delete_object(options) resp.data end # @example Request syntax with placeholder values # # object_summary.get({ # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # range: "Range", # response_cache_control: "ResponseCacheControl", # response_content_disposition: "ResponseContentDisposition", # response_content_encoding: "ResponseContentEncoding", # response_content_language: "ResponseContentLanguage", # response_content_type: "ResponseContentType", # response_expires: Time.now, # version_id: "ObjectVersionId", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # }) # @param [Hash] options ({}) # @option options [String] :if_match # Return the object only if its entity tag (ETag) is the same as the one # specified, otherwise return a 412 (precondition failed). # @option options [Time,DateTime,Date,Integer,String] :if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # @option options [String] :if_none_match # Return the object only if its entity tag (ETag) is different from the # one specified, otherwise return a 304 (not modified). # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since # Return the object only if it has not been modified since the specified # time, otherwise return a 412 (precondition failed). # @option options [String] :range # Downloads the specified range bytes of an object. For more information # about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # @option options [String] :response_cache_control # Sets the Cache-Control header of the response. # @option options [String] :response_content_disposition # Sets the Content-Disposition header of the response # @option options [String] :response_content_encoding # Sets the Content-Encoding header of the response. # @option options [String] :response_content_language # Sets the Content-Language header of the response. # @option options [String] :response_content_type # Sets the Content-Type header of the response. # @option options [Time,DateTime,Date,Integer,String] :response_expires # Sets the Expires header of the response. # @option options [String] :version_id # VersionId used to reference a specific version of the object. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Integer] :part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' GET request # for the part specified. Useful for downloading just a part of an # object. # @return [Types::GetObjectOutput] def get(options = {}, &block) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.get_object(options, &block) resp.data end # @example Request syntax with placeholder values # # multipartupload = object_summary.initiate_multipart_upload({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters # @option options [String] :object_lock_mode # Specifies the object lock mode that you want to apply to the uploaded # object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # Specifies the date and time when you want the object lock to expire. # @option options [String] :object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the uploaded # object. # @return [MultipartUpload] def initiate_multipart_upload(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.create_multipart_upload(options) MultipartUpload.new( bucket_name: @bucket_name, object_key: @key, id: resp.data.upload_id, client: @client ) end # @example Request syntax with placeholder values # # object_summary.put({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # body: source_file, # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_length: 1, # content_md5: "ContentMD5", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String, IO] :body # Object data. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [Integer] :content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # @option options [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This parameter # is auto-populated when using the command from the CLI. This parameted # is required if object lock parameters are specified. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters. (For example, "Key1=Value1") # @option options [String] :object_lock_mode # The object lock mode that you want to apply to this object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want this object's object lock to expire. # @option options [String] :object_lock_legal_hold_status # The Legal Hold status that you want to apply to the specified object. # @return [Types::PutObjectOutput] def put(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.put_object(options) resp.data end # @example Request syntax with placeholder values # # object_summary.restore_object({ # version_id: "ObjectVersionId", # restore_request: { # days: 1, # glacier_job_parameters: { # tier: "Standard", # required, accepts Standard, Bulk, Expedited # }, # type: "SELECT", # accepts SELECT # tier: "Standard", # accepts Standard, Bulk, Expedited # description: "Description", # select_parameters: { # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # expression_type: "SQL", # required, accepts SQL # expression: "Expression", # required # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # }, # output_location: { # s3: { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # }, # }, # }, # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [String] :version_id # @option options [Types::RestoreRequest] :restore_request # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [Types::RestoreObjectOutput] def restore_object(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.restore_object(options) resp.data end # @!group Associations # @return [ObjectAcl] def acl ObjectAcl.new( bucket_name: @bucket_name, object_key: @key, client: @client ) end # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @param [String] id # @return [MultipartUpload] def multipart_upload(id) MultipartUpload.new( bucket_name: @bucket_name, object_key: @key, id: id, client: @client ) end # @return [Object] def object Object.new( bucket_name: @bucket_name, key: @key, client: @client ) end # @param [String] id # @return [ObjectVersion] def version(id) ObjectVersion.new( bucket_name: @bucket_name, object_key: @key, id: id, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name, key: @key } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_key(args, options) value = args[1] || options.delete(:key) case value when String then value when nil then raise ArgumentError, "missing required option :key" else msg = "expected :key to be a String, got #{value.class}" raise ArgumentError, msg end end def yield_waiter_and_warn(waiter, &block) if !@waiter_block_warned msg = "pass options to configure the waiter; " msg << "yielding the waiter is deprecated" warn(msg) @waiter_block_warned = true end yield(waiter.waiter) end def separate_params_and_options(options) opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait]) waiter_opts = {} waiter_params = {} options.each_pair do |key, value| if opts.include?(key) waiter_opts[key] = value else waiter_params[key] = value end end waiter_opts[:client] ||= @client [waiter_opts, waiter_params] end class Collection < Aws::Resources::Collection # @!group Batch Actions # @example Request syntax with placeholder values # # object_summary.batch_delete!({ # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param options ({}) # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Specifies whether you want to delete this object even if it has a # Governance-type object lock in place. You must have sufficient # permissions to perform this operation. # @return [void] def batch_delete!(options = {}) batch_enum.each do |batch| params = Aws::Util.copy_hash(options) params[:bucket] = batch[0].bucket_name params[:delete] ||= {} params[:delete][:objects] ||= [] batch.each do |item| params[:delete][:objects] << { key: item.key } end batch[0].client.delete_objects(params) end nil end # @!endgroup end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_logging.rb0000644000004100000410000001576413536452011021517 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketLogging extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Types::LoggingEnabled] def logging_enabled data[:logging_enabled] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketLogging}. # Returns `self` making it possible to chain methods. # # bucket_logging.reload.data # # @return [self] def load resp = @client.get_bucket_logging(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketLoggingOutput] # Returns the data for this {BucketLogging}. Calls # {Client#get_bucket_logging} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_logging.put({ # bucket_logging_status: { # required # logging_enabled: { # target_bucket: "TargetBucket", # required # target_grants: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, READ, WRITE # }, # ], # target_prefix: "TargetPrefix", # required # }, # }, # content_md5: "ContentMD5", # }) # @param [Hash] options ({}) # @option options [required, Types::BucketLoggingStatus] :bucket_logging_status # @option options [String] :content_md5 # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_logging(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/object.rb0000644000004100000410000014037113536452011017773 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class Object extend Aws::Deprecations # @overload def initialize(bucket_name, key, options = {}) # @param [String] bucket_name # @param [String] key # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [required, String] :key # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @key = extract_key(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [String] def key @key end # Specifies whether the object retrieved was (true) or was not (false) a # Delete Marker. If false, this response header does not appear in the # response. # @return [Boolean] def delete_marker data[:delete_marker] end # @return [String] def accept_ranges data[:accept_ranges] end # If the object expiration is configured (see PUT Bucket lifecycle), the # response includes this header. It includes the expiry-date and rule-id # key value pairs providing object expiration information. The value of # the rule-id is URL encoded. # @return [String] def expiration data[:expiration] end # Provides information about object restoration operation and expiration # time of the restored object copy. # @return [String] def restore data[:restore] end # Last modified date of the object # @return [Time] def last_modified data[:last_modified] end # Size of the body in bytes. # @return [Integer] def content_length data[:content_length] end # An ETag is an opaque identifier assigned by a web server to a specific # version of a resource found at a URL # @return [String] def etag data[:etag] end # This is set to the number of metadata entries not returned in # x-amz-meta headers. This can happen if you create metadata using an # API like SOAP that supports more flexible metadata than the REST API. # For example, using SOAP, you can create metadata whose values are not # legal HTTP headers. # @return [Integer] def missing_meta data[:missing_meta] end # Version of the object. # @return [String] def version_id data[:version_id] end # Specifies caching behavior along the request/reply chain. # @return [String] def cache_control data[:cache_control] end # Specifies presentational information for the object. # @return [String] def content_disposition data[:content_disposition] end # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @return [String] def content_encoding data[:content_encoding] end # The language the content is in. # @return [String] def content_language data[:content_language] end # A standard MIME type describing the format of the object data. # @return [String] def content_type data[:content_type] end # The date and time at which the object is no longer cacheable. # @return [Time] def expires data[:expires] end # @return [String] def expires_string data[:expires_string] end # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @return [String] def website_redirect_location data[:website_redirect_location] end # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @return [String] def server_side_encryption data[:server_side_encryption] end # A map of metadata to store with the object in S3. # @return [Hash] def metadata data[:metadata] end # If server-side encryption with a customer-provided encryption key was # requested, the response will include this header confirming the # encryption algorithm used. # @return [String] def sse_customer_algorithm data[:sse_customer_algorithm] end # If server-side encryption with a customer-provided encryption key was # requested, the response will include this header to provide round trip # message integrity verification of the customer-provided encryption # key. # @return [String] def sse_customer_key_md5 data[:sse_customer_key_md5] end # If present, specifies the ID of the AWS Key Management Service (KMS) # master encryption key that was used for the object. # @return [String] def ssekms_key_id data[:ssekms_key_id] end # @return [String] def storage_class data[:storage_class] end # If present, indicates that the requester was successfully charged for # the request. # @return [String] def request_charged data[:request_charged] end # @return [String] def replication_status data[:replication_status] end # The count of parts this object has. # @return [Integer] def parts_count data[:parts_count] end # The object lock mode currently in place for this object. # @return [String] def object_lock_mode data[:object_lock_mode] end # The date and time when this object's object lock expires. # @return [Time] def object_lock_retain_until_date data[:object_lock_retain_until_date] end # The Legal Hold status for the specified object. # @return [String] def object_lock_legal_hold_status data[:object_lock_legal_hold_status] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {Object}. # Returns `self` making it possible to chain methods. # # object.reload.data # # @return [self] def load resp = @client.head_object( bucket: @bucket_name, key: @key ) @data = resp.data self end alias :reload :load # @return [Types::HeadObjectOutput] # Returns the data for this {Object}. Calls # {Client#head_object} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @param [Hash] options ({}) # @return [Boolean] # Returns `true` if the Object exists. def exists?(options = {}) begin wait_until_exists(options.merge(max_attempts: 1)) true rescue Aws::Waiters::Errors::UnexpectedError => e raise e.error rescue Aws::Waiters::Errors::WaiterFailed false end end # @param [Hash] options ({}) # @option options [Integer] :max_attempts (20) # @option options [Float] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait # @return [Object] def wait_until_exists(options = {}, &block) options, params = separate_params_and_options(options) waiter = Waiters::ObjectExists.new(options) yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(bucket: @bucket_name, key: @key)) Object.new({ bucket_name: @bucket_name, key: @key, client: @client }) end # @param [Hash] options ({}) # @option options [Integer] :max_attempts (20) # @option options [Float] :delay (5) # @option options [Proc] :before_attempt # @option options [Proc] :before_wait # @return [Object] def wait_until_not_exists(options = {}, &block) options, params = separate_params_and_options(options) waiter = Waiters::ObjectNotExists.new(options) yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(bucket: @bucket_name, key: @key)) Object.new({ bucket_name: @bucket_name, key: @key, client: @client }) end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # object.copy_from({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # copy_source: "CopySource", # required # copy_source_if_match: "CopySourceIfMatch", # copy_source_if_modified_since: Time.now, # copy_source_if_none_match: "CopySourceIfNoneMatch", # copy_source_if_unmodified_since: Time.now, # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # metadata: { # "MetadataKey" => "MetadataValue", # }, # metadata_directive: "COPY", # accepts COPY, REPLACE # tagging_directive: "COPY", # accepts COPY, REPLACE # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm", # copy_source_sse_customer_key: "CopySourceSSECustomerKey", # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [required, String] :copy_source # The name of the source bucket and key name of the source object, # separated by a slash (/). Must be URL-encoded. # @option options [String] :copy_source_if_match # Copies the object if its entity tag (ETag) matches the specified tag. # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since # Copies the object if it has been modified since the specified time. # @option options [String] :copy_source_if_none_match # Copies the object if its entity tag (ETag) is different than the # specified ETag. # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since # Copies the object if it hasn't been modified since the specified # time. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :metadata_directive # Specifies whether the metadata is copied from the source object or # replaced with metadata provided in the request. # @option options [String] :tagging_directive # Specifies whether the object tag-set are copied from the source object # or replaced with tag-set provided in the request. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :copy_source_sse_customer_algorithm # Specifies the algorithm to use when decrypting the source object # (e.g., AES256). # @option options [String] :copy_source_sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use to # decrypt the source object. The encryption key provided in this header # must be one that was used when the source object was created. # @option options [String] :copy_source_sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object destination object this value must be used # in conjunction with the TaggingDirective. The tag-set must be encoded # as URL Query parameters # @option options [String] :object_lock_mode # The object lock mode that you want to apply to the copied object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want the copied object's object lock to # expire. # @option options [String] :object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the copied object. # @return [Types::CopyObjectOutput] def copy_from(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.copy_object(options) resp.data end # @example Request syntax with placeholder values # # object.delete({ # mfa: "MFA", # version_id: "ObjectVersionId", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param [Hash] options ({}) # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :version_id # VersionId used to reference a specific version of the object. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Indicates whether Amazon S3 object lock should bypass governance-mode # restrictions to process this operation. # @return [Types::DeleteObjectOutput] def delete(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.delete_object(options) resp.data end # @example Request syntax with placeholder values # # object.get({ # if_match: "IfMatch", # if_modified_since: Time.now, # if_none_match: "IfNoneMatch", # if_unmodified_since: Time.now, # range: "Range", # response_cache_control: "ResponseCacheControl", # response_content_disposition: "ResponseContentDisposition", # response_content_encoding: "ResponseContentEncoding", # response_content_language: "ResponseContentLanguage", # response_content_type: "ResponseContentType", # response_expires: Time.now, # version_id: "ObjectVersionId", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # request_payer: "requester", # accepts requester # part_number: 1, # }) # @param [Hash] options ({}) # @option options [String] :if_match # Return the object only if its entity tag (ETag) is the same as the one # specified, otherwise return a 412 (precondition failed). # @option options [Time,DateTime,Date,Integer,String] :if_modified_since # Return the object only if it has been modified since the specified # time, otherwise return a 304 (not modified). # @option options [String] :if_none_match # Return the object only if its entity tag (ETag) is different from the # one specified, otherwise return a 304 (not modified). # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since # Return the object only if it has not been modified since the specified # time, otherwise return a 412 (precondition failed). # @option options [String] :range # Downloads the specified range bytes of an object. For more information # about the HTTP Range header, go to # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. # @option options [String] :response_cache_control # Sets the Cache-Control header of the response. # @option options [String] :response_content_disposition # Sets the Content-Disposition header of the response # @option options [String] :response_content_encoding # Sets the Content-Encoding header of the response. # @option options [String] :response_content_language # Sets the Content-Language header of the response. # @option options [String] :response_content_type # Sets the Content-Type header of the response. # @option options [Time,DateTime,Date,Integer,String] :response_expires # Sets the Expires header of the response. # @option options [String] :version_id # VersionId used to reference a specific version of the object. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Integer] :part_number # Part number of the object being read. This is a positive integer # between 1 and 10,000. Effectively performs a 'ranged' GET request # for the part specified. Useful for downloading just a part of an # object. # @return [Types::GetObjectOutput] def get(options = {}, &block) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.get_object(options, &block) resp.data end # @example Request syntax with placeholder values # # multipartupload = object.initiate_multipart_upload({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters # @option options [String] :object_lock_mode # Specifies the object lock mode that you want to apply to the uploaded # object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # Specifies the date and time when you want the object lock to expire. # @option options [String] :object_lock_legal_hold_status # Specifies whether you want to apply a Legal Hold to the uploaded # object. # @return [MultipartUpload] def initiate_multipart_upload(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.create_multipart_upload(options) MultipartUpload.new( bucket_name: @bucket_name, object_key: @key, id: resp.data.upload_id, client: @client ) end # @example Request syntax with placeholder values # # object.put({ # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # body: source_file, # cache_control: "CacheControl", # content_disposition: "ContentDisposition", # content_encoding: "ContentEncoding", # content_language: "ContentLanguage", # content_length: 1, # content_md5: "ContentMD5", # content_type: "ContentType", # expires: Time.now, # grant_full_control: "GrantFullControl", # grant_read: "GrantRead", # grant_read_acp: "GrantReadACP", # grant_write_acp: "GrantWriteACP", # metadata: { # "MetadataKey" => "MetadataValue", # }, # server_side_encryption: "AES256", # accepts AES256, aws:kms # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # website_redirect_location: "WebsiteRedirectLocation", # sse_customer_algorithm: "SSECustomerAlgorithm", # sse_customer_key: "SSECustomerKey", # sse_customer_key_md5: "SSECustomerKeyMD5", # ssekms_key_id: "SSEKMSKeyId", # ssekms_encryption_context: "SSEKMSEncryptionContext", # request_payer: "requester", # accepts requester # tagging: "TaggingHeader", # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE # object_lock_retain_until_date: Time.now, # object_lock_legal_hold_status: "ON", # accepts ON, OFF # }) # @param [Hash] options ({}) # @option options [String] :acl # The canned ACL to apply to the object. # @option options [String, IO] :body # Object data. # @option options [String] :cache_control # Specifies caching behavior along the request/reply chain. # @option options [String] :content_disposition # Specifies presentational information for the object. # @option options [String] :content_encoding # Specifies what content encodings have been applied to the object and # thus what decoding mechanisms must be applied to obtain the media-type # referenced by the Content-Type header field. # @option options [String] :content_language # The language the content is in. # @option options [Integer] :content_length # Size of the body in bytes. This parameter is useful when the size of # the body cannot be determined automatically. # @option options [String] :content_md5 # The base64-encoded 128-bit MD5 digest of the part data. This parameter # is auto-populated when using the command from the CLI. This parameted # is required if object lock parameters are specified. # @option options [String] :content_type # A standard MIME type describing the format of the object data. # @option options [Time,DateTime,Date,Integer,String] :expires # The date and time at which the object is no longer cacheable. # @option options [String] :grant_full_control # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the # object. # @option options [String] :grant_read # Allows grantee to read the object data and its metadata. # @option options [String] :grant_read_acp # Allows grantee to read the object ACL. # @option options [String] :grant_write_acp # Allows grantee to write the ACL for the applicable object. # @option options [Hash] :metadata # A map of metadata to store with the object in S3. # @option options [String] :server_side_encryption # The Server-side encryption algorithm used when storing this object in # S3 (e.g., AES256, aws:kms). # @option options [String] :storage_class # The type of storage to use for the object. Defaults to 'STANDARD'. # @option options [String] :website_redirect_location # If the bucket is configured as a website, redirects requests for this # object to another object in the same bucket or to an external URL. # Amazon S3 stores the value of this header in the object metadata. # @option options [String] :sse_customer_algorithm # Specifies the algorithm to use to when encrypting the object (e.g., # AES256). # @option options [String] :sse_customer_key # Specifies the customer-provided encryption key for Amazon S3 to use in # encrypting data. This value is used to store the object and then it is # discarded; Amazon does not store the encryption key. The key must be # appropriate for use with the algorithm specified in the # x-amz-server-side​-encryption​-customer-algorithm header. # @option options [String] :sse_customer_key_md5 # Specifies the 128-bit MD5 digest of the encryption key according to # RFC 1321. Amazon S3 uses this header for a message integrity check to # ensure the encryption key was transmitted without error. # @option options [String] :ssekms_key_id # Specifies the AWS KMS key ID to use for object encryption. All GET and # PUT requests for an object protected by AWS KMS will fail if not made # via SSL or using SigV4. Documentation on configuring any of the # officially supported AWS SDKs and CLI can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version # @option options [String] :ssekms_encryption_context # Specifies the AWS KMS Encryption Context to use for object encryption. # The value of this header is a base64-encoded UTF-8 string holding JSON # with the encryption context key-value pairs. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [String] :tagging # The tag-set for the object. The tag-set must be encoded as URL Query # parameters. (For example, "Key1=Value1") # @option options [String] :object_lock_mode # The object lock mode that you want to apply to this object. # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date # The date and time when you want this object's object lock to expire. # @option options [String] :object_lock_legal_hold_status # The Legal Hold status that you want to apply to the specified object. # @return [Types::PutObjectOutput] def put(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.put_object(options) resp.data end # @example Request syntax with placeholder values # # object.restore_object({ # version_id: "ObjectVersionId", # restore_request: { # days: 1, # glacier_job_parameters: { # tier: "Standard", # required, accepts Standard, Bulk, Expedited # }, # type: "SELECT", # accepts SELECT # tier: "Standard", # accepts Standard, Bulk, Expedited # description: "Description", # select_parameters: { # input_serialization: { # required # csv: { # file_header_info: "USE", # accepts USE, IGNORE, NONE # comments: "Comments", # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # allow_quoted_record_delimiter: false, # }, # compression_type: "NONE", # accepts NONE, GZIP, BZIP2 # json: { # type: "DOCUMENT", # accepts DOCUMENT, LINES # }, # parquet: { # }, # }, # expression_type: "SQL", # required, accepts SQL # expression: "Expression", # required # output_serialization: { # required # csv: { # quote_fields: "ALWAYS", # accepts ALWAYS, ASNEEDED # quote_escape_character: "QuoteEscapeCharacter", # record_delimiter: "RecordDelimiter", # field_delimiter: "FieldDelimiter", # quote_character: "QuoteCharacter", # }, # json: { # record_delimiter: "RecordDelimiter", # }, # }, # }, # output_location: { # s3: { # bucket_name: "BucketName", # required # prefix: "LocationPrefix", # required # encryption: { # encryption_type: "AES256", # required, accepts AES256, aws:kms # kms_key_id: "SSEKMSKeyId", # kms_context: "KMSContext", # }, # canned_acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control # access_control_list: [ # { # grantee: { # display_name: "DisplayName", # email_address: "EmailAddress", # id: "ID", # type: "CanonicalUser", # required, accepts CanonicalUser, AmazonCustomerByEmail, Group # uri: "URI", # }, # permission: "FULL_CONTROL", # accepts FULL_CONTROL, WRITE, WRITE_ACP, READ, READ_ACP # }, # ], # tagging: { # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # user_metadata: [ # { # name: "MetadataKey", # value: "MetadataValue", # }, # ], # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE # }, # }, # }, # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [String] :version_id # @option options [Types::RestoreRequest] :restore_request # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [Types::RestoreObjectOutput] def restore_object(options = {}) options = options.merge( bucket: @bucket_name, key: @key ) resp = @client.restore_object(options) resp.data end # @!group Associations # @return [ObjectAcl] def acl ObjectAcl.new( bucket_name: @bucket_name, object_key: @key, client: @client ) end # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @param [String] id # @return [MultipartUpload] def multipart_upload(id) MultipartUpload.new( bucket_name: @bucket_name, object_key: @key, id: id, client: @client ) end # @param [String] id # @return [ObjectVersion] def version(id) ObjectVersion.new( bucket_name: @bucket_name, object_key: @key, id: id, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name, key: @key } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_key(args, options) value = args[1] || options.delete(:key) case value when String then value when nil then raise ArgumentError, "missing required option :key" else msg = "expected :key to be a String, got #{value.class}" raise ArgumentError, msg end end def yield_waiter_and_warn(waiter, &block) if !@waiter_block_warned msg = "pass options to configure the waiter; " msg << "yielding the waiter is deprecated" warn(msg) @waiter_block_warned = true end yield(waiter.waiter) end def separate_params_and_options(options) opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait]) waiter_opts = {} waiter_params = {} options.each_pair do |key, value| if opts.include?(key) waiter_opts[key] = value else waiter_params[key] = value end end waiter_opts[:client] ||= @client [waiter_opts, waiter_params] end class Collection < Aws::Resources::Collection # @!group Batch Actions # @example Request syntax with placeholder values # # object.batch_delete!({ # mfa: "MFA", # request_payer: "requester", # accepts requester # bypass_governance_retention: false, # }) # @param options ({}) # @option options [String] :mfa # The concatenation of the authentication device's serial number, a # space, and the value that is displayed on your authentication device. # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @option options [Boolean] :bypass_governance_retention # Specifies whether you want to delete this object even if it has a # Governance-type object lock in place. You must have sufficient # permissions to perform this operation. # @return [void] def batch_delete!(options = {}) batch_enum.each do |batch| params = Aws::Util.copy_hash(options) params[:bucket] = batch[0].bucket_name params[:delete] ||= {} params[:delete][:objects] ||= [] batch.each do |item| params[:delete][:objects] << { key: item.key } end batch[0].client.delete_objects(params) end nil end # @!endgroup end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_tagging.rb0000644000004100000410000001543013536452011021477 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketTagging extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Array] def tag_set data[:tag_set] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketTagging}. # Returns `self` making it possible to chain methods. # # bucket_tagging.reload.data # # @return [self] def load resp = @client.get_bucket_tagging(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketTaggingOutput] # Returns the data for this {BucketTagging}. Calls # {Client#get_bucket_tagging} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_tagging.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.delete_bucket_tagging(options) resp.data end # @example Request syntax with placeholder values # # bucket_tagging.put({ # content_md5: "ContentMD5", # tagging: { # required # tag_set: [ # required # { # key: "ObjectKey", # required # value: "Value", # required # }, # ], # }, # }) # @param [Hash] options ({}) # @option options [String] :content_md5 # @option options [required, Types::Tagging] :tagging # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_tagging(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/multipart_upload.rb0000644000004100000410000002622613536452011022114 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class MultipartUpload extend Aws::Deprecations # @overload def initialize(bucket_name, object_key, id, options = {}) # @param [String] bucket_name # @param [String] object_key # @param [String] id # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [required, String] :object_key # @option options [required, String] :id # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @object_key = extract_object_key(args, options) @id = extract_id(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [String] def object_key @object_key end # @return [String] def id @id end # Upload ID that identifies the multipart upload. # @return [String] def upload_id data[:upload_id] end # Key of the object for which the multipart upload was initiated. # @return [String] def key data[:key] end # Date and time at which the multipart upload was initiated. # @return [Time] def initiated data[:initiated] end # The class of storage used to store the object. # @return [String] def storage_class data[:storage_class] end # @return [Types::Owner] def owner data[:owner] end # Identifies who initiated the multipart upload. # @return [Types::Initiator] def initiator data[:initiator] end # @!endgroup # @return [Client] def client @client end # @raise [NotImplementedError] # @api private def load msg = "#load is not implemented, data only available via enumeration" raise NotImplementedError, msg end alias :reload :load # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`. # @return [Types::MultipartUpload] # Returns the data for this {MultipartUpload}. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # multipart_upload.abort({ # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [Types::AbortMultipartUploadOutput] def abort(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @id ) resp = @client.abort_multipart_upload(options) resp.data end # @example Request syntax with placeholder values # # object = multipart_upload.complete({ # multipart_upload: { # parts: [ # { # etag: "ETag", # part_number: 1, # }, # ], # }, # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [Types::CompletedMultipartUpload] :multipart_upload # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [Object] def complete(options = {}) options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @id ) resp = @client.complete_multipart_upload(options) Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end # @!group Associations # @return [Object] def object Object.new( bucket_name: @bucket_name, key: @object_key, client: @client ) end # @param [String] part_number # @return [MultipartUploadPart] def part(part_number) MultipartUploadPart.new( bucket_name: @bucket_name, object_key: @object_key, multipart_upload_id: @id, part_number: part_number, client: @client ) end # @example Request syntax with placeholder values # # parts = multipart_upload.parts({ # request_payer: "requester", # accepts requester # }) # @param [Hash] options ({}) # @option options [String] :request_payer # Confirms that the requester knows that she or he will be charged for # the request. Bucket owners need not specify this parameter in their # requests. Documentation on downloading objects from requester pays # buckets can be found at # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html # @return [MultipartUploadPart::Collection] def parts(options = {}) batches = Enumerator.new do |y| options = options.merge( bucket: @bucket_name, key: @object_key, upload_id: @id ) resp = @client.list_parts(options) resp.each_page do |page| batch = [] page.data.parts.each do |p| batch << MultipartUploadPart.new( bucket_name: options[:bucket], object_key: options[:key], multipart_upload_id: options[:upload_id], part_number: p.part_number, data: p, client: @client ) end y.yield(batch) end end MultipartUploadPart::Collection.new(batches) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name, object_key: @object_key, id: @id } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_object_key(args, options) value = args[1] || options.delete(:object_key) case value when String then value when nil then raise ArgumentError, "missing required option :object_key" else msg = "expected :object_key to be a String, got #{value.class}" raise ArgumentError, msg end end def extract_id(args, options) value = args[2] || options.delete(:id) case value when String then value when nil then raise ArgumentError, "missing required option :id" else msg = "expected :id to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_cors.rb0000644000004100000410000001572513536452011021034 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketCors extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # @return [Array] def cors_rules data[:cors_rules] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketCors}. # Returns `self` making it possible to chain methods. # # bucket_cors.reload.data # # @return [self] def load resp = @client.get_bucket_cors(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::GetBucketCorsOutput] # Returns the data for this {BucketCors}. Calls # {Client#get_bucket_cors} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_cors.delete() # @param [Hash] options ({}) # @return [EmptyStructure] def delete(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.delete_bucket_cors(options) resp.data end # @example Request syntax with placeholder values # # bucket_cors.put({ # cors_configuration: { # required # cors_rules: [ # required # { # allowed_headers: ["AllowedHeader"], # allowed_methods: ["AllowedMethod"], # required # allowed_origins: ["AllowedOrigin"], # required # expose_headers: ["ExposeHeader"], # max_age_seconds: 1, # }, # ], # }, # content_md5: "ContentMD5", # }) # @param [Hash] options ({}) # @option options [required, Types::CORSConfiguration] :cors_configuration # @option options [String] :content_md5 # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_cors(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/bucket_notification.rb0000644000004100000410000002303513536452011022545 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 class BucketNotification extend Aws::Deprecations # @overload def initialize(bucket_name, options = {}) # @param [String] bucket_name # @option options [Client] :client # @overload def initialize(options = {}) # @option options [required, String] :bucket_name # @option options [Client] :client def initialize(*args) options = Hash === args.last ? args.pop.dup : {} @bucket_name = extract_bucket_name(args, options) @data = options.delete(:data) @client = options.delete(:client) || Client.new(options) end # @!group Read-Only Attributes # @return [String] def bucket_name @bucket_name end # The topic to which notifications are sent and the events for which # notifications are generated. # @return [Array] def topic_configurations data[:topic_configurations] end # The Amazon Simple Queue Service queues to publish messages to and the # events for which to publish messages. # @return [Array] def queue_configurations data[:queue_configurations] end # Describes the AWS Lambda functions to invoke and the events for which # to invoke them. # @return [Array] def lambda_function_configurations data[:lambda_function_configurations] end # @!endgroup # @return [Client] def client @client end # Loads, or reloads {#data} for the current {BucketNotification}. # Returns `self` making it possible to chain methods. # # bucket_notification.reload.data # # @return [self] def load resp = @client.get_bucket_notification_configuration(bucket: @bucket_name) @data = resp.data self end alias :reload :load # @return [Types::NotificationConfiguration] # Returns the data for this {BucketNotification}. Calls # {Client#get_bucket_notification_configuration} if {#data_loaded?} is `false`. def data load unless @data @data end # @return [Boolean] # Returns `true` if this resource is loaded. Accessing attributes or # {#data} on an unloaded resource will trigger a call to {#load}. def data_loaded? !!@data end # @deprecated Use [Aws::S3::Client] #wait_until instead # # Waiter polls an API operation until a resource enters a desired # state. # # @note The waiting operation is performed on a copy. The original resource remains unchanged # # ## Basic Usage # # Waiter will polls until it is successful, it fails by # entering a terminal state, or until a maximum number of attempts # are made. # # # polls in a loop until condition is true # resource.wait_until(options) {|resource| condition} # # ## Example # # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' } # # ## Configuration # # You can configure the maximum number of polling attempts, and the # delay (in seconds) between each polling attempt. The waiting condition is set # by passing a block to {#wait_until}: # # # poll for ~25 seconds # resource.wait_until(max_attempts:5,delay:5) {|resource|...} # # ## Callbacks # # You can be notified before each polling attempt and before each # delay. If you throw `:success` or `:failure` from these callbacks, # it will terminate the waiter. # # started_at = Time.now # # poll for 1 hour, instead of a number of attempts # proc = Proc.new do |attempts, response| # throw :failure if Time.now - started_at > 3600 # end # # # disable max attempts # instance.wait_until(before_wait:proc, max_attempts:nil) {...} # # ## Handling Errors # # When a waiter is successful, it returns the Resource. When a waiter # fails, it raises an error. # # begin # resource.wait_until(...) # rescue Aws::Waiters::Errors::WaiterFailed # # resource did not enter the desired state in time # end # # # @yield param [Resource] resource to be used in the waiting condition # # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates # because the waiter has entered a state that it will not transition # out of, preventing success. # # yet successful. # # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered # while polling for a resource that is not expected. # # @raise [NotImplementedError] Raised when the resource does not # # @option options [Integer] :max_attempts (10) Maximum number of # attempts # @option options [Integer] :delay (10) Delay between each # attempt in seconds # @option options [Proc] :before_attempt (nil) Callback # invoked before each attempt # @option options [Proc] :before_wait (nil) Callback # invoked before each wait # @return [Resource] if the waiter was successful def wait_until(options = {}, &block) self_copy = self.dup attempts = 0 options[:max_attempts] = 10 unless options.key?(:max_attempts) options[:delay] ||= 10 options[:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == options[:max_attempts] :retry end end Aws::Waiters::Waiter.new(options).wait({}) end # @!group Actions # @example Request syntax with placeholder values # # bucket_notification.put({ # notification_configuration: { # required # topic_configurations: [ # { # id: "NotificationId", # topic_arn: "TopicArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # queue_configurations: [ # { # id: "NotificationId", # queue_arn: "QueueArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # lambda_function_configurations: [ # { # id: "NotificationId", # lambda_function_arn: "LambdaFunctionArn", # required # events: ["s3:ReducedRedundancyLostObject"], # required, accepts s3:ReducedRedundancyLostObject, s3:ObjectCreated:*, s3:ObjectCreated:Put, s3:ObjectCreated:Post, s3:ObjectCreated:Copy, s3:ObjectCreated:CompleteMultipartUpload, s3:ObjectRemoved:*, s3:ObjectRemoved:Delete, s3:ObjectRemoved:DeleteMarkerCreated, s3:ObjectRestore:Post, s3:ObjectRestore:Completed # filter: { # key: { # filter_rules: [ # { # name: "prefix", # accepts prefix, suffix # value: "FilterRuleValue", # }, # ], # }, # }, # }, # ], # }, # }) # @param [Hash] options ({}) # @option options [required, Types::NotificationConfiguration] :notification_configuration # @return [EmptyStructure] def put(options = {}) options = options.merge(bucket: @bucket_name) resp = @client.put_bucket_notification_configuration(options) resp.data end # @!group Associations # @return [Bucket] def bucket Bucket.new( name: @bucket_name, client: @client ) end # @deprecated # @api private def identifiers { bucket_name: @bucket_name } end deprecated(:identifiers) private def extract_bucket_name(args, options) value = args[0] || options.delete(:bucket_name) case value when String then value when nil then raise ArgumentError, "missing required option :bucket_name" else msg = "expected :bucket_name to be a String, got #{value.class}" raise ArgumentError, msg end end class Collection < Aws::Resources::Collection; end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/object_copier.rb0000644000004100000410000000554413536452011021336 0ustar www-datawww-datarequire 'thread' module Aws module S3 # @api private class ObjectCopier # @param [S3::Object] object def initialize(object, options = {}) @object = object @options = options.merge(client: @object.client) end def copy_from(source, options = {}) copy_object(source, @object, merge_options(source, options)) end def copy_to(target, options = {}) copy_object(@object, target, merge_options(target, options)) end private def copy_object(source, target, options) target_bucket, target_key = copy_target(target) options[:bucket] = target_bucket options[:key] = target_key options[:copy_source] = copy_source(source) if options.delete(:multipart_copy) apply_source_client(source, options) ObjectMultipartCopier.new(@options).copy(options) else @object.client.copy_object(options) end end def copy_source(source) case source when String then source when Hash src = "#{source[:bucket]}/#{escape(source[:key])}" src += "?versionId=#{source[:version_id]}" if source.key?(:version_id) src when S3::Object, S3::ObjectSummary "#{source.bucket_name}/#{escape(source.key)}" when S3::ObjectVersion "#{source.bucket_name}/#{escape(source.object_key)}?versionId=#{source.id}" else msg = "expected source to be an Aws::S3::Object, Hash, or String" raise ArgumentError, msg end end def copy_target(target) case target when String then target.match(/([^\/]+?)\/(.+)/)[1,2] when Hash then target.values_at(:bucket, :key) when S3::Object then [target.bucket_name, target.key] else msg = "expected target to be an Aws::S3::Object, Hash, or String" raise ArgumentError, msg end end def merge_options(source_or_target, options) if Hash === source_or_target source_or_target.inject(options.dup) do |opts, (key, value)| opts[key] = value unless [:bucket, :key, :version_id].include?(key) opts end else options.dup end end def apply_source_client(source, options) if source.respond_to?(:client) options[:copy_source_client] ||= source.client end if options[:copy_source_region] config = @object.client.config config = config.each_pair.inject({}) { |h, (k,v)| h[k] = v; h } config[:region] = options.delete(:copy_source_region) options[:copy_source_client] ||= S3::Client.new(config) end options[:copy_source_client] ||= @object.client end def escape(str) Seahorse::Util.uri_path_escape(str) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/client_api.rb0000644000004100000410000073777013536452011020653 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::S3 # @api private module ClientApi include Seahorse::Model AbortDate = Shapes::TimestampShape.new(name: 'AbortDate') AbortIncompleteMultipartUpload = Shapes::StructureShape.new(name: 'AbortIncompleteMultipartUpload') AbortMultipartUploadOutput = Shapes::StructureShape.new(name: 'AbortMultipartUploadOutput') AbortMultipartUploadRequest = Shapes::StructureShape.new(name: 'AbortMultipartUploadRequest') AbortRuleId = Shapes::StringShape.new(name: 'AbortRuleId') AccelerateConfiguration = Shapes::StructureShape.new(name: 'AccelerateConfiguration') AcceptRanges = Shapes::StringShape.new(name: 'AcceptRanges') AccessControlPolicy = Shapes::StructureShape.new(name: 'AccessControlPolicy') AccessControlTranslation = Shapes::StructureShape.new(name: 'AccessControlTranslation') AccountId = Shapes::StringShape.new(name: 'AccountId') AllowQuotedRecordDelimiter = Shapes::BooleanShape.new(name: 'AllowQuotedRecordDelimiter') AllowedHeader = Shapes::StringShape.new(name: 'AllowedHeader') AllowedHeaders = Shapes::ListShape.new(name: 'AllowedHeaders', flattened: true) AllowedMethod = Shapes::StringShape.new(name: 'AllowedMethod') AllowedMethods = Shapes::ListShape.new(name: 'AllowedMethods', flattened: true) AllowedOrigin = Shapes::StringShape.new(name: 'AllowedOrigin') AllowedOrigins = Shapes::ListShape.new(name: 'AllowedOrigins', flattened: true) AnalyticsAndOperator = Shapes::StructureShape.new(name: 'AnalyticsAndOperator') AnalyticsConfiguration = Shapes::StructureShape.new(name: 'AnalyticsConfiguration') AnalyticsConfigurationList = Shapes::ListShape.new(name: 'AnalyticsConfigurationList', flattened: true) AnalyticsExportDestination = Shapes::StructureShape.new(name: 'AnalyticsExportDestination') AnalyticsFilter = Shapes::StructureShape.new(name: 'AnalyticsFilter') AnalyticsId = Shapes::StringShape.new(name: 'AnalyticsId') AnalyticsS3BucketDestination = Shapes::StructureShape.new(name: 'AnalyticsS3BucketDestination') AnalyticsS3ExportFileFormat = Shapes::StringShape.new(name: 'AnalyticsS3ExportFileFormat') Body = Shapes::BlobShape.new(name: 'Body') Bucket = Shapes::StructureShape.new(name: 'Bucket') BucketAccelerateStatus = Shapes::StringShape.new(name: 'BucketAccelerateStatus') BucketAlreadyExists = Shapes::StructureShape.new(name: 'BucketAlreadyExists') BucketAlreadyOwnedByYou = Shapes::StructureShape.new(name: 'BucketAlreadyOwnedByYou') BucketCannedACL = Shapes::StringShape.new(name: 'BucketCannedACL') BucketLifecycleConfiguration = Shapes::StructureShape.new(name: 'BucketLifecycleConfiguration') BucketLocationConstraint = Shapes::StringShape.new(name: 'BucketLocationConstraint') BucketLoggingStatus = Shapes::StructureShape.new(name: 'BucketLoggingStatus') BucketLogsPermission = Shapes::StringShape.new(name: 'BucketLogsPermission') BucketName = Shapes::StringShape.new(name: 'BucketName') BucketVersioningStatus = Shapes::StringShape.new(name: 'BucketVersioningStatus') Buckets = Shapes::ListShape.new(name: 'Buckets') BypassGovernanceRetention = Shapes::BooleanShape.new(name: 'BypassGovernanceRetention') BytesProcessed = Shapes::IntegerShape.new(name: 'BytesProcessed') BytesReturned = Shapes::IntegerShape.new(name: 'BytesReturned') BytesScanned = Shapes::IntegerShape.new(name: 'BytesScanned') CORSConfiguration = Shapes::StructureShape.new(name: 'CORSConfiguration') CORSRule = Shapes::StructureShape.new(name: 'CORSRule') CORSRules = Shapes::ListShape.new(name: 'CORSRules', flattened: true) CSVInput = Shapes::StructureShape.new(name: 'CSVInput') CSVOutput = Shapes::StructureShape.new(name: 'CSVOutput') CacheControl = Shapes::StringShape.new(name: 'CacheControl') CloudFunction = Shapes::StringShape.new(name: 'CloudFunction') CloudFunctionConfiguration = Shapes::StructureShape.new(name: 'CloudFunctionConfiguration') CloudFunctionInvocationRole = Shapes::StringShape.new(name: 'CloudFunctionInvocationRole') Code = Shapes::StringShape.new(name: 'Code') Comments = Shapes::StringShape.new(name: 'Comments') CommonPrefix = Shapes::StructureShape.new(name: 'CommonPrefix') CommonPrefixList = Shapes::ListShape.new(name: 'CommonPrefixList', flattened: true) CompleteMultipartUploadOutput = Shapes::StructureShape.new(name: 'CompleteMultipartUploadOutput') CompleteMultipartUploadRequest = Shapes::StructureShape.new(name: 'CompleteMultipartUploadRequest') CompletedMultipartUpload = Shapes::StructureShape.new(name: 'CompletedMultipartUpload') CompletedPart = Shapes::StructureShape.new(name: 'CompletedPart') CompletedPartList = Shapes::ListShape.new(name: 'CompletedPartList', flattened: true) CompressionType = Shapes::StringShape.new(name: 'CompressionType') Condition = Shapes::StructureShape.new(name: 'Condition') ConfirmRemoveSelfBucketAccess = Shapes::BooleanShape.new(name: 'ConfirmRemoveSelfBucketAccess') ContentDisposition = Shapes::StringShape.new(name: 'ContentDisposition') ContentEncoding = Shapes::StringShape.new(name: 'ContentEncoding') ContentLanguage = Shapes::StringShape.new(name: 'ContentLanguage') ContentLength = Shapes::IntegerShape.new(name: 'ContentLength') ContentMD5 = Shapes::StringShape.new(name: 'ContentMD5') ContentRange = Shapes::StringShape.new(name: 'ContentRange') ContentType = Shapes::StringShape.new(name: 'ContentType') ContinuationEvent = Shapes::StructureShape.new(name: 'ContinuationEvent') CopyObjectOutput = Shapes::StructureShape.new(name: 'CopyObjectOutput') CopyObjectRequest = Shapes::StructureShape.new(name: 'CopyObjectRequest') CopyObjectResult = Shapes::StructureShape.new(name: 'CopyObjectResult') CopyPartResult = Shapes::StructureShape.new(name: 'CopyPartResult') CopySource = Shapes::StringShape.new(name: 'CopySource') CopySourceIfMatch = Shapes::StringShape.new(name: 'CopySourceIfMatch') CopySourceIfModifiedSince = Shapes::TimestampShape.new(name: 'CopySourceIfModifiedSince') CopySourceIfNoneMatch = Shapes::StringShape.new(name: 'CopySourceIfNoneMatch') CopySourceIfUnmodifiedSince = Shapes::TimestampShape.new(name: 'CopySourceIfUnmodifiedSince') CopySourceRange = Shapes::StringShape.new(name: 'CopySourceRange') CopySourceSSECustomerAlgorithm = Shapes::StringShape.new(name: 'CopySourceSSECustomerAlgorithm') CopySourceSSECustomerKey = Shapes::StringShape.new(name: 'CopySourceSSECustomerKey') CopySourceSSECustomerKeyMD5 = Shapes::StringShape.new(name: 'CopySourceSSECustomerKeyMD5') CopySourceVersionId = Shapes::StringShape.new(name: 'CopySourceVersionId') CreateBucketConfiguration = Shapes::StructureShape.new(name: 'CreateBucketConfiguration') CreateBucketOutput = Shapes::StructureShape.new(name: 'CreateBucketOutput') CreateBucketRequest = Shapes::StructureShape.new(name: 'CreateBucketRequest') CreateMultipartUploadOutput = Shapes::StructureShape.new(name: 'CreateMultipartUploadOutput') CreateMultipartUploadRequest = Shapes::StructureShape.new(name: 'CreateMultipartUploadRequest') CreationDate = Shapes::TimestampShape.new(name: 'CreationDate') Date = Shapes::TimestampShape.new(name: 'Date', timestampFormat: "iso8601") Days = Shapes::IntegerShape.new(name: 'Days') DaysAfterInitiation = Shapes::IntegerShape.new(name: 'DaysAfterInitiation') DefaultRetention = Shapes::StructureShape.new(name: 'DefaultRetention') Delete = Shapes::StructureShape.new(name: 'Delete') DeleteBucketAnalyticsConfigurationRequest = Shapes::StructureShape.new(name: 'DeleteBucketAnalyticsConfigurationRequest') DeleteBucketCorsRequest = Shapes::StructureShape.new(name: 'DeleteBucketCorsRequest') DeleteBucketEncryptionRequest = Shapes::StructureShape.new(name: 'DeleteBucketEncryptionRequest') DeleteBucketInventoryConfigurationRequest = Shapes::StructureShape.new(name: 'DeleteBucketInventoryConfigurationRequest') DeleteBucketLifecycleRequest = Shapes::StructureShape.new(name: 'DeleteBucketLifecycleRequest') DeleteBucketMetricsConfigurationRequest = Shapes::StructureShape.new(name: 'DeleteBucketMetricsConfigurationRequest') DeleteBucketPolicyRequest = Shapes::StructureShape.new(name: 'DeleteBucketPolicyRequest') DeleteBucketReplicationRequest = Shapes::StructureShape.new(name: 'DeleteBucketReplicationRequest') DeleteBucketRequest = Shapes::StructureShape.new(name: 'DeleteBucketRequest') DeleteBucketTaggingRequest = Shapes::StructureShape.new(name: 'DeleteBucketTaggingRequest') DeleteBucketWebsiteRequest = Shapes::StructureShape.new(name: 'DeleteBucketWebsiteRequest') DeleteMarker = Shapes::BooleanShape.new(name: 'DeleteMarker') DeleteMarkerEntry = Shapes::StructureShape.new(name: 'DeleteMarkerEntry') DeleteMarkerReplication = Shapes::StructureShape.new(name: 'DeleteMarkerReplication') DeleteMarkerReplicationStatus = Shapes::StringShape.new(name: 'DeleteMarkerReplicationStatus') DeleteMarkerVersionId = Shapes::StringShape.new(name: 'DeleteMarkerVersionId') DeleteMarkers = Shapes::ListShape.new(name: 'DeleteMarkers', flattened: true) DeleteObjectOutput = Shapes::StructureShape.new(name: 'DeleteObjectOutput') DeleteObjectRequest = Shapes::StructureShape.new(name: 'DeleteObjectRequest') DeleteObjectTaggingOutput = Shapes::StructureShape.new(name: 'DeleteObjectTaggingOutput') DeleteObjectTaggingRequest = Shapes::StructureShape.new(name: 'DeleteObjectTaggingRequest') DeleteObjectsOutput = Shapes::StructureShape.new(name: 'DeleteObjectsOutput') DeleteObjectsRequest = Shapes::StructureShape.new(name: 'DeleteObjectsRequest') DeletePublicAccessBlockRequest = Shapes::StructureShape.new(name: 'DeletePublicAccessBlockRequest') DeletedObject = Shapes::StructureShape.new(name: 'DeletedObject') DeletedObjects = Shapes::ListShape.new(name: 'DeletedObjects', flattened: true) Delimiter = Shapes::StringShape.new(name: 'Delimiter') Description = Shapes::StringShape.new(name: 'Description') Destination = Shapes::StructureShape.new(name: 'Destination') DisplayName = Shapes::StringShape.new(name: 'DisplayName') ETag = Shapes::StringShape.new(name: 'ETag') EmailAddress = Shapes::StringShape.new(name: 'EmailAddress') EnableRequestProgress = Shapes::BooleanShape.new(name: 'EnableRequestProgress') EncodingType = Shapes::StringShape.new(name: 'EncodingType') Encryption = Shapes::StructureShape.new(name: 'Encryption') EncryptionConfiguration = Shapes::StructureShape.new(name: 'EncryptionConfiguration') EndEvent = Shapes::StructureShape.new(name: 'EndEvent') Error = Shapes::StructureShape.new(name: 'Error') ErrorDocument = Shapes::StructureShape.new(name: 'ErrorDocument') Errors = Shapes::ListShape.new(name: 'Errors', flattened: true) Event = Shapes::StringShape.new(name: 'Event') EventList = Shapes::ListShape.new(name: 'EventList', flattened: true) Expiration = Shapes::StringShape.new(name: 'Expiration') ExpirationStatus = Shapes::StringShape.new(name: 'ExpirationStatus') ExpiredObjectDeleteMarker = Shapes::BooleanShape.new(name: 'ExpiredObjectDeleteMarker') Expires = Shapes::TimestampShape.new(name: 'Expires') ExpiresString = Shapes::StringShape.new(name: 'ExpiresString') ExposeHeader = Shapes::StringShape.new(name: 'ExposeHeader') ExposeHeaders = Shapes::ListShape.new(name: 'ExposeHeaders', flattened: true) Expression = Shapes::StringShape.new(name: 'Expression') ExpressionType = Shapes::StringShape.new(name: 'ExpressionType') FetchOwner = Shapes::BooleanShape.new(name: 'FetchOwner') FieldDelimiter = Shapes::StringShape.new(name: 'FieldDelimiter') FileHeaderInfo = Shapes::StringShape.new(name: 'FileHeaderInfo') FilterRule = Shapes::StructureShape.new(name: 'FilterRule') FilterRuleList = Shapes::ListShape.new(name: 'FilterRuleList', flattened: true) FilterRuleName = Shapes::StringShape.new(name: 'FilterRuleName') FilterRuleValue = Shapes::StringShape.new(name: 'FilterRuleValue') GetBucketAccelerateConfigurationOutput = Shapes::StructureShape.new(name: 'GetBucketAccelerateConfigurationOutput') GetBucketAccelerateConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketAccelerateConfigurationRequest') GetBucketAclOutput = Shapes::StructureShape.new(name: 'GetBucketAclOutput') GetBucketAclRequest = Shapes::StructureShape.new(name: 'GetBucketAclRequest') GetBucketAnalyticsConfigurationOutput = Shapes::StructureShape.new(name: 'GetBucketAnalyticsConfigurationOutput') GetBucketAnalyticsConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketAnalyticsConfigurationRequest') GetBucketCorsOutput = Shapes::StructureShape.new(name: 'GetBucketCorsOutput') GetBucketCorsRequest = Shapes::StructureShape.new(name: 'GetBucketCorsRequest') GetBucketEncryptionOutput = Shapes::StructureShape.new(name: 'GetBucketEncryptionOutput') GetBucketEncryptionRequest = Shapes::StructureShape.new(name: 'GetBucketEncryptionRequest') GetBucketInventoryConfigurationOutput = Shapes::StructureShape.new(name: 'GetBucketInventoryConfigurationOutput') GetBucketInventoryConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketInventoryConfigurationRequest') GetBucketLifecycleConfigurationOutput = Shapes::StructureShape.new(name: 'GetBucketLifecycleConfigurationOutput') GetBucketLifecycleConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketLifecycleConfigurationRequest') GetBucketLifecycleOutput = Shapes::StructureShape.new(name: 'GetBucketLifecycleOutput') GetBucketLifecycleRequest = Shapes::StructureShape.new(name: 'GetBucketLifecycleRequest') GetBucketLocationOutput = Shapes::StructureShape.new(name: 'GetBucketLocationOutput') GetBucketLocationRequest = Shapes::StructureShape.new(name: 'GetBucketLocationRequest') GetBucketLoggingOutput = Shapes::StructureShape.new(name: 'GetBucketLoggingOutput') GetBucketLoggingRequest = Shapes::StructureShape.new(name: 'GetBucketLoggingRequest') GetBucketMetricsConfigurationOutput = Shapes::StructureShape.new(name: 'GetBucketMetricsConfigurationOutput') GetBucketMetricsConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketMetricsConfigurationRequest') GetBucketNotificationConfigurationRequest = Shapes::StructureShape.new(name: 'GetBucketNotificationConfigurationRequest') GetBucketPolicyOutput = Shapes::StructureShape.new(name: 'GetBucketPolicyOutput') GetBucketPolicyRequest = Shapes::StructureShape.new(name: 'GetBucketPolicyRequest') GetBucketPolicyStatusOutput = Shapes::StructureShape.new(name: 'GetBucketPolicyStatusOutput') GetBucketPolicyStatusRequest = Shapes::StructureShape.new(name: 'GetBucketPolicyStatusRequest') GetBucketReplicationOutput = Shapes::StructureShape.new(name: 'GetBucketReplicationOutput') GetBucketReplicationRequest = Shapes::StructureShape.new(name: 'GetBucketReplicationRequest') GetBucketRequestPaymentOutput = Shapes::StructureShape.new(name: 'GetBucketRequestPaymentOutput') GetBucketRequestPaymentRequest = Shapes::StructureShape.new(name: 'GetBucketRequestPaymentRequest') GetBucketTaggingOutput = Shapes::StructureShape.new(name: 'GetBucketTaggingOutput') GetBucketTaggingRequest = Shapes::StructureShape.new(name: 'GetBucketTaggingRequest') GetBucketVersioningOutput = Shapes::StructureShape.new(name: 'GetBucketVersioningOutput') GetBucketVersioningRequest = Shapes::StructureShape.new(name: 'GetBucketVersioningRequest') GetBucketWebsiteOutput = Shapes::StructureShape.new(name: 'GetBucketWebsiteOutput') GetBucketWebsiteRequest = Shapes::StructureShape.new(name: 'GetBucketWebsiteRequest') GetObjectAclOutput = Shapes::StructureShape.new(name: 'GetObjectAclOutput') GetObjectAclRequest = Shapes::StructureShape.new(name: 'GetObjectAclRequest') GetObjectLegalHoldOutput = Shapes::StructureShape.new(name: 'GetObjectLegalHoldOutput') GetObjectLegalHoldRequest = Shapes::StructureShape.new(name: 'GetObjectLegalHoldRequest') GetObjectLockConfigurationOutput = Shapes::StructureShape.new(name: 'GetObjectLockConfigurationOutput') GetObjectLockConfigurationRequest = Shapes::StructureShape.new(name: 'GetObjectLockConfigurationRequest') GetObjectOutput = Shapes::StructureShape.new(name: 'GetObjectOutput') GetObjectRequest = Shapes::StructureShape.new(name: 'GetObjectRequest') GetObjectRetentionOutput = Shapes::StructureShape.new(name: 'GetObjectRetentionOutput') GetObjectRetentionRequest = Shapes::StructureShape.new(name: 'GetObjectRetentionRequest') GetObjectTaggingOutput = Shapes::StructureShape.new(name: 'GetObjectTaggingOutput') GetObjectTaggingRequest = Shapes::StructureShape.new(name: 'GetObjectTaggingRequest') GetObjectTorrentOutput = Shapes::StructureShape.new(name: 'GetObjectTorrentOutput') GetObjectTorrentRequest = Shapes::StructureShape.new(name: 'GetObjectTorrentRequest') GetPublicAccessBlockOutput = Shapes::StructureShape.new(name: 'GetPublicAccessBlockOutput') GetPublicAccessBlockRequest = Shapes::StructureShape.new(name: 'GetPublicAccessBlockRequest') GlacierJobParameters = Shapes::StructureShape.new(name: 'GlacierJobParameters') Grant = Shapes::StructureShape.new(name: 'Grant') GrantFullControl = Shapes::StringShape.new(name: 'GrantFullControl') GrantRead = Shapes::StringShape.new(name: 'GrantRead') GrantReadACP = Shapes::StringShape.new(name: 'GrantReadACP') GrantWrite = Shapes::StringShape.new(name: 'GrantWrite') GrantWriteACP = Shapes::StringShape.new(name: 'GrantWriteACP') Grantee = Shapes::StructureShape.new(name: 'Grantee', xmlNamespace: {"prefix"=>"xsi", "uri"=>"http://www.w3.org/2001/XMLSchema-instance"}) Grants = Shapes::ListShape.new(name: 'Grants') HeadBucketRequest = Shapes::StructureShape.new(name: 'HeadBucketRequest') HeadObjectOutput = Shapes::StructureShape.new(name: 'HeadObjectOutput') HeadObjectRequest = Shapes::StructureShape.new(name: 'HeadObjectRequest') HostName = Shapes::StringShape.new(name: 'HostName') HttpErrorCodeReturnedEquals = Shapes::StringShape.new(name: 'HttpErrorCodeReturnedEquals') HttpRedirectCode = Shapes::StringShape.new(name: 'HttpRedirectCode') ID = Shapes::StringShape.new(name: 'ID') IfMatch = Shapes::StringShape.new(name: 'IfMatch') IfModifiedSince = Shapes::TimestampShape.new(name: 'IfModifiedSince') IfNoneMatch = Shapes::StringShape.new(name: 'IfNoneMatch') IfUnmodifiedSince = Shapes::TimestampShape.new(name: 'IfUnmodifiedSince') IndexDocument = Shapes::StructureShape.new(name: 'IndexDocument') Initiated = Shapes::TimestampShape.new(name: 'Initiated') Initiator = Shapes::StructureShape.new(name: 'Initiator') InputSerialization = Shapes::StructureShape.new(name: 'InputSerialization') InventoryConfiguration = Shapes::StructureShape.new(name: 'InventoryConfiguration') InventoryConfigurationList = Shapes::ListShape.new(name: 'InventoryConfigurationList', flattened: true) InventoryDestination = Shapes::StructureShape.new(name: 'InventoryDestination') InventoryEncryption = Shapes::StructureShape.new(name: 'InventoryEncryption') InventoryFilter = Shapes::StructureShape.new(name: 'InventoryFilter') InventoryFormat = Shapes::StringShape.new(name: 'InventoryFormat') InventoryFrequency = Shapes::StringShape.new(name: 'InventoryFrequency') InventoryId = Shapes::StringShape.new(name: 'InventoryId') InventoryIncludedObjectVersions = Shapes::StringShape.new(name: 'InventoryIncludedObjectVersions') InventoryOptionalField = Shapes::StringShape.new(name: 'InventoryOptionalField') InventoryOptionalFields = Shapes::ListShape.new(name: 'InventoryOptionalFields') InventoryS3BucketDestination = Shapes::StructureShape.new(name: 'InventoryS3BucketDestination') InventorySchedule = Shapes::StructureShape.new(name: 'InventorySchedule') IsEnabled = Shapes::BooleanShape.new(name: 'IsEnabled') IsLatest = Shapes::BooleanShape.new(name: 'IsLatest') IsPublic = Shapes::BooleanShape.new(name: 'IsPublic') IsTruncated = Shapes::BooleanShape.new(name: 'IsTruncated') JSONInput = Shapes::StructureShape.new(name: 'JSONInput') JSONOutput = Shapes::StructureShape.new(name: 'JSONOutput') JSONType = Shapes::StringShape.new(name: 'JSONType') KMSContext = Shapes::StringShape.new(name: 'KMSContext') KeyCount = Shapes::IntegerShape.new(name: 'KeyCount') KeyMarker = Shapes::StringShape.new(name: 'KeyMarker') KeyPrefixEquals = Shapes::StringShape.new(name: 'KeyPrefixEquals') LambdaFunctionArn = Shapes::StringShape.new(name: 'LambdaFunctionArn') LambdaFunctionConfiguration = Shapes::StructureShape.new(name: 'LambdaFunctionConfiguration') LambdaFunctionConfigurationList = Shapes::ListShape.new(name: 'LambdaFunctionConfigurationList', flattened: true) LastModified = Shapes::TimestampShape.new(name: 'LastModified') LifecycleConfiguration = Shapes::StructureShape.new(name: 'LifecycleConfiguration') LifecycleExpiration = Shapes::StructureShape.new(name: 'LifecycleExpiration') LifecycleRule = Shapes::StructureShape.new(name: 'LifecycleRule') LifecycleRuleAndOperator = Shapes::StructureShape.new(name: 'LifecycleRuleAndOperator') LifecycleRuleFilter = Shapes::StructureShape.new(name: 'LifecycleRuleFilter') LifecycleRules = Shapes::ListShape.new(name: 'LifecycleRules', flattened: true) ListBucketAnalyticsConfigurationsOutput = Shapes::StructureShape.new(name: 'ListBucketAnalyticsConfigurationsOutput') ListBucketAnalyticsConfigurationsRequest = Shapes::StructureShape.new(name: 'ListBucketAnalyticsConfigurationsRequest') ListBucketInventoryConfigurationsOutput = Shapes::StructureShape.new(name: 'ListBucketInventoryConfigurationsOutput') ListBucketInventoryConfigurationsRequest = Shapes::StructureShape.new(name: 'ListBucketInventoryConfigurationsRequest') ListBucketMetricsConfigurationsOutput = Shapes::StructureShape.new(name: 'ListBucketMetricsConfigurationsOutput') ListBucketMetricsConfigurationsRequest = Shapes::StructureShape.new(name: 'ListBucketMetricsConfigurationsRequest') ListBucketsOutput = Shapes::StructureShape.new(name: 'ListBucketsOutput') ListMultipartUploadsOutput = Shapes::StructureShape.new(name: 'ListMultipartUploadsOutput') ListMultipartUploadsRequest = Shapes::StructureShape.new(name: 'ListMultipartUploadsRequest') ListObjectVersionsOutput = Shapes::StructureShape.new(name: 'ListObjectVersionsOutput') ListObjectVersionsRequest = Shapes::StructureShape.new(name: 'ListObjectVersionsRequest') ListObjectsOutput = Shapes::StructureShape.new(name: 'ListObjectsOutput') ListObjectsRequest = Shapes::StructureShape.new(name: 'ListObjectsRequest') ListObjectsV2Output = Shapes::StructureShape.new(name: 'ListObjectsV2Output') ListObjectsV2Request = Shapes::StructureShape.new(name: 'ListObjectsV2Request') ListPartsOutput = Shapes::StructureShape.new(name: 'ListPartsOutput') ListPartsRequest = Shapes::StructureShape.new(name: 'ListPartsRequest') Location = Shapes::StringShape.new(name: 'Location') LocationPrefix = Shapes::StringShape.new(name: 'LocationPrefix') LoggingEnabled = Shapes::StructureShape.new(name: 'LoggingEnabled') MFA = Shapes::StringShape.new(name: 'MFA') MFADelete = Shapes::StringShape.new(name: 'MFADelete') MFADeleteStatus = Shapes::StringShape.new(name: 'MFADeleteStatus') Marker = Shapes::StringShape.new(name: 'Marker') MaxAgeSeconds = Shapes::IntegerShape.new(name: 'MaxAgeSeconds') MaxKeys = Shapes::IntegerShape.new(name: 'MaxKeys') MaxParts = Shapes::IntegerShape.new(name: 'MaxParts') MaxUploads = Shapes::IntegerShape.new(name: 'MaxUploads') Message = Shapes::StringShape.new(name: 'Message') Metadata = Shapes::MapShape.new(name: 'Metadata') MetadataDirective = Shapes::StringShape.new(name: 'MetadataDirective') MetadataEntry = Shapes::StructureShape.new(name: 'MetadataEntry') MetadataKey = Shapes::StringShape.new(name: 'MetadataKey') MetadataValue = Shapes::StringShape.new(name: 'MetadataValue') MetricsAndOperator = Shapes::StructureShape.new(name: 'MetricsAndOperator') MetricsConfiguration = Shapes::StructureShape.new(name: 'MetricsConfiguration') MetricsConfigurationList = Shapes::ListShape.new(name: 'MetricsConfigurationList', flattened: true) MetricsFilter = Shapes::StructureShape.new(name: 'MetricsFilter') MetricsId = Shapes::StringShape.new(name: 'MetricsId') MissingMeta = Shapes::IntegerShape.new(name: 'MissingMeta') MultipartUpload = Shapes::StructureShape.new(name: 'MultipartUpload') MultipartUploadId = Shapes::StringShape.new(name: 'MultipartUploadId') MultipartUploadList = Shapes::ListShape.new(name: 'MultipartUploadList', flattened: true) NextKeyMarker = Shapes::StringShape.new(name: 'NextKeyMarker') NextMarker = Shapes::StringShape.new(name: 'NextMarker') NextPartNumberMarker = Shapes::IntegerShape.new(name: 'NextPartNumberMarker') NextToken = Shapes::StringShape.new(name: 'NextToken') NextUploadIdMarker = Shapes::StringShape.new(name: 'NextUploadIdMarker') NextVersionIdMarker = Shapes::StringShape.new(name: 'NextVersionIdMarker') NoSuchBucket = Shapes::StructureShape.new(name: 'NoSuchBucket') NoSuchKey = Shapes::StructureShape.new(name: 'NoSuchKey') NoSuchUpload = Shapes::StructureShape.new(name: 'NoSuchUpload') NoncurrentVersionExpiration = Shapes::StructureShape.new(name: 'NoncurrentVersionExpiration') NoncurrentVersionTransition = Shapes::StructureShape.new(name: 'NoncurrentVersionTransition') NoncurrentVersionTransitionList = Shapes::ListShape.new(name: 'NoncurrentVersionTransitionList', flattened: true) NotificationConfiguration = Shapes::StructureShape.new(name: 'NotificationConfiguration') NotificationConfigurationDeprecated = Shapes::StructureShape.new(name: 'NotificationConfigurationDeprecated') NotificationConfigurationFilter = Shapes::StructureShape.new(name: 'NotificationConfigurationFilter') NotificationId = Shapes::StringShape.new(name: 'NotificationId') Object = Shapes::StructureShape.new(name: 'Object') ObjectAlreadyInActiveTierError = Shapes::StructureShape.new(name: 'ObjectAlreadyInActiveTierError') ObjectCannedACL = Shapes::StringShape.new(name: 'ObjectCannedACL') ObjectIdentifier = Shapes::StructureShape.new(name: 'ObjectIdentifier') ObjectIdentifierList = Shapes::ListShape.new(name: 'ObjectIdentifierList', flattened: true) ObjectKey = Shapes::StringShape.new(name: 'ObjectKey') ObjectList = Shapes::ListShape.new(name: 'ObjectList', flattened: true) ObjectLockConfiguration = Shapes::StructureShape.new(name: 'ObjectLockConfiguration') ObjectLockEnabled = Shapes::StringShape.new(name: 'ObjectLockEnabled') ObjectLockEnabledForBucket = Shapes::BooleanShape.new(name: 'ObjectLockEnabledForBucket') ObjectLockLegalHold = Shapes::StructureShape.new(name: 'ObjectLockLegalHold') ObjectLockLegalHoldStatus = Shapes::StringShape.new(name: 'ObjectLockLegalHoldStatus') ObjectLockMode = Shapes::StringShape.new(name: 'ObjectLockMode') ObjectLockRetainUntilDate = Shapes::TimestampShape.new(name: 'ObjectLockRetainUntilDate', timestampFormat: "iso8601") ObjectLockRetention = Shapes::StructureShape.new(name: 'ObjectLockRetention') ObjectLockRetentionMode = Shapes::StringShape.new(name: 'ObjectLockRetentionMode') ObjectLockRule = Shapes::StructureShape.new(name: 'ObjectLockRule') ObjectLockToken = Shapes::StringShape.new(name: 'ObjectLockToken') ObjectNotInActiveTierError = Shapes::StructureShape.new(name: 'ObjectNotInActiveTierError') ObjectStorageClass = Shapes::StringShape.new(name: 'ObjectStorageClass') ObjectVersion = Shapes::StructureShape.new(name: 'ObjectVersion') ObjectVersionId = Shapes::StringShape.new(name: 'ObjectVersionId') ObjectVersionList = Shapes::ListShape.new(name: 'ObjectVersionList', flattened: true) ObjectVersionStorageClass = Shapes::StringShape.new(name: 'ObjectVersionStorageClass') OutputLocation = Shapes::StructureShape.new(name: 'OutputLocation') OutputSerialization = Shapes::StructureShape.new(name: 'OutputSerialization') Owner = Shapes::StructureShape.new(name: 'Owner') OwnerOverride = Shapes::StringShape.new(name: 'OwnerOverride') ParquetInput = Shapes::StructureShape.new(name: 'ParquetInput') Part = Shapes::StructureShape.new(name: 'Part') PartNumber = Shapes::IntegerShape.new(name: 'PartNumber') PartNumberMarker = Shapes::IntegerShape.new(name: 'PartNumberMarker') Parts = Shapes::ListShape.new(name: 'Parts', flattened: true) PartsCount = Shapes::IntegerShape.new(name: 'PartsCount') Payer = Shapes::StringShape.new(name: 'Payer') Permission = Shapes::StringShape.new(name: 'Permission') Policy = Shapes::StringShape.new(name: 'Policy') PolicyStatus = Shapes::StructureShape.new(name: 'PolicyStatus') Prefix = Shapes::StringShape.new(name: 'Prefix') Priority = Shapes::IntegerShape.new(name: 'Priority') Progress = Shapes::StructureShape.new(name: 'Progress') ProgressEvent = Shapes::StructureShape.new(name: 'ProgressEvent') Protocol = Shapes::StringShape.new(name: 'Protocol') PublicAccessBlockConfiguration = Shapes::StructureShape.new(name: 'PublicAccessBlockConfiguration') PutBucketAccelerateConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketAccelerateConfigurationRequest') PutBucketAclRequest = Shapes::StructureShape.new(name: 'PutBucketAclRequest') PutBucketAnalyticsConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketAnalyticsConfigurationRequest') PutBucketCorsRequest = Shapes::StructureShape.new(name: 'PutBucketCorsRequest') PutBucketEncryptionRequest = Shapes::StructureShape.new(name: 'PutBucketEncryptionRequest') PutBucketInventoryConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketInventoryConfigurationRequest') PutBucketLifecycleConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketLifecycleConfigurationRequest') PutBucketLifecycleRequest = Shapes::StructureShape.new(name: 'PutBucketLifecycleRequest') PutBucketLoggingRequest = Shapes::StructureShape.new(name: 'PutBucketLoggingRequest') PutBucketMetricsConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketMetricsConfigurationRequest') PutBucketNotificationConfigurationRequest = Shapes::StructureShape.new(name: 'PutBucketNotificationConfigurationRequest') PutBucketNotificationRequest = Shapes::StructureShape.new(name: 'PutBucketNotificationRequest') PutBucketPolicyRequest = Shapes::StructureShape.new(name: 'PutBucketPolicyRequest') PutBucketReplicationRequest = Shapes::StructureShape.new(name: 'PutBucketReplicationRequest') PutBucketRequestPaymentRequest = Shapes::StructureShape.new(name: 'PutBucketRequestPaymentRequest') PutBucketTaggingRequest = Shapes::StructureShape.new(name: 'PutBucketTaggingRequest') PutBucketVersioningRequest = Shapes::StructureShape.new(name: 'PutBucketVersioningRequest') PutBucketWebsiteRequest = Shapes::StructureShape.new(name: 'PutBucketWebsiteRequest') PutObjectAclOutput = Shapes::StructureShape.new(name: 'PutObjectAclOutput') PutObjectAclRequest = Shapes::StructureShape.new(name: 'PutObjectAclRequest') PutObjectLegalHoldOutput = Shapes::StructureShape.new(name: 'PutObjectLegalHoldOutput') PutObjectLegalHoldRequest = Shapes::StructureShape.new(name: 'PutObjectLegalHoldRequest') PutObjectLockConfigurationOutput = Shapes::StructureShape.new(name: 'PutObjectLockConfigurationOutput') PutObjectLockConfigurationRequest = Shapes::StructureShape.new(name: 'PutObjectLockConfigurationRequest') PutObjectOutput = Shapes::StructureShape.new(name: 'PutObjectOutput') PutObjectRequest = Shapes::StructureShape.new(name: 'PutObjectRequest') PutObjectRetentionOutput = Shapes::StructureShape.new(name: 'PutObjectRetentionOutput') PutObjectRetentionRequest = Shapes::StructureShape.new(name: 'PutObjectRetentionRequest') PutObjectTaggingOutput = Shapes::StructureShape.new(name: 'PutObjectTaggingOutput') PutObjectTaggingRequest = Shapes::StructureShape.new(name: 'PutObjectTaggingRequest') PutPublicAccessBlockRequest = Shapes::StructureShape.new(name: 'PutPublicAccessBlockRequest') QueueArn = Shapes::StringShape.new(name: 'QueueArn') QueueConfiguration = Shapes::StructureShape.new(name: 'QueueConfiguration') QueueConfigurationDeprecated = Shapes::StructureShape.new(name: 'QueueConfigurationDeprecated') QueueConfigurationList = Shapes::ListShape.new(name: 'QueueConfigurationList', flattened: true) Quiet = Shapes::BooleanShape.new(name: 'Quiet') QuoteCharacter = Shapes::StringShape.new(name: 'QuoteCharacter') QuoteEscapeCharacter = Shapes::StringShape.new(name: 'QuoteEscapeCharacter') QuoteFields = Shapes::StringShape.new(name: 'QuoteFields') Range = Shapes::StringShape.new(name: 'Range') RecordDelimiter = Shapes::StringShape.new(name: 'RecordDelimiter') RecordsEvent = Shapes::StructureShape.new(name: 'RecordsEvent') Redirect = Shapes::StructureShape.new(name: 'Redirect') RedirectAllRequestsTo = Shapes::StructureShape.new(name: 'RedirectAllRequestsTo') ReplaceKeyPrefixWith = Shapes::StringShape.new(name: 'ReplaceKeyPrefixWith') ReplaceKeyWith = Shapes::StringShape.new(name: 'ReplaceKeyWith') ReplicaKmsKeyID = Shapes::StringShape.new(name: 'ReplicaKmsKeyID') ReplicationConfiguration = Shapes::StructureShape.new(name: 'ReplicationConfiguration') ReplicationRule = Shapes::StructureShape.new(name: 'ReplicationRule') ReplicationRuleAndOperator = Shapes::StructureShape.new(name: 'ReplicationRuleAndOperator') ReplicationRuleFilter = Shapes::StructureShape.new(name: 'ReplicationRuleFilter') ReplicationRuleStatus = Shapes::StringShape.new(name: 'ReplicationRuleStatus') ReplicationRules = Shapes::ListShape.new(name: 'ReplicationRules', flattened: true) ReplicationStatus = Shapes::StringShape.new(name: 'ReplicationStatus') RequestCharged = Shapes::StringShape.new(name: 'RequestCharged') RequestPayer = Shapes::StringShape.new(name: 'RequestPayer') RequestPaymentConfiguration = Shapes::StructureShape.new(name: 'RequestPaymentConfiguration') RequestProgress = Shapes::StructureShape.new(name: 'RequestProgress') ResponseCacheControl = Shapes::StringShape.new(name: 'ResponseCacheControl') ResponseContentDisposition = Shapes::StringShape.new(name: 'ResponseContentDisposition') ResponseContentEncoding = Shapes::StringShape.new(name: 'ResponseContentEncoding') ResponseContentLanguage = Shapes::StringShape.new(name: 'ResponseContentLanguage') ResponseContentType = Shapes::StringShape.new(name: 'ResponseContentType') ResponseExpires = Shapes::TimestampShape.new(name: 'ResponseExpires') Restore = Shapes::StringShape.new(name: 'Restore') RestoreObjectOutput = Shapes::StructureShape.new(name: 'RestoreObjectOutput') RestoreObjectRequest = Shapes::StructureShape.new(name: 'RestoreObjectRequest') RestoreOutputPath = Shapes::StringShape.new(name: 'RestoreOutputPath') RestoreRequest = Shapes::StructureShape.new(name: 'RestoreRequest') RestoreRequestType = Shapes::StringShape.new(name: 'RestoreRequestType') Role = Shapes::StringShape.new(name: 'Role') RoutingRule = Shapes::StructureShape.new(name: 'RoutingRule') RoutingRules = Shapes::ListShape.new(name: 'RoutingRules') Rule = Shapes::StructureShape.new(name: 'Rule') Rules = Shapes::ListShape.new(name: 'Rules', flattened: true) S3KeyFilter = Shapes::StructureShape.new(name: 'S3KeyFilter') S3Location = Shapes::StructureShape.new(name: 'S3Location') SSECustomerAlgorithm = Shapes::StringShape.new(name: 'SSECustomerAlgorithm') SSECustomerKey = Shapes::StringShape.new(name: 'SSECustomerKey') SSECustomerKeyMD5 = Shapes::StringShape.new(name: 'SSECustomerKeyMD5') SSEKMS = Shapes::StructureShape.new(name: 'SSEKMS') SSEKMSEncryptionContext = Shapes::StringShape.new(name: 'SSEKMSEncryptionContext') SSEKMSKeyId = Shapes::StringShape.new(name: 'SSEKMSKeyId') SSES3 = Shapes::StructureShape.new(name: 'SSES3') SelectObjectContentEventStream = Shapes::StructureShape.new(name: 'SelectObjectContentEventStream') SelectObjectContentOutput = Shapes::StructureShape.new(name: 'SelectObjectContentOutput') SelectObjectContentRequest = Shapes::StructureShape.new(name: 'SelectObjectContentRequest') SelectParameters = Shapes::StructureShape.new(name: 'SelectParameters') ServerSideEncryption = Shapes::StringShape.new(name: 'ServerSideEncryption') ServerSideEncryptionByDefault = Shapes::StructureShape.new(name: 'ServerSideEncryptionByDefault') ServerSideEncryptionConfiguration = Shapes::StructureShape.new(name: 'ServerSideEncryptionConfiguration') ServerSideEncryptionRule = Shapes::StructureShape.new(name: 'ServerSideEncryptionRule') ServerSideEncryptionRules = Shapes::ListShape.new(name: 'ServerSideEncryptionRules', flattened: true) Setting = Shapes::BooleanShape.new(name: 'Setting') Size = Shapes::IntegerShape.new(name: 'Size') SourceSelectionCriteria = Shapes::StructureShape.new(name: 'SourceSelectionCriteria') SseKmsEncryptedObjects = Shapes::StructureShape.new(name: 'SseKmsEncryptedObjects') SseKmsEncryptedObjectsStatus = Shapes::StringShape.new(name: 'SseKmsEncryptedObjectsStatus') StartAfter = Shapes::StringShape.new(name: 'StartAfter') Stats = Shapes::StructureShape.new(name: 'Stats') StatsEvent = Shapes::StructureShape.new(name: 'StatsEvent') StorageClass = Shapes::StringShape.new(name: 'StorageClass') StorageClassAnalysis = Shapes::StructureShape.new(name: 'StorageClassAnalysis') StorageClassAnalysisDataExport = Shapes::StructureShape.new(name: 'StorageClassAnalysisDataExport') StorageClassAnalysisSchemaVersion = Shapes::StringShape.new(name: 'StorageClassAnalysisSchemaVersion') Suffix = Shapes::StringShape.new(name: 'Suffix') Tag = Shapes::StructureShape.new(name: 'Tag') TagCount = Shapes::IntegerShape.new(name: 'TagCount') TagSet = Shapes::ListShape.new(name: 'TagSet') Tagging = Shapes::StructureShape.new(name: 'Tagging') TaggingDirective = Shapes::StringShape.new(name: 'TaggingDirective') TaggingHeader = Shapes::StringShape.new(name: 'TaggingHeader') TargetBucket = Shapes::StringShape.new(name: 'TargetBucket') TargetGrant = Shapes::StructureShape.new(name: 'TargetGrant') TargetGrants = Shapes::ListShape.new(name: 'TargetGrants') TargetPrefix = Shapes::StringShape.new(name: 'TargetPrefix') Tier = Shapes::StringShape.new(name: 'Tier') Token = Shapes::StringShape.new(name: 'Token') TopicArn = Shapes::StringShape.new(name: 'TopicArn') TopicConfiguration = Shapes::StructureShape.new(name: 'TopicConfiguration') TopicConfigurationDeprecated = Shapes::StructureShape.new(name: 'TopicConfigurationDeprecated') TopicConfigurationList = Shapes::ListShape.new(name: 'TopicConfigurationList', flattened: true) Transition = Shapes::StructureShape.new(name: 'Transition') TransitionList = Shapes::ListShape.new(name: 'TransitionList', flattened: true) TransitionStorageClass = Shapes::StringShape.new(name: 'TransitionStorageClass') Type = Shapes::StringShape.new(name: 'Type') URI = Shapes::StringShape.new(name: 'URI') UploadIdMarker = Shapes::StringShape.new(name: 'UploadIdMarker') UploadPartCopyOutput = Shapes::StructureShape.new(name: 'UploadPartCopyOutput') UploadPartCopyRequest = Shapes::StructureShape.new(name: 'UploadPartCopyRequest') UploadPartOutput = Shapes::StructureShape.new(name: 'UploadPartOutput') UploadPartRequest = Shapes::StructureShape.new(name: 'UploadPartRequest') UserMetadata = Shapes::ListShape.new(name: 'UserMetadata') Value = Shapes::StringShape.new(name: 'Value') VersionIdMarker = Shapes::StringShape.new(name: 'VersionIdMarker') VersioningConfiguration = Shapes::StructureShape.new(name: 'VersioningConfiguration') WebsiteConfiguration = Shapes::StructureShape.new(name: 'WebsiteConfiguration') WebsiteRedirectLocation = Shapes::StringShape.new(name: 'WebsiteRedirectLocation') Years = Shapes::IntegerShape.new(name: 'Years') AbortIncompleteMultipartUpload.add_member(:days_after_initiation, Shapes::ShapeRef.new(shape: DaysAfterInitiation, location_name: "DaysAfterInitiation")) AbortIncompleteMultipartUpload.struct_class = Types::AbortIncompleteMultipartUpload AbortMultipartUploadOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) AbortMultipartUploadOutput.struct_class = Types::AbortMultipartUploadOutput AbortMultipartUploadRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) AbortMultipartUploadRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) AbortMultipartUploadRequest.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, required: true, location: "querystring", location_name: "uploadId")) AbortMultipartUploadRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) AbortMultipartUploadRequest.struct_class = Types::AbortMultipartUploadRequest AccelerateConfiguration.add_member(:status, Shapes::ShapeRef.new(shape: BucketAccelerateStatus, location_name: "Status")) AccelerateConfiguration.struct_class = Types::AccelerateConfiguration AccessControlPolicy.add_member(:grants, Shapes::ShapeRef.new(shape: Grants, location_name: "AccessControlList")) AccessControlPolicy.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) AccessControlPolicy.struct_class = Types::AccessControlPolicy AccessControlTranslation.add_member(:owner, Shapes::ShapeRef.new(shape: OwnerOverride, required: true, location_name: "Owner")) AccessControlTranslation.struct_class = Types::AccessControlTranslation AllowedHeaders.member = Shapes::ShapeRef.new(shape: AllowedHeader) AllowedMethods.member = Shapes::ShapeRef.new(shape: AllowedMethod) AllowedOrigins.member = Shapes::ShapeRef.new(shape: AllowedOrigin) AnalyticsAndOperator.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) AnalyticsAndOperator.add_member(:tags, Shapes::ShapeRef.new(shape: TagSet, location_name: "Tag", metadata: {"flattened"=>true})) AnalyticsAndOperator.struct_class = Types::AnalyticsAndOperator AnalyticsConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: AnalyticsId, required: true, location_name: "Id")) AnalyticsConfiguration.add_member(:filter, Shapes::ShapeRef.new(shape: AnalyticsFilter, location_name: "Filter")) AnalyticsConfiguration.add_member(:storage_class_analysis, Shapes::ShapeRef.new(shape: StorageClassAnalysis, required: true, location_name: "StorageClassAnalysis")) AnalyticsConfiguration.struct_class = Types::AnalyticsConfiguration AnalyticsConfigurationList.member = Shapes::ShapeRef.new(shape: AnalyticsConfiguration) AnalyticsExportDestination.add_member(:s3_bucket_destination, Shapes::ShapeRef.new(shape: AnalyticsS3BucketDestination, required: true, location_name: "S3BucketDestination")) AnalyticsExportDestination.struct_class = Types::AnalyticsExportDestination AnalyticsFilter.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) AnalyticsFilter.add_member(:tag, Shapes::ShapeRef.new(shape: Tag, location_name: "Tag")) AnalyticsFilter.add_member(:and, Shapes::ShapeRef.new(shape: AnalyticsAndOperator, location_name: "And")) AnalyticsFilter.struct_class = Types::AnalyticsFilter AnalyticsS3BucketDestination.add_member(:format, Shapes::ShapeRef.new(shape: AnalyticsS3ExportFileFormat, required: true, location_name: "Format")) AnalyticsS3BucketDestination.add_member(:bucket_account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "BucketAccountId")) AnalyticsS3BucketDestination.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location_name: "Bucket")) AnalyticsS3BucketDestination.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) AnalyticsS3BucketDestination.struct_class = Types::AnalyticsS3BucketDestination Bucket.add_member(:name, Shapes::ShapeRef.new(shape: BucketName, location_name: "Name")) Bucket.add_member(:creation_date, Shapes::ShapeRef.new(shape: CreationDate, location_name: "CreationDate")) Bucket.struct_class = Types::Bucket BucketLifecycleConfiguration.add_member(:rules, Shapes::ShapeRef.new(shape: LifecycleRules, required: true, location_name: "Rule")) BucketLifecycleConfiguration.struct_class = Types::BucketLifecycleConfiguration BucketLoggingStatus.add_member(:logging_enabled, Shapes::ShapeRef.new(shape: LoggingEnabled, location_name: "LoggingEnabled")) BucketLoggingStatus.struct_class = Types::BucketLoggingStatus Buckets.member = Shapes::ShapeRef.new(shape: Bucket, location_name: "Bucket") CORSConfiguration.add_member(:cors_rules, Shapes::ShapeRef.new(shape: CORSRules, required: true, location_name: "CORSRule")) CORSConfiguration.struct_class = Types::CORSConfiguration CORSRule.add_member(:allowed_headers, Shapes::ShapeRef.new(shape: AllowedHeaders, location_name: "AllowedHeader")) CORSRule.add_member(:allowed_methods, Shapes::ShapeRef.new(shape: AllowedMethods, required: true, location_name: "AllowedMethod")) CORSRule.add_member(:allowed_origins, Shapes::ShapeRef.new(shape: AllowedOrigins, required: true, location_name: "AllowedOrigin")) CORSRule.add_member(:expose_headers, Shapes::ShapeRef.new(shape: ExposeHeaders, location_name: "ExposeHeader")) CORSRule.add_member(:max_age_seconds, Shapes::ShapeRef.new(shape: MaxAgeSeconds, location_name: "MaxAgeSeconds")) CORSRule.struct_class = Types::CORSRule CORSRules.member = Shapes::ShapeRef.new(shape: CORSRule) CSVInput.add_member(:file_header_info, Shapes::ShapeRef.new(shape: FileHeaderInfo, location_name: "FileHeaderInfo")) CSVInput.add_member(:comments, Shapes::ShapeRef.new(shape: Comments, location_name: "Comments")) CSVInput.add_member(:quote_escape_character, Shapes::ShapeRef.new(shape: QuoteEscapeCharacter, location_name: "QuoteEscapeCharacter")) CSVInput.add_member(:record_delimiter, Shapes::ShapeRef.new(shape: RecordDelimiter, location_name: "RecordDelimiter")) CSVInput.add_member(:field_delimiter, Shapes::ShapeRef.new(shape: FieldDelimiter, location_name: "FieldDelimiter")) CSVInput.add_member(:quote_character, Shapes::ShapeRef.new(shape: QuoteCharacter, location_name: "QuoteCharacter")) CSVInput.add_member(:allow_quoted_record_delimiter, Shapes::ShapeRef.new(shape: AllowQuotedRecordDelimiter, location_name: "AllowQuotedRecordDelimiter")) CSVInput.struct_class = Types::CSVInput CSVOutput.add_member(:quote_fields, Shapes::ShapeRef.new(shape: QuoteFields, location_name: "QuoteFields")) CSVOutput.add_member(:quote_escape_character, Shapes::ShapeRef.new(shape: QuoteEscapeCharacter, location_name: "QuoteEscapeCharacter")) CSVOutput.add_member(:record_delimiter, Shapes::ShapeRef.new(shape: RecordDelimiter, location_name: "RecordDelimiter")) CSVOutput.add_member(:field_delimiter, Shapes::ShapeRef.new(shape: FieldDelimiter, location_name: "FieldDelimiter")) CSVOutput.add_member(:quote_character, Shapes::ShapeRef.new(shape: QuoteCharacter, location_name: "QuoteCharacter")) CSVOutput.struct_class = Types::CSVOutput CloudFunctionConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: NotificationId, location_name: "Id")) CloudFunctionConfiguration.add_member(:event, Shapes::ShapeRef.new(shape: Event, deprecated: true, location_name: "Event")) CloudFunctionConfiguration.add_member(:events, Shapes::ShapeRef.new(shape: EventList, location_name: "Event")) CloudFunctionConfiguration.add_member(:cloud_function, Shapes::ShapeRef.new(shape: CloudFunction, location_name: "CloudFunction")) CloudFunctionConfiguration.add_member(:invocation_role, Shapes::ShapeRef.new(shape: CloudFunctionInvocationRole, location_name: "InvocationRole")) CloudFunctionConfiguration.struct_class = Types::CloudFunctionConfiguration CommonPrefix.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) CommonPrefix.struct_class = Types::CommonPrefix CommonPrefixList.member = Shapes::ShapeRef.new(shape: CommonPrefix) CompleteMultipartUploadOutput.add_member(:location, Shapes::ShapeRef.new(shape: Location, location_name: "Location")) CompleteMultipartUploadOutput.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, location_name: "Bucket")) CompleteMultipartUploadOutput.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) CompleteMultipartUploadOutput.add_member(:expiration, Shapes::ShapeRef.new(shape: Expiration, location: "header", location_name: "x-amz-expiration")) CompleteMultipartUploadOutput.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) CompleteMultipartUploadOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) CompleteMultipartUploadOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) CompleteMultipartUploadOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) CompleteMultipartUploadOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) CompleteMultipartUploadOutput.struct_class = Types::CompleteMultipartUploadOutput CompleteMultipartUploadRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) CompleteMultipartUploadRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) CompleteMultipartUploadRequest.add_member(:multipart_upload, Shapes::ShapeRef.new(shape: CompletedMultipartUpload, location_name: "CompleteMultipartUpload", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) CompleteMultipartUploadRequest.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, required: true, location: "querystring", location_name: "uploadId")) CompleteMultipartUploadRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) CompleteMultipartUploadRequest.struct_class = Types::CompleteMultipartUploadRequest CompleteMultipartUploadRequest[:payload] = :multipart_upload CompleteMultipartUploadRequest[:payload_member] = CompleteMultipartUploadRequest.member(:multipart_upload) CompletedMultipartUpload.add_member(:parts, Shapes::ShapeRef.new(shape: CompletedPartList, location_name: "Part")) CompletedMultipartUpload.struct_class = Types::CompletedMultipartUpload CompletedPart.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) CompletedPart.add_member(:part_number, Shapes::ShapeRef.new(shape: PartNumber, location_name: "PartNumber")) CompletedPart.struct_class = Types::CompletedPart CompletedPartList.member = Shapes::ShapeRef.new(shape: CompletedPart) Condition.add_member(:http_error_code_returned_equals, Shapes::ShapeRef.new(shape: HttpErrorCodeReturnedEquals, location_name: "HttpErrorCodeReturnedEquals")) Condition.add_member(:key_prefix_equals, Shapes::ShapeRef.new(shape: KeyPrefixEquals, location_name: "KeyPrefixEquals")) Condition.struct_class = Types::Condition ContinuationEvent.struct_class = Types::ContinuationEvent CopyObjectOutput.add_member(:copy_object_result, Shapes::ShapeRef.new(shape: CopyObjectResult, location_name: "CopyObjectResult")) CopyObjectOutput.add_member(:expiration, Shapes::ShapeRef.new(shape: Expiration, location: "header", location_name: "x-amz-expiration")) CopyObjectOutput.add_member(:copy_source_version_id, Shapes::ShapeRef.new(shape: CopySourceVersionId, location: "header", location_name: "x-amz-copy-source-version-id")) CopyObjectOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) CopyObjectOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) CopyObjectOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) CopyObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) CopyObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) CopyObjectOutput.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context")) CopyObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) CopyObjectOutput.struct_class = Types::CopyObjectOutput CopyObjectOutput[:payload] = :copy_object_result CopyObjectOutput[:payload_member] = CopyObjectOutput.member(:copy_object_result) CopyObjectRequest.add_member(:acl, Shapes::ShapeRef.new(shape: ObjectCannedACL, location: "header", location_name: "x-amz-acl")) CopyObjectRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) CopyObjectRequest.add_member(:cache_control, Shapes::ShapeRef.new(shape: CacheControl, location: "header", location_name: "Cache-Control")) CopyObjectRequest.add_member(:content_disposition, Shapes::ShapeRef.new(shape: ContentDisposition, location: "header", location_name: "Content-Disposition")) CopyObjectRequest.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "Content-Encoding")) CopyObjectRequest.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "Content-Language")) CopyObjectRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type")) CopyObjectRequest.add_member(:copy_source, Shapes::ShapeRef.new(shape: CopySource, required: true, location: "header", location_name: "x-amz-copy-source")) CopyObjectRequest.add_member(:copy_source_if_match, Shapes::ShapeRef.new(shape: CopySourceIfMatch, location: "header", location_name: "x-amz-copy-source-if-match")) CopyObjectRequest.add_member(:copy_source_if_modified_since, Shapes::ShapeRef.new(shape: CopySourceIfModifiedSince, location: "header", location_name: "x-amz-copy-source-if-modified-since")) CopyObjectRequest.add_member(:copy_source_if_none_match, Shapes::ShapeRef.new(shape: CopySourceIfNoneMatch, location: "header", location_name: "x-amz-copy-source-if-none-match")) CopyObjectRequest.add_member(:copy_source_if_unmodified_since, Shapes::ShapeRef.new(shape: CopySourceIfUnmodifiedSince, location: "header", location_name: "x-amz-copy-source-if-unmodified-since")) CopyObjectRequest.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "Expires")) CopyObjectRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control")) CopyObjectRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read")) CopyObjectRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp")) CopyObjectRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp")) CopyObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) CopyObjectRequest.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-")) CopyObjectRequest.add_member(:metadata_directive, Shapes::ShapeRef.new(shape: MetadataDirective, location: "header", location_name: "x-amz-metadata-directive")) CopyObjectRequest.add_member(:tagging_directive, Shapes::ShapeRef.new(shape: TaggingDirective, location: "header", location_name: "x-amz-tagging-directive")) CopyObjectRequest.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) CopyObjectRequest.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class")) CopyObjectRequest.add_member(:website_redirect_location, Shapes::ShapeRef.new(shape: WebsiteRedirectLocation, location: "header", location_name: "x-amz-website-redirect-location")) CopyObjectRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) CopyObjectRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) CopyObjectRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) CopyObjectRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) CopyObjectRequest.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context")) CopyObjectRequest.add_member(:copy_source_sse_customer_algorithm, Shapes::ShapeRef.new(shape: CopySourceSSECustomerAlgorithm, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-algorithm")) CopyObjectRequest.add_member(:copy_source_sse_customer_key, Shapes::ShapeRef.new(shape: CopySourceSSECustomerKey, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-key")) CopyObjectRequest.add_member(:copy_source_sse_customer_key_md5, Shapes::ShapeRef.new(shape: CopySourceSSECustomerKeyMD5, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-key-MD5")) CopyObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) CopyObjectRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: TaggingHeader, location: "header", location_name: "x-amz-tagging")) CopyObjectRequest.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode")) CopyObjectRequest.add_member(:object_lock_retain_until_date, Shapes::ShapeRef.new(shape: ObjectLockRetainUntilDate, location: "header", location_name: "x-amz-object-lock-retain-until-date")) CopyObjectRequest.add_member(:object_lock_legal_hold_status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location: "header", location_name: "x-amz-object-lock-legal-hold")) CopyObjectRequest.struct_class = Types::CopyObjectRequest CopyObjectResult.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) CopyObjectResult.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified")) CopyObjectResult.struct_class = Types::CopyObjectResult CopyPartResult.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) CopyPartResult.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified")) CopyPartResult.struct_class = Types::CopyPartResult CreateBucketConfiguration.add_member(:location_constraint, Shapes::ShapeRef.new(shape: BucketLocationConstraint, location_name: "LocationConstraint")) CreateBucketConfiguration.struct_class = Types::CreateBucketConfiguration CreateBucketOutput.add_member(:location, Shapes::ShapeRef.new(shape: Location, location: "header", location_name: "Location")) CreateBucketOutput.struct_class = Types::CreateBucketOutput CreateBucketRequest.add_member(:acl, Shapes::ShapeRef.new(shape: BucketCannedACL, location: "header", location_name: "x-amz-acl")) CreateBucketRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) CreateBucketRequest.add_member(:create_bucket_configuration, Shapes::ShapeRef.new(shape: CreateBucketConfiguration, location_name: "CreateBucketConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) CreateBucketRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control")) CreateBucketRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read")) CreateBucketRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp")) CreateBucketRequest.add_member(:grant_write, Shapes::ShapeRef.new(shape: GrantWrite, location: "header", location_name: "x-amz-grant-write")) CreateBucketRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp")) CreateBucketRequest.add_member(:object_lock_enabled_for_bucket, Shapes::ShapeRef.new(shape: ObjectLockEnabledForBucket, location: "header", location_name: "x-amz-bucket-object-lock-enabled")) CreateBucketRequest.struct_class = Types::CreateBucketRequest CreateBucketRequest[:payload] = :create_bucket_configuration CreateBucketRequest[:payload_member] = CreateBucketRequest.member(:create_bucket_configuration) CreateMultipartUploadOutput.add_member(:abort_date, Shapes::ShapeRef.new(shape: AbortDate, location: "header", location_name: "x-amz-abort-date")) CreateMultipartUploadOutput.add_member(:abort_rule_id, Shapes::ShapeRef.new(shape: AbortRuleId, location: "header", location_name: "x-amz-abort-rule-id")) CreateMultipartUploadOutput.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, location_name: "Bucket")) CreateMultipartUploadOutput.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) CreateMultipartUploadOutput.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, location_name: "UploadId")) CreateMultipartUploadOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) CreateMultipartUploadOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) CreateMultipartUploadOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) CreateMultipartUploadOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) CreateMultipartUploadOutput.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context")) CreateMultipartUploadOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) CreateMultipartUploadOutput.struct_class = Types::CreateMultipartUploadOutput CreateMultipartUploadRequest.add_member(:acl, Shapes::ShapeRef.new(shape: ObjectCannedACL, location: "header", location_name: "x-amz-acl")) CreateMultipartUploadRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) CreateMultipartUploadRequest.add_member(:cache_control, Shapes::ShapeRef.new(shape: CacheControl, location: "header", location_name: "Cache-Control")) CreateMultipartUploadRequest.add_member(:content_disposition, Shapes::ShapeRef.new(shape: ContentDisposition, location: "header", location_name: "Content-Disposition")) CreateMultipartUploadRequest.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "Content-Encoding")) CreateMultipartUploadRequest.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "Content-Language")) CreateMultipartUploadRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type")) CreateMultipartUploadRequest.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "Expires")) CreateMultipartUploadRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control")) CreateMultipartUploadRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read")) CreateMultipartUploadRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp")) CreateMultipartUploadRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp")) CreateMultipartUploadRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) CreateMultipartUploadRequest.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-")) CreateMultipartUploadRequest.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) CreateMultipartUploadRequest.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class")) CreateMultipartUploadRequest.add_member(:website_redirect_location, Shapes::ShapeRef.new(shape: WebsiteRedirectLocation, location: "header", location_name: "x-amz-website-redirect-location")) CreateMultipartUploadRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) CreateMultipartUploadRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) CreateMultipartUploadRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) CreateMultipartUploadRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) CreateMultipartUploadRequest.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context")) CreateMultipartUploadRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) CreateMultipartUploadRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: TaggingHeader, location: "header", location_name: "x-amz-tagging")) CreateMultipartUploadRequest.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode")) CreateMultipartUploadRequest.add_member(:object_lock_retain_until_date, Shapes::ShapeRef.new(shape: ObjectLockRetainUntilDate, location: "header", location_name: "x-amz-object-lock-retain-until-date")) CreateMultipartUploadRequest.add_member(:object_lock_legal_hold_status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location: "header", location_name: "x-amz-object-lock-legal-hold")) CreateMultipartUploadRequest.struct_class = Types::CreateMultipartUploadRequest DefaultRetention.add_member(:mode, Shapes::ShapeRef.new(shape: ObjectLockRetentionMode, location_name: "Mode")) DefaultRetention.add_member(:days, Shapes::ShapeRef.new(shape: Days, location_name: "Days")) DefaultRetention.add_member(:years, Shapes::ShapeRef.new(shape: Years, location_name: "Years")) DefaultRetention.struct_class = Types::DefaultRetention Delete.add_member(:objects, Shapes::ShapeRef.new(shape: ObjectIdentifierList, required: true, location_name: "Object")) Delete.add_member(:quiet, Shapes::ShapeRef.new(shape: Quiet, location_name: "Quiet")) Delete.struct_class = Types::Delete DeleteBucketAnalyticsConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketAnalyticsConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: AnalyticsId, required: true, location: "querystring", location_name: "id")) DeleteBucketAnalyticsConfigurationRequest.struct_class = Types::DeleteBucketAnalyticsConfigurationRequest DeleteBucketCorsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketCorsRequest.struct_class = Types::DeleteBucketCorsRequest DeleteBucketEncryptionRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketEncryptionRequest.struct_class = Types::DeleteBucketEncryptionRequest DeleteBucketInventoryConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketInventoryConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: InventoryId, required: true, location: "querystring", location_name: "id")) DeleteBucketInventoryConfigurationRequest.struct_class = Types::DeleteBucketInventoryConfigurationRequest DeleteBucketLifecycleRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketLifecycleRequest.struct_class = Types::DeleteBucketLifecycleRequest DeleteBucketMetricsConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketMetricsConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: MetricsId, required: true, location: "querystring", location_name: "id")) DeleteBucketMetricsConfigurationRequest.struct_class = Types::DeleteBucketMetricsConfigurationRequest DeleteBucketPolicyRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketPolicyRequest.struct_class = Types::DeleteBucketPolicyRequest DeleteBucketReplicationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketReplicationRequest.struct_class = Types::DeleteBucketReplicationRequest DeleteBucketRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketRequest.struct_class = Types::DeleteBucketRequest DeleteBucketTaggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketTaggingRequest.struct_class = Types::DeleteBucketTaggingRequest DeleteBucketWebsiteRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteBucketWebsiteRequest.struct_class = Types::DeleteBucketWebsiteRequest DeleteMarkerEntry.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) DeleteMarkerEntry.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) DeleteMarkerEntry.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location_name: "VersionId")) DeleteMarkerEntry.add_member(:is_latest, Shapes::ShapeRef.new(shape: IsLatest, location_name: "IsLatest")) DeleteMarkerEntry.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified")) DeleteMarkerEntry.struct_class = Types::DeleteMarkerEntry DeleteMarkerReplication.add_member(:status, Shapes::ShapeRef.new(shape: DeleteMarkerReplicationStatus, location_name: "Status")) DeleteMarkerReplication.struct_class = Types::DeleteMarkerReplication DeleteMarkers.member = Shapes::ShapeRef.new(shape: DeleteMarkerEntry) DeleteObjectOutput.add_member(:delete_marker, Shapes::ShapeRef.new(shape: DeleteMarker, location: "header", location_name: "x-amz-delete-marker")) DeleteObjectOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) DeleteObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) DeleteObjectOutput.struct_class = Types::DeleteObjectOutput DeleteObjectRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) DeleteObjectRequest.add_member(:mfa, Shapes::ShapeRef.new(shape: MFA, location: "header", location_name: "x-amz-mfa")) DeleteObjectRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) DeleteObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) DeleteObjectRequest.add_member(:bypass_governance_retention, Shapes::ShapeRef.new(shape: BypassGovernanceRetention, location: "header", location_name: "x-amz-bypass-governance-retention")) DeleteObjectRequest.struct_class = Types::DeleteObjectRequest DeleteObjectTaggingOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) DeleteObjectTaggingOutput.struct_class = Types::DeleteObjectTaggingOutput DeleteObjectTaggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteObjectTaggingRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) DeleteObjectTaggingRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) DeleteObjectTaggingRequest.struct_class = Types::DeleteObjectTaggingRequest DeleteObjectsOutput.add_member(:deleted, Shapes::ShapeRef.new(shape: DeletedObjects, location_name: "Deleted")) DeleteObjectsOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) DeleteObjectsOutput.add_member(:errors, Shapes::ShapeRef.new(shape: Errors, location_name: "Error")) DeleteObjectsOutput.struct_class = Types::DeleteObjectsOutput DeleteObjectsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeleteObjectsRequest.add_member(:delete, Shapes::ShapeRef.new(shape: Delete, required: true, location_name: "Delete", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) DeleteObjectsRequest.add_member(:mfa, Shapes::ShapeRef.new(shape: MFA, location: "header", location_name: "x-amz-mfa")) DeleteObjectsRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) DeleteObjectsRequest.add_member(:bypass_governance_retention, Shapes::ShapeRef.new(shape: BypassGovernanceRetention, location: "header", location_name: "x-amz-bypass-governance-retention")) DeleteObjectsRequest.struct_class = Types::DeleteObjectsRequest DeleteObjectsRequest[:payload] = :delete DeleteObjectsRequest[:payload_member] = DeleteObjectsRequest.member(:delete) DeletePublicAccessBlockRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) DeletePublicAccessBlockRequest.struct_class = Types::DeletePublicAccessBlockRequest DeletedObject.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) DeletedObject.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location_name: "VersionId")) DeletedObject.add_member(:delete_marker, Shapes::ShapeRef.new(shape: DeleteMarker, location_name: "DeleteMarker")) DeletedObject.add_member(:delete_marker_version_id, Shapes::ShapeRef.new(shape: DeleteMarkerVersionId, location_name: "DeleteMarkerVersionId")) DeletedObject.struct_class = Types::DeletedObject DeletedObjects.member = Shapes::ShapeRef.new(shape: DeletedObject) Destination.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location_name: "Bucket")) Destination.add_member(:account, Shapes::ShapeRef.new(shape: AccountId, location_name: "Account")) Destination.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location_name: "StorageClass")) Destination.add_member(:access_control_translation, Shapes::ShapeRef.new(shape: AccessControlTranslation, location_name: "AccessControlTranslation")) Destination.add_member(:encryption_configuration, Shapes::ShapeRef.new(shape: EncryptionConfiguration, location_name: "EncryptionConfiguration")) Destination.struct_class = Types::Destination Encryption.add_member(:encryption_type, Shapes::ShapeRef.new(shape: ServerSideEncryption, required: true, location_name: "EncryptionType")) Encryption.add_member(:kms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location_name: "KMSKeyId")) Encryption.add_member(:kms_context, Shapes::ShapeRef.new(shape: KMSContext, location_name: "KMSContext")) Encryption.struct_class = Types::Encryption EncryptionConfiguration.add_member(:replica_kms_key_id, Shapes::ShapeRef.new(shape: ReplicaKmsKeyID, location_name: "ReplicaKmsKeyID")) EncryptionConfiguration.struct_class = Types::EncryptionConfiguration EndEvent.struct_class = Types::EndEvent Error.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) Error.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location_name: "VersionId")) Error.add_member(:code, Shapes::ShapeRef.new(shape: Code, location_name: "Code")) Error.add_member(:message, Shapes::ShapeRef.new(shape: Message, location_name: "Message")) Error.struct_class = Types::Error ErrorDocument.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location_name: "Key")) ErrorDocument.struct_class = Types::ErrorDocument Errors.member = Shapes::ShapeRef.new(shape: Error) EventList.member = Shapes::ShapeRef.new(shape: Event) ExposeHeaders.member = Shapes::ShapeRef.new(shape: ExposeHeader) FilterRule.add_member(:name, Shapes::ShapeRef.new(shape: FilterRuleName, location_name: "Name")) FilterRule.add_member(:value, Shapes::ShapeRef.new(shape: FilterRuleValue, location_name: "Value")) FilterRule.struct_class = Types::FilterRule FilterRuleList.member = Shapes::ShapeRef.new(shape: FilterRule) GetBucketAccelerateConfigurationOutput.add_member(:status, Shapes::ShapeRef.new(shape: BucketAccelerateStatus, location_name: "Status")) GetBucketAccelerateConfigurationOutput.struct_class = Types::GetBucketAccelerateConfigurationOutput GetBucketAccelerateConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketAccelerateConfigurationRequest.struct_class = Types::GetBucketAccelerateConfigurationRequest GetBucketAclOutput.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) GetBucketAclOutput.add_member(:grants, Shapes::ShapeRef.new(shape: Grants, location_name: "AccessControlList")) GetBucketAclOutput.struct_class = Types::GetBucketAclOutput GetBucketAclRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketAclRequest.struct_class = Types::GetBucketAclRequest GetBucketAnalyticsConfigurationOutput.add_member(:analytics_configuration, Shapes::ShapeRef.new(shape: AnalyticsConfiguration, location_name: "AnalyticsConfiguration")) GetBucketAnalyticsConfigurationOutput.struct_class = Types::GetBucketAnalyticsConfigurationOutput GetBucketAnalyticsConfigurationOutput[:payload] = :analytics_configuration GetBucketAnalyticsConfigurationOutput[:payload_member] = GetBucketAnalyticsConfigurationOutput.member(:analytics_configuration) GetBucketAnalyticsConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketAnalyticsConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: AnalyticsId, required: true, location: "querystring", location_name: "id")) GetBucketAnalyticsConfigurationRequest.struct_class = Types::GetBucketAnalyticsConfigurationRequest GetBucketCorsOutput.add_member(:cors_rules, Shapes::ShapeRef.new(shape: CORSRules, location_name: "CORSRule")) GetBucketCorsOutput.struct_class = Types::GetBucketCorsOutput GetBucketCorsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketCorsRequest.struct_class = Types::GetBucketCorsRequest GetBucketEncryptionOutput.add_member(:server_side_encryption_configuration, Shapes::ShapeRef.new(shape: ServerSideEncryptionConfiguration, location_name: "ServerSideEncryptionConfiguration")) GetBucketEncryptionOutput.struct_class = Types::GetBucketEncryptionOutput GetBucketEncryptionOutput[:payload] = :server_side_encryption_configuration GetBucketEncryptionOutput[:payload_member] = GetBucketEncryptionOutput.member(:server_side_encryption_configuration) GetBucketEncryptionRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketEncryptionRequest.struct_class = Types::GetBucketEncryptionRequest GetBucketInventoryConfigurationOutput.add_member(:inventory_configuration, Shapes::ShapeRef.new(shape: InventoryConfiguration, location_name: "InventoryConfiguration")) GetBucketInventoryConfigurationOutput.struct_class = Types::GetBucketInventoryConfigurationOutput GetBucketInventoryConfigurationOutput[:payload] = :inventory_configuration GetBucketInventoryConfigurationOutput[:payload_member] = GetBucketInventoryConfigurationOutput.member(:inventory_configuration) GetBucketInventoryConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketInventoryConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: InventoryId, required: true, location: "querystring", location_name: "id")) GetBucketInventoryConfigurationRequest.struct_class = Types::GetBucketInventoryConfigurationRequest GetBucketLifecycleConfigurationOutput.add_member(:rules, Shapes::ShapeRef.new(shape: LifecycleRules, location_name: "Rule")) GetBucketLifecycleConfigurationOutput.struct_class = Types::GetBucketLifecycleConfigurationOutput GetBucketLifecycleConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketLifecycleConfigurationRequest.struct_class = Types::GetBucketLifecycleConfigurationRequest GetBucketLifecycleOutput.add_member(:rules, Shapes::ShapeRef.new(shape: Rules, location_name: "Rule")) GetBucketLifecycleOutput.struct_class = Types::GetBucketLifecycleOutput GetBucketLifecycleRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketLifecycleRequest.struct_class = Types::GetBucketLifecycleRequest GetBucketLocationOutput.add_member(:location_constraint, Shapes::ShapeRef.new(shape: BucketLocationConstraint, location_name: "LocationConstraint")) GetBucketLocationOutput.struct_class = Types::GetBucketLocationOutput GetBucketLocationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketLocationRequest.struct_class = Types::GetBucketLocationRequest GetBucketLoggingOutput.add_member(:logging_enabled, Shapes::ShapeRef.new(shape: LoggingEnabled, location_name: "LoggingEnabled")) GetBucketLoggingOutput.struct_class = Types::GetBucketLoggingOutput GetBucketLoggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketLoggingRequest.struct_class = Types::GetBucketLoggingRequest GetBucketMetricsConfigurationOutput.add_member(:metrics_configuration, Shapes::ShapeRef.new(shape: MetricsConfiguration, location_name: "MetricsConfiguration")) GetBucketMetricsConfigurationOutput.struct_class = Types::GetBucketMetricsConfigurationOutput GetBucketMetricsConfigurationOutput[:payload] = :metrics_configuration GetBucketMetricsConfigurationOutput[:payload_member] = GetBucketMetricsConfigurationOutput.member(:metrics_configuration) GetBucketMetricsConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketMetricsConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: MetricsId, required: true, location: "querystring", location_name: "id")) GetBucketMetricsConfigurationRequest.struct_class = Types::GetBucketMetricsConfigurationRequest GetBucketNotificationConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketNotificationConfigurationRequest.struct_class = Types::GetBucketNotificationConfigurationRequest GetBucketPolicyOutput.add_member(:policy, Shapes::ShapeRef.new(shape: Policy, location_name: "Policy")) GetBucketPolicyOutput.struct_class = Types::GetBucketPolicyOutput GetBucketPolicyOutput[:payload] = :policy GetBucketPolicyOutput[:payload_member] = GetBucketPolicyOutput.member(:policy) GetBucketPolicyRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketPolicyRequest.struct_class = Types::GetBucketPolicyRequest GetBucketPolicyStatusOutput.add_member(:policy_status, Shapes::ShapeRef.new(shape: PolicyStatus, location_name: "PolicyStatus")) GetBucketPolicyStatusOutput.struct_class = Types::GetBucketPolicyStatusOutput GetBucketPolicyStatusOutput[:payload] = :policy_status GetBucketPolicyStatusOutput[:payload_member] = GetBucketPolicyStatusOutput.member(:policy_status) GetBucketPolicyStatusRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketPolicyStatusRequest.struct_class = Types::GetBucketPolicyStatusRequest GetBucketReplicationOutput.add_member(:replication_configuration, Shapes::ShapeRef.new(shape: ReplicationConfiguration, location_name: "ReplicationConfiguration")) GetBucketReplicationOutput.struct_class = Types::GetBucketReplicationOutput GetBucketReplicationOutput[:payload] = :replication_configuration GetBucketReplicationOutput[:payload_member] = GetBucketReplicationOutput.member(:replication_configuration) GetBucketReplicationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketReplicationRequest.struct_class = Types::GetBucketReplicationRequest GetBucketRequestPaymentOutput.add_member(:payer, Shapes::ShapeRef.new(shape: Payer, location_name: "Payer")) GetBucketRequestPaymentOutput.struct_class = Types::GetBucketRequestPaymentOutput GetBucketRequestPaymentRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketRequestPaymentRequest.struct_class = Types::GetBucketRequestPaymentRequest GetBucketTaggingOutput.add_member(:tag_set, Shapes::ShapeRef.new(shape: TagSet, required: true, location_name: "TagSet")) GetBucketTaggingOutput.struct_class = Types::GetBucketTaggingOutput GetBucketTaggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketTaggingRequest.struct_class = Types::GetBucketTaggingRequest GetBucketVersioningOutput.add_member(:status, Shapes::ShapeRef.new(shape: BucketVersioningStatus, location_name: "Status")) GetBucketVersioningOutput.add_member(:mfa_delete, Shapes::ShapeRef.new(shape: MFADeleteStatus, location_name: "MfaDelete")) GetBucketVersioningOutput.struct_class = Types::GetBucketVersioningOutput GetBucketVersioningRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketVersioningRequest.struct_class = Types::GetBucketVersioningRequest GetBucketWebsiteOutput.add_member(:redirect_all_requests_to, Shapes::ShapeRef.new(shape: RedirectAllRequestsTo, location_name: "RedirectAllRequestsTo")) GetBucketWebsiteOutput.add_member(:index_document, Shapes::ShapeRef.new(shape: IndexDocument, location_name: "IndexDocument")) GetBucketWebsiteOutput.add_member(:error_document, Shapes::ShapeRef.new(shape: ErrorDocument, location_name: "ErrorDocument")) GetBucketWebsiteOutput.add_member(:routing_rules, Shapes::ShapeRef.new(shape: RoutingRules, location_name: "RoutingRules")) GetBucketWebsiteOutput.struct_class = Types::GetBucketWebsiteOutput GetBucketWebsiteRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetBucketWebsiteRequest.struct_class = Types::GetBucketWebsiteRequest GetObjectAclOutput.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) GetObjectAclOutput.add_member(:grants, Shapes::ShapeRef.new(shape: Grants, location_name: "AccessControlList")) GetObjectAclOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) GetObjectAclOutput.struct_class = Types::GetObjectAclOutput GetObjectAclRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectAclRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) GetObjectAclRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) GetObjectAclRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) GetObjectAclRequest.struct_class = Types::GetObjectAclRequest GetObjectLegalHoldOutput.add_member(:legal_hold, Shapes::ShapeRef.new(shape: ObjectLockLegalHold, location_name: "LegalHold")) GetObjectLegalHoldOutput.struct_class = Types::GetObjectLegalHoldOutput GetObjectLegalHoldOutput[:payload] = :legal_hold GetObjectLegalHoldOutput[:payload_member] = GetObjectLegalHoldOutput.member(:legal_hold) GetObjectLegalHoldRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectLegalHoldRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) GetObjectLegalHoldRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) GetObjectLegalHoldRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) GetObjectLegalHoldRequest.struct_class = Types::GetObjectLegalHoldRequest GetObjectLockConfigurationOutput.add_member(:object_lock_configuration, Shapes::ShapeRef.new(shape: ObjectLockConfiguration, location_name: "ObjectLockConfiguration")) GetObjectLockConfigurationOutput.struct_class = Types::GetObjectLockConfigurationOutput GetObjectLockConfigurationOutput[:payload] = :object_lock_configuration GetObjectLockConfigurationOutput[:payload_member] = GetObjectLockConfigurationOutput.member(:object_lock_configuration) GetObjectLockConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectLockConfigurationRequest.struct_class = Types::GetObjectLockConfigurationRequest GetObjectOutput.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "Body", metadata: {"streaming"=>true})) GetObjectOutput.add_member(:delete_marker, Shapes::ShapeRef.new(shape: DeleteMarker, location: "header", location_name: "x-amz-delete-marker")) GetObjectOutput.add_member(:accept_ranges, Shapes::ShapeRef.new(shape: AcceptRanges, location: "header", location_name: "accept-ranges")) GetObjectOutput.add_member(:expiration, Shapes::ShapeRef.new(shape: Expiration, location: "header", location_name: "x-amz-expiration")) GetObjectOutput.add_member(:restore, Shapes::ShapeRef.new(shape: Restore, location: "header", location_name: "x-amz-restore")) GetObjectOutput.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location: "header", location_name: "Last-Modified")) GetObjectOutput.add_member(:content_length, Shapes::ShapeRef.new(shape: ContentLength, location: "header", location_name: "Content-Length")) GetObjectOutput.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location: "header", location_name: "ETag")) GetObjectOutput.add_member(:missing_meta, Shapes::ShapeRef.new(shape: MissingMeta, location: "header", location_name: "x-amz-missing-meta")) GetObjectOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) GetObjectOutput.add_member(:cache_control, Shapes::ShapeRef.new(shape: CacheControl, location: "header", location_name: "Cache-Control")) GetObjectOutput.add_member(:content_disposition, Shapes::ShapeRef.new(shape: ContentDisposition, location: "header", location_name: "Content-Disposition")) GetObjectOutput.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "Content-Encoding")) GetObjectOutput.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "Content-Language")) GetObjectOutput.add_member(:content_range, Shapes::ShapeRef.new(shape: ContentRange, location: "header", location_name: "Content-Range")) GetObjectOutput.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type")) GetObjectOutput.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "Expires")) GetObjectOutput.add_member(:expires_string, Shapes::ShapeRef.new(shape: ExpiresString, location: "header", location_name: "Expires")) GetObjectOutput.add_member(:website_redirect_location, Shapes::ShapeRef.new(shape: WebsiteRedirectLocation, location: "header", location_name: "x-amz-website-redirect-location")) GetObjectOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) GetObjectOutput.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-")) GetObjectOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) GetObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) GetObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) GetObjectOutput.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class")) GetObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) GetObjectOutput.add_member(:replication_status, Shapes::ShapeRef.new(shape: ReplicationStatus, location: "header", location_name: "x-amz-replication-status")) GetObjectOutput.add_member(:parts_count, Shapes::ShapeRef.new(shape: PartsCount, location: "header", location_name: "x-amz-mp-parts-count")) GetObjectOutput.add_member(:tag_count, Shapes::ShapeRef.new(shape: TagCount, location: "header", location_name: "x-amz-tagging-count")) GetObjectOutput.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode")) GetObjectOutput.add_member(:object_lock_retain_until_date, Shapes::ShapeRef.new(shape: ObjectLockRetainUntilDate, location: "header", location_name: "x-amz-object-lock-retain-until-date")) GetObjectOutput.add_member(:object_lock_legal_hold_status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location: "header", location_name: "x-amz-object-lock-legal-hold")) GetObjectOutput.struct_class = Types::GetObjectOutput GetObjectOutput[:payload] = :body GetObjectOutput[:payload_member] = GetObjectOutput.member(:body) GetObjectRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: IfMatch, location: "header", location_name: "If-Match")) GetObjectRequest.add_member(:if_modified_since, Shapes::ShapeRef.new(shape: IfModifiedSince, location: "header", location_name: "If-Modified-Since")) GetObjectRequest.add_member(:if_none_match, Shapes::ShapeRef.new(shape: IfNoneMatch, location: "header", location_name: "If-None-Match")) GetObjectRequest.add_member(:if_unmodified_since, Shapes::ShapeRef.new(shape: IfUnmodifiedSince, location: "header", location_name: "If-Unmodified-Since")) GetObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) GetObjectRequest.add_member(:range, Shapes::ShapeRef.new(shape: Range, location: "header", location_name: "Range")) GetObjectRequest.add_member(:response_cache_control, Shapes::ShapeRef.new(shape: ResponseCacheControl, location: "querystring", location_name: "response-cache-control")) GetObjectRequest.add_member(:response_content_disposition, Shapes::ShapeRef.new(shape: ResponseContentDisposition, location: "querystring", location_name: "response-content-disposition")) GetObjectRequest.add_member(:response_content_encoding, Shapes::ShapeRef.new(shape: ResponseContentEncoding, location: "querystring", location_name: "response-content-encoding")) GetObjectRequest.add_member(:response_content_language, Shapes::ShapeRef.new(shape: ResponseContentLanguage, location: "querystring", location_name: "response-content-language")) GetObjectRequest.add_member(:response_content_type, Shapes::ShapeRef.new(shape: ResponseContentType, location: "querystring", location_name: "response-content-type")) GetObjectRequest.add_member(:response_expires, Shapes::ShapeRef.new(shape: ResponseExpires, location: "querystring", location_name: "response-expires")) GetObjectRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) GetObjectRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) GetObjectRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) GetObjectRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) GetObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) GetObjectRequest.add_member(:part_number, Shapes::ShapeRef.new(shape: PartNumber, location: "querystring", location_name: "partNumber")) GetObjectRequest.struct_class = Types::GetObjectRequest GetObjectRetentionOutput.add_member(:retention, Shapes::ShapeRef.new(shape: ObjectLockRetention, location_name: "Retention")) GetObjectRetentionOutput.struct_class = Types::GetObjectRetentionOutput GetObjectRetentionOutput[:payload] = :retention GetObjectRetentionOutput[:payload_member] = GetObjectRetentionOutput.member(:retention) GetObjectRetentionRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectRetentionRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) GetObjectRetentionRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) GetObjectRetentionRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) GetObjectRetentionRequest.struct_class = Types::GetObjectRetentionRequest GetObjectTaggingOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) GetObjectTaggingOutput.add_member(:tag_set, Shapes::ShapeRef.new(shape: TagSet, required: true, location_name: "TagSet")) GetObjectTaggingOutput.struct_class = Types::GetObjectTaggingOutput GetObjectTaggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectTaggingRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) GetObjectTaggingRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) GetObjectTaggingRequest.struct_class = Types::GetObjectTaggingRequest GetObjectTorrentOutput.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "Body", metadata: {"streaming"=>true})) GetObjectTorrentOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) GetObjectTorrentOutput.struct_class = Types::GetObjectTorrentOutput GetObjectTorrentOutput[:payload] = :body GetObjectTorrentOutput[:payload_member] = GetObjectTorrentOutput.member(:body) GetObjectTorrentRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetObjectTorrentRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) GetObjectTorrentRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) GetObjectTorrentRequest.struct_class = Types::GetObjectTorrentRequest GetPublicAccessBlockOutput.add_member(:public_access_block_configuration, Shapes::ShapeRef.new(shape: PublicAccessBlockConfiguration, location_name: "PublicAccessBlockConfiguration")) GetPublicAccessBlockOutput.struct_class = Types::GetPublicAccessBlockOutput GetPublicAccessBlockOutput[:payload] = :public_access_block_configuration GetPublicAccessBlockOutput[:payload_member] = GetPublicAccessBlockOutput.member(:public_access_block_configuration) GetPublicAccessBlockRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) GetPublicAccessBlockRequest.struct_class = Types::GetPublicAccessBlockRequest GlacierJobParameters.add_member(:tier, Shapes::ShapeRef.new(shape: Tier, required: true, location_name: "Tier")) GlacierJobParameters.struct_class = Types::GlacierJobParameters Grant.add_member(:grantee, Shapes::ShapeRef.new(shape: Grantee, location_name: "Grantee")) Grant.add_member(:permission, Shapes::ShapeRef.new(shape: Permission, location_name: "Permission")) Grant.struct_class = Types::Grant Grantee.add_member(:display_name, Shapes::ShapeRef.new(shape: DisplayName, location_name: "DisplayName")) Grantee.add_member(:email_address, Shapes::ShapeRef.new(shape: EmailAddress, location_name: "EmailAddress")) Grantee.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID")) Grantee.add_member(:type, Shapes::ShapeRef.new(shape: Type, required: true, location_name: "xsi:type", metadata: {"xmlAttribute"=>true})) Grantee.add_member(:uri, Shapes::ShapeRef.new(shape: URI, location_name: "URI")) Grantee.struct_class = Types::Grantee Grants.member = Shapes::ShapeRef.new(shape: Grant, location_name: "Grant") HeadBucketRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) HeadBucketRequest.struct_class = Types::HeadBucketRequest HeadObjectOutput.add_member(:delete_marker, Shapes::ShapeRef.new(shape: DeleteMarker, location: "header", location_name: "x-amz-delete-marker")) HeadObjectOutput.add_member(:accept_ranges, Shapes::ShapeRef.new(shape: AcceptRanges, location: "header", location_name: "accept-ranges")) HeadObjectOutput.add_member(:expiration, Shapes::ShapeRef.new(shape: Expiration, location: "header", location_name: "x-amz-expiration")) HeadObjectOutput.add_member(:restore, Shapes::ShapeRef.new(shape: Restore, location: "header", location_name: "x-amz-restore")) HeadObjectOutput.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location: "header", location_name: "Last-Modified")) HeadObjectOutput.add_member(:content_length, Shapes::ShapeRef.new(shape: ContentLength, location: "header", location_name: "Content-Length")) HeadObjectOutput.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location: "header", location_name: "ETag")) HeadObjectOutput.add_member(:missing_meta, Shapes::ShapeRef.new(shape: MissingMeta, location: "header", location_name: "x-amz-missing-meta")) HeadObjectOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) HeadObjectOutput.add_member(:cache_control, Shapes::ShapeRef.new(shape: CacheControl, location: "header", location_name: "Cache-Control")) HeadObjectOutput.add_member(:content_disposition, Shapes::ShapeRef.new(shape: ContentDisposition, location: "header", location_name: "Content-Disposition")) HeadObjectOutput.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "Content-Encoding")) HeadObjectOutput.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "Content-Language")) HeadObjectOutput.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type")) HeadObjectOutput.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "Expires")) HeadObjectOutput.add_member(:expires_string, Shapes::ShapeRef.new(shape: ExpiresString, location: "header", location_name: "Expires")) HeadObjectOutput.add_member(:website_redirect_location, Shapes::ShapeRef.new(shape: WebsiteRedirectLocation, location: "header", location_name: "x-amz-website-redirect-location")) HeadObjectOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) HeadObjectOutput.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-")) HeadObjectOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) HeadObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) HeadObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) HeadObjectOutput.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class")) HeadObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) HeadObjectOutput.add_member(:replication_status, Shapes::ShapeRef.new(shape: ReplicationStatus, location: "header", location_name: "x-amz-replication-status")) HeadObjectOutput.add_member(:parts_count, Shapes::ShapeRef.new(shape: PartsCount, location: "header", location_name: "x-amz-mp-parts-count")) HeadObjectOutput.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode")) HeadObjectOutput.add_member(:object_lock_retain_until_date, Shapes::ShapeRef.new(shape: ObjectLockRetainUntilDate, location: "header", location_name: "x-amz-object-lock-retain-until-date")) HeadObjectOutput.add_member(:object_lock_legal_hold_status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location: "header", location_name: "x-amz-object-lock-legal-hold")) HeadObjectOutput.struct_class = Types::HeadObjectOutput HeadObjectRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) HeadObjectRequest.add_member(:if_match, Shapes::ShapeRef.new(shape: IfMatch, location: "header", location_name: "If-Match")) HeadObjectRequest.add_member(:if_modified_since, Shapes::ShapeRef.new(shape: IfModifiedSince, location: "header", location_name: "If-Modified-Since")) HeadObjectRequest.add_member(:if_none_match, Shapes::ShapeRef.new(shape: IfNoneMatch, location: "header", location_name: "If-None-Match")) HeadObjectRequest.add_member(:if_unmodified_since, Shapes::ShapeRef.new(shape: IfUnmodifiedSince, location: "header", location_name: "If-Unmodified-Since")) HeadObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) HeadObjectRequest.add_member(:range, Shapes::ShapeRef.new(shape: Range, location: "header", location_name: "Range")) HeadObjectRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) HeadObjectRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) HeadObjectRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) HeadObjectRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) HeadObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) HeadObjectRequest.add_member(:part_number, Shapes::ShapeRef.new(shape: PartNumber, location: "querystring", location_name: "partNumber")) HeadObjectRequest.struct_class = Types::HeadObjectRequest IndexDocument.add_member(:suffix, Shapes::ShapeRef.new(shape: Suffix, required: true, location_name: "Suffix")) IndexDocument.struct_class = Types::IndexDocument Initiator.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID")) Initiator.add_member(:display_name, Shapes::ShapeRef.new(shape: DisplayName, location_name: "DisplayName")) Initiator.struct_class = Types::Initiator InputSerialization.add_member(:csv, Shapes::ShapeRef.new(shape: CSVInput, location_name: "CSV")) InputSerialization.add_member(:compression_type, Shapes::ShapeRef.new(shape: CompressionType, location_name: "CompressionType")) InputSerialization.add_member(:json, Shapes::ShapeRef.new(shape: JSONInput, location_name: "JSON")) InputSerialization.add_member(:parquet, Shapes::ShapeRef.new(shape: ParquetInput, location_name: "Parquet")) InputSerialization.struct_class = Types::InputSerialization InventoryConfiguration.add_member(:destination, Shapes::ShapeRef.new(shape: InventoryDestination, required: true, location_name: "Destination")) InventoryConfiguration.add_member(:is_enabled, Shapes::ShapeRef.new(shape: IsEnabled, required: true, location_name: "IsEnabled")) InventoryConfiguration.add_member(:filter, Shapes::ShapeRef.new(shape: InventoryFilter, location_name: "Filter")) InventoryConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: InventoryId, required: true, location_name: "Id")) InventoryConfiguration.add_member(:included_object_versions, Shapes::ShapeRef.new(shape: InventoryIncludedObjectVersions, required: true, location_name: "IncludedObjectVersions")) InventoryConfiguration.add_member(:optional_fields, Shapes::ShapeRef.new(shape: InventoryOptionalFields, location_name: "OptionalFields")) InventoryConfiguration.add_member(:schedule, Shapes::ShapeRef.new(shape: InventorySchedule, required: true, location_name: "Schedule")) InventoryConfiguration.struct_class = Types::InventoryConfiguration InventoryConfigurationList.member = Shapes::ShapeRef.new(shape: InventoryConfiguration) InventoryDestination.add_member(:s3_bucket_destination, Shapes::ShapeRef.new(shape: InventoryS3BucketDestination, required: true, location_name: "S3BucketDestination")) InventoryDestination.struct_class = Types::InventoryDestination InventoryEncryption.add_member(:sses3, Shapes::ShapeRef.new(shape: SSES3, location_name: "SSE-S3")) InventoryEncryption.add_member(:ssekms, Shapes::ShapeRef.new(shape: SSEKMS, location_name: "SSE-KMS")) InventoryEncryption.struct_class = Types::InventoryEncryption InventoryFilter.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, required: true, location_name: "Prefix")) InventoryFilter.struct_class = Types::InventoryFilter InventoryOptionalFields.member = Shapes::ShapeRef.new(shape: InventoryOptionalField, location_name: "Field") InventoryS3BucketDestination.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId")) InventoryS3BucketDestination.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location_name: "Bucket")) InventoryS3BucketDestination.add_member(:format, Shapes::ShapeRef.new(shape: InventoryFormat, required: true, location_name: "Format")) InventoryS3BucketDestination.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) InventoryS3BucketDestination.add_member(:encryption, Shapes::ShapeRef.new(shape: InventoryEncryption, location_name: "Encryption")) InventoryS3BucketDestination.struct_class = Types::InventoryS3BucketDestination InventorySchedule.add_member(:frequency, Shapes::ShapeRef.new(shape: InventoryFrequency, required: true, location_name: "Frequency")) InventorySchedule.struct_class = Types::InventorySchedule JSONInput.add_member(:type, Shapes::ShapeRef.new(shape: JSONType, location_name: "Type")) JSONInput.struct_class = Types::JSONInput JSONOutput.add_member(:record_delimiter, Shapes::ShapeRef.new(shape: RecordDelimiter, location_name: "RecordDelimiter")) JSONOutput.struct_class = Types::JSONOutput LambdaFunctionConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: NotificationId, location_name: "Id")) LambdaFunctionConfiguration.add_member(:lambda_function_arn, Shapes::ShapeRef.new(shape: LambdaFunctionArn, required: true, location_name: "CloudFunction")) LambdaFunctionConfiguration.add_member(:events, Shapes::ShapeRef.new(shape: EventList, required: true, location_name: "Event")) LambdaFunctionConfiguration.add_member(:filter, Shapes::ShapeRef.new(shape: NotificationConfigurationFilter, location_name: "Filter")) LambdaFunctionConfiguration.struct_class = Types::LambdaFunctionConfiguration LambdaFunctionConfigurationList.member = Shapes::ShapeRef.new(shape: LambdaFunctionConfiguration) LifecycleConfiguration.add_member(:rules, Shapes::ShapeRef.new(shape: Rules, required: true, location_name: "Rule")) LifecycleConfiguration.struct_class = Types::LifecycleConfiguration LifecycleExpiration.add_member(:date, Shapes::ShapeRef.new(shape: Date, location_name: "Date")) LifecycleExpiration.add_member(:days, Shapes::ShapeRef.new(shape: Days, location_name: "Days")) LifecycleExpiration.add_member(:expired_object_delete_marker, Shapes::ShapeRef.new(shape: ExpiredObjectDeleteMarker, location_name: "ExpiredObjectDeleteMarker")) LifecycleExpiration.struct_class = Types::LifecycleExpiration LifecycleRule.add_member(:expiration, Shapes::ShapeRef.new(shape: LifecycleExpiration, location_name: "Expiration")) LifecycleRule.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID")) LifecycleRule.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, deprecated: true, location_name: "Prefix")) LifecycleRule.add_member(:filter, Shapes::ShapeRef.new(shape: LifecycleRuleFilter, location_name: "Filter")) LifecycleRule.add_member(:status, Shapes::ShapeRef.new(shape: ExpirationStatus, required: true, location_name: "Status")) LifecycleRule.add_member(:transitions, Shapes::ShapeRef.new(shape: TransitionList, location_name: "Transition")) LifecycleRule.add_member(:noncurrent_version_transitions, Shapes::ShapeRef.new(shape: NoncurrentVersionTransitionList, location_name: "NoncurrentVersionTransition")) LifecycleRule.add_member(:noncurrent_version_expiration, Shapes::ShapeRef.new(shape: NoncurrentVersionExpiration, location_name: "NoncurrentVersionExpiration")) LifecycleRule.add_member(:abort_incomplete_multipart_upload, Shapes::ShapeRef.new(shape: AbortIncompleteMultipartUpload, location_name: "AbortIncompleteMultipartUpload")) LifecycleRule.struct_class = Types::LifecycleRule LifecycleRuleAndOperator.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) LifecycleRuleAndOperator.add_member(:tags, Shapes::ShapeRef.new(shape: TagSet, location_name: "Tag", metadata: {"flattened"=>true})) LifecycleRuleAndOperator.struct_class = Types::LifecycleRuleAndOperator LifecycleRuleFilter.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) LifecycleRuleFilter.add_member(:tag, Shapes::ShapeRef.new(shape: Tag, location_name: "Tag")) LifecycleRuleFilter.add_member(:and, Shapes::ShapeRef.new(shape: LifecycleRuleAndOperator, location_name: "And")) LifecycleRuleFilter.struct_class = Types::LifecycleRuleFilter LifecycleRules.member = Shapes::ShapeRef.new(shape: LifecycleRule) ListBucketAnalyticsConfigurationsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListBucketAnalyticsConfigurationsOutput.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location_name: "ContinuationToken")) ListBucketAnalyticsConfigurationsOutput.add_member(:next_continuation_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextContinuationToken")) ListBucketAnalyticsConfigurationsOutput.add_member(:analytics_configuration_list, Shapes::ShapeRef.new(shape: AnalyticsConfigurationList, location_name: "AnalyticsConfiguration")) ListBucketAnalyticsConfigurationsOutput.struct_class = Types::ListBucketAnalyticsConfigurationsOutput ListBucketAnalyticsConfigurationsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListBucketAnalyticsConfigurationsRequest.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location: "querystring", location_name: "continuation-token")) ListBucketAnalyticsConfigurationsRequest.struct_class = Types::ListBucketAnalyticsConfigurationsRequest ListBucketInventoryConfigurationsOutput.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location_name: "ContinuationToken")) ListBucketInventoryConfigurationsOutput.add_member(:inventory_configuration_list, Shapes::ShapeRef.new(shape: InventoryConfigurationList, location_name: "InventoryConfiguration")) ListBucketInventoryConfigurationsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListBucketInventoryConfigurationsOutput.add_member(:next_continuation_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextContinuationToken")) ListBucketInventoryConfigurationsOutput.struct_class = Types::ListBucketInventoryConfigurationsOutput ListBucketInventoryConfigurationsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListBucketInventoryConfigurationsRequest.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location: "querystring", location_name: "continuation-token")) ListBucketInventoryConfigurationsRequest.struct_class = Types::ListBucketInventoryConfigurationsRequest ListBucketMetricsConfigurationsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListBucketMetricsConfigurationsOutput.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location_name: "ContinuationToken")) ListBucketMetricsConfigurationsOutput.add_member(:next_continuation_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextContinuationToken")) ListBucketMetricsConfigurationsOutput.add_member(:metrics_configuration_list, Shapes::ShapeRef.new(shape: MetricsConfigurationList, location_name: "MetricsConfiguration")) ListBucketMetricsConfigurationsOutput.struct_class = Types::ListBucketMetricsConfigurationsOutput ListBucketMetricsConfigurationsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListBucketMetricsConfigurationsRequest.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location: "querystring", location_name: "continuation-token")) ListBucketMetricsConfigurationsRequest.struct_class = Types::ListBucketMetricsConfigurationsRequest ListBucketsOutput.add_member(:buckets, Shapes::ShapeRef.new(shape: Buckets, location_name: "Buckets")) ListBucketsOutput.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) ListBucketsOutput.struct_class = Types::ListBucketsOutput ListMultipartUploadsOutput.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, location_name: "Bucket")) ListMultipartUploadsOutput.add_member(:key_marker, Shapes::ShapeRef.new(shape: KeyMarker, location_name: "KeyMarker")) ListMultipartUploadsOutput.add_member(:upload_id_marker, Shapes::ShapeRef.new(shape: UploadIdMarker, location_name: "UploadIdMarker")) ListMultipartUploadsOutput.add_member(:next_key_marker, Shapes::ShapeRef.new(shape: NextKeyMarker, location_name: "NextKeyMarker")) ListMultipartUploadsOutput.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) ListMultipartUploadsOutput.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location_name: "Delimiter")) ListMultipartUploadsOutput.add_member(:next_upload_id_marker, Shapes::ShapeRef.new(shape: NextUploadIdMarker, location_name: "NextUploadIdMarker")) ListMultipartUploadsOutput.add_member(:max_uploads, Shapes::ShapeRef.new(shape: MaxUploads, location_name: "MaxUploads")) ListMultipartUploadsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListMultipartUploadsOutput.add_member(:uploads, Shapes::ShapeRef.new(shape: MultipartUploadList, location_name: "Upload")) ListMultipartUploadsOutput.add_member(:common_prefixes, Shapes::ShapeRef.new(shape: CommonPrefixList, location_name: "CommonPrefixes")) ListMultipartUploadsOutput.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location_name: "EncodingType")) ListMultipartUploadsOutput.struct_class = Types::ListMultipartUploadsOutput ListMultipartUploadsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListMultipartUploadsRequest.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location: "querystring", location_name: "delimiter")) ListMultipartUploadsRequest.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location: "querystring", location_name: "encoding-type")) ListMultipartUploadsRequest.add_member(:key_marker, Shapes::ShapeRef.new(shape: KeyMarker, location: "querystring", location_name: "key-marker")) ListMultipartUploadsRequest.add_member(:max_uploads, Shapes::ShapeRef.new(shape: MaxUploads, location: "querystring", location_name: "max-uploads")) ListMultipartUploadsRequest.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location: "querystring", location_name: "prefix")) ListMultipartUploadsRequest.add_member(:upload_id_marker, Shapes::ShapeRef.new(shape: UploadIdMarker, location: "querystring", location_name: "upload-id-marker")) ListMultipartUploadsRequest.struct_class = Types::ListMultipartUploadsRequest ListObjectVersionsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListObjectVersionsOutput.add_member(:key_marker, Shapes::ShapeRef.new(shape: KeyMarker, location_name: "KeyMarker")) ListObjectVersionsOutput.add_member(:version_id_marker, Shapes::ShapeRef.new(shape: VersionIdMarker, location_name: "VersionIdMarker")) ListObjectVersionsOutput.add_member(:next_key_marker, Shapes::ShapeRef.new(shape: NextKeyMarker, location_name: "NextKeyMarker")) ListObjectVersionsOutput.add_member(:next_version_id_marker, Shapes::ShapeRef.new(shape: NextVersionIdMarker, location_name: "NextVersionIdMarker")) ListObjectVersionsOutput.add_member(:versions, Shapes::ShapeRef.new(shape: ObjectVersionList, location_name: "Version")) ListObjectVersionsOutput.add_member(:delete_markers, Shapes::ShapeRef.new(shape: DeleteMarkers, location_name: "DeleteMarker")) ListObjectVersionsOutput.add_member(:name, Shapes::ShapeRef.new(shape: BucketName, location_name: "Name")) ListObjectVersionsOutput.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) ListObjectVersionsOutput.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location_name: "Delimiter")) ListObjectVersionsOutput.add_member(:max_keys, Shapes::ShapeRef.new(shape: MaxKeys, location_name: "MaxKeys")) ListObjectVersionsOutput.add_member(:common_prefixes, Shapes::ShapeRef.new(shape: CommonPrefixList, location_name: "CommonPrefixes")) ListObjectVersionsOutput.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location_name: "EncodingType")) ListObjectVersionsOutput.struct_class = Types::ListObjectVersionsOutput ListObjectVersionsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListObjectVersionsRequest.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location: "querystring", location_name: "delimiter")) ListObjectVersionsRequest.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location: "querystring", location_name: "encoding-type")) ListObjectVersionsRequest.add_member(:key_marker, Shapes::ShapeRef.new(shape: KeyMarker, location: "querystring", location_name: "key-marker")) ListObjectVersionsRequest.add_member(:max_keys, Shapes::ShapeRef.new(shape: MaxKeys, location: "querystring", location_name: "max-keys")) ListObjectVersionsRequest.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location: "querystring", location_name: "prefix")) ListObjectVersionsRequest.add_member(:version_id_marker, Shapes::ShapeRef.new(shape: VersionIdMarker, location: "querystring", location_name: "version-id-marker")) ListObjectVersionsRequest.struct_class = Types::ListObjectVersionsRequest ListObjectsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListObjectsOutput.add_member(:marker, Shapes::ShapeRef.new(shape: Marker, location_name: "Marker")) ListObjectsOutput.add_member(:next_marker, Shapes::ShapeRef.new(shape: NextMarker, location_name: "NextMarker")) ListObjectsOutput.add_member(:contents, Shapes::ShapeRef.new(shape: ObjectList, location_name: "Contents")) ListObjectsOutput.add_member(:name, Shapes::ShapeRef.new(shape: BucketName, location_name: "Name")) ListObjectsOutput.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) ListObjectsOutput.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location_name: "Delimiter")) ListObjectsOutput.add_member(:max_keys, Shapes::ShapeRef.new(shape: MaxKeys, location_name: "MaxKeys")) ListObjectsOutput.add_member(:common_prefixes, Shapes::ShapeRef.new(shape: CommonPrefixList, location_name: "CommonPrefixes")) ListObjectsOutput.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location_name: "EncodingType")) ListObjectsOutput.struct_class = Types::ListObjectsOutput ListObjectsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListObjectsRequest.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location: "querystring", location_name: "delimiter")) ListObjectsRequest.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location: "querystring", location_name: "encoding-type")) ListObjectsRequest.add_member(:marker, Shapes::ShapeRef.new(shape: Marker, location: "querystring", location_name: "marker")) ListObjectsRequest.add_member(:max_keys, Shapes::ShapeRef.new(shape: MaxKeys, location: "querystring", location_name: "max-keys")) ListObjectsRequest.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location: "querystring", location_name: "prefix")) ListObjectsRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) ListObjectsRequest.struct_class = Types::ListObjectsRequest ListObjectsV2Output.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListObjectsV2Output.add_member(:contents, Shapes::ShapeRef.new(shape: ObjectList, location_name: "Contents")) ListObjectsV2Output.add_member(:name, Shapes::ShapeRef.new(shape: BucketName, location_name: "Name")) ListObjectsV2Output.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) ListObjectsV2Output.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location_name: "Delimiter")) ListObjectsV2Output.add_member(:max_keys, Shapes::ShapeRef.new(shape: MaxKeys, location_name: "MaxKeys")) ListObjectsV2Output.add_member(:common_prefixes, Shapes::ShapeRef.new(shape: CommonPrefixList, location_name: "CommonPrefixes")) ListObjectsV2Output.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location_name: "EncodingType")) ListObjectsV2Output.add_member(:key_count, Shapes::ShapeRef.new(shape: KeyCount, location_name: "KeyCount")) ListObjectsV2Output.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location_name: "ContinuationToken")) ListObjectsV2Output.add_member(:next_continuation_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextContinuationToken")) ListObjectsV2Output.add_member(:start_after, Shapes::ShapeRef.new(shape: StartAfter, location_name: "StartAfter")) ListObjectsV2Output.struct_class = Types::ListObjectsV2Output ListObjectsV2Request.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListObjectsV2Request.add_member(:delimiter, Shapes::ShapeRef.new(shape: Delimiter, location: "querystring", location_name: "delimiter")) ListObjectsV2Request.add_member(:encoding_type, Shapes::ShapeRef.new(shape: EncodingType, location: "querystring", location_name: "encoding-type")) ListObjectsV2Request.add_member(:max_keys, Shapes::ShapeRef.new(shape: MaxKeys, location: "querystring", location_name: "max-keys")) ListObjectsV2Request.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location: "querystring", location_name: "prefix")) ListObjectsV2Request.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location: "querystring", location_name: "continuation-token")) ListObjectsV2Request.add_member(:fetch_owner, Shapes::ShapeRef.new(shape: FetchOwner, location: "querystring", location_name: "fetch-owner")) ListObjectsV2Request.add_member(:start_after, Shapes::ShapeRef.new(shape: StartAfter, location: "querystring", location_name: "start-after")) ListObjectsV2Request.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) ListObjectsV2Request.struct_class = Types::ListObjectsV2Request ListPartsOutput.add_member(:abort_date, Shapes::ShapeRef.new(shape: AbortDate, location: "header", location_name: "x-amz-abort-date")) ListPartsOutput.add_member(:abort_rule_id, Shapes::ShapeRef.new(shape: AbortRuleId, location: "header", location_name: "x-amz-abort-rule-id")) ListPartsOutput.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, location_name: "Bucket")) ListPartsOutput.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) ListPartsOutput.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, location_name: "UploadId")) ListPartsOutput.add_member(:part_number_marker, Shapes::ShapeRef.new(shape: PartNumberMarker, location_name: "PartNumberMarker")) ListPartsOutput.add_member(:next_part_number_marker, Shapes::ShapeRef.new(shape: NextPartNumberMarker, location_name: "NextPartNumberMarker")) ListPartsOutput.add_member(:max_parts, Shapes::ShapeRef.new(shape: MaxParts, location_name: "MaxParts")) ListPartsOutput.add_member(:is_truncated, Shapes::ShapeRef.new(shape: IsTruncated, location_name: "IsTruncated")) ListPartsOutput.add_member(:parts, Shapes::ShapeRef.new(shape: Parts, location_name: "Part")) ListPartsOutput.add_member(:initiator, Shapes::ShapeRef.new(shape: Initiator, location_name: "Initiator")) ListPartsOutput.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) ListPartsOutput.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location_name: "StorageClass")) ListPartsOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) ListPartsOutput.struct_class = Types::ListPartsOutput ListPartsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) ListPartsRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) ListPartsRequest.add_member(:max_parts, Shapes::ShapeRef.new(shape: MaxParts, location: "querystring", location_name: "max-parts")) ListPartsRequest.add_member(:part_number_marker, Shapes::ShapeRef.new(shape: PartNumberMarker, location: "querystring", location_name: "part-number-marker")) ListPartsRequest.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, required: true, location: "querystring", location_name: "uploadId")) ListPartsRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) ListPartsRequest.struct_class = Types::ListPartsRequest LoggingEnabled.add_member(:target_bucket, Shapes::ShapeRef.new(shape: TargetBucket, required: true, location_name: "TargetBucket")) LoggingEnabled.add_member(:target_grants, Shapes::ShapeRef.new(shape: TargetGrants, location_name: "TargetGrants")) LoggingEnabled.add_member(:target_prefix, Shapes::ShapeRef.new(shape: TargetPrefix, required: true, location_name: "TargetPrefix")) LoggingEnabled.struct_class = Types::LoggingEnabled Metadata.key = Shapes::ShapeRef.new(shape: MetadataKey) Metadata.value = Shapes::ShapeRef.new(shape: MetadataValue) MetadataEntry.add_member(:name, Shapes::ShapeRef.new(shape: MetadataKey, location_name: "Name")) MetadataEntry.add_member(:value, Shapes::ShapeRef.new(shape: MetadataValue, location_name: "Value")) MetadataEntry.struct_class = Types::MetadataEntry MetricsAndOperator.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) MetricsAndOperator.add_member(:tags, Shapes::ShapeRef.new(shape: TagSet, location_name: "Tag", metadata: {"flattened"=>true})) MetricsAndOperator.struct_class = Types::MetricsAndOperator MetricsConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: MetricsId, required: true, location_name: "Id")) MetricsConfiguration.add_member(:filter, Shapes::ShapeRef.new(shape: MetricsFilter, location_name: "Filter")) MetricsConfiguration.struct_class = Types::MetricsConfiguration MetricsConfigurationList.member = Shapes::ShapeRef.new(shape: MetricsConfiguration) MetricsFilter.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) MetricsFilter.add_member(:tag, Shapes::ShapeRef.new(shape: Tag, location_name: "Tag")) MetricsFilter.add_member(:and, Shapes::ShapeRef.new(shape: MetricsAndOperator, location_name: "And")) MetricsFilter.struct_class = Types::MetricsFilter MultipartUpload.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, location_name: "UploadId")) MultipartUpload.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) MultipartUpload.add_member(:initiated, Shapes::ShapeRef.new(shape: Initiated, location_name: "Initiated")) MultipartUpload.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location_name: "StorageClass")) MultipartUpload.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) MultipartUpload.add_member(:initiator, Shapes::ShapeRef.new(shape: Initiator, location_name: "Initiator")) MultipartUpload.struct_class = Types::MultipartUpload MultipartUploadList.member = Shapes::ShapeRef.new(shape: MultipartUpload) NoncurrentVersionExpiration.add_member(:noncurrent_days, Shapes::ShapeRef.new(shape: Days, location_name: "NoncurrentDays")) NoncurrentVersionExpiration.struct_class = Types::NoncurrentVersionExpiration NoncurrentVersionTransition.add_member(:noncurrent_days, Shapes::ShapeRef.new(shape: Days, location_name: "NoncurrentDays")) NoncurrentVersionTransition.add_member(:storage_class, Shapes::ShapeRef.new(shape: TransitionStorageClass, location_name: "StorageClass")) NoncurrentVersionTransition.struct_class = Types::NoncurrentVersionTransition NoncurrentVersionTransitionList.member = Shapes::ShapeRef.new(shape: NoncurrentVersionTransition) NotificationConfiguration.add_member(:topic_configurations, Shapes::ShapeRef.new(shape: TopicConfigurationList, location_name: "TopicConfiguration")) NotificationConfiguration.add_member(:queue_configurations, Shapes::ShapeRef.new(shape: QueueConfigurationList, location_name: "QueueConfiguration")) NotificationConfiguration.add_member(:lambda_function_configurations, Shapes::ShapeRef.new(shape: LambdaFunctionConfigurationList, location_name: "CloudFunctionConfiguration")) NotificationConfiguration.struct_class = Types::NotificationConfiguration NotificationConfigurationDeprecated.add_member(:topic_configuration, Shapes::ShapeRef.new(shape: TopicConfigurationDeprecated, location_name: "TopicConfiguration")) NotificationConfigurationDeprecated.add_member(:queue_configuration, Shapes::ShapeRef.new(shape: QueueConfigurationDeprecated, location_name: "QueueConfiguration")) NotificationConfigurationDeprecated.add_member(:cloud_function_configuration, Shapes::ShapeRef.new(shape: CloudFunctionConfiguration, location_name: "CloudFunctionConfiguration")) NotificationConfigurationDeprecated.struct_class = Types::NotificationConfigurationDeprecated NotificationConfigurationFilter.add_member(:key, Shapes::ShapeRef.new(shape: S3KeyFilter, location_name: "S3Key")) NotificationConfigurationFilter.struct_class = Types::NotificationConfigurationFilter Object.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) Object.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified")) Object.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) Object.add_member(:size, Shapes::ShapeRef.new(shape: Size, location_name: "Size")) Object.add_member(:storage_class, Shapes::ShapeRef.new(shape: ObjectStorageClass, location_name: "StorageClass")) Object.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) Object.struct_class = Types::Object ObjectIdentifier.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location_name: "Key")) ObjectIdentifier.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location_name: "VersionId")) ObjectIdentifier.struct_class = Types::ObjectIdentifier ObjectIdentifierList.member = Shapes::ShapeRef.new(shape: ObjectIdentifier) ObjectList.member = Shapes::ShapeRef.new(shape: Object) ObjectLockConfiguration.add_member(:object_lock_enabled, Shapes::ShapeRef.new(shape: ObjectLockEnabled, location_name: "ObjectLockEnabled")) ObjectLockConfiguration.add_member(:rule, Shapes::ShapeRef.new(shape: ObjectLockRule, location_name: "Rule")) ObjectLockConfiguration.struct_class = Types::ObjectLockConfiguration ObjectLockLegalHold.add_member(:status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location_name: "Status")) ObjectLockLegalHold.struct_class = Types::ObjectLockLegalHold ObjectLockRetention.add_member(:mode, Shapes::ShapeRef.new(shape: ObjectLockRetentionMode, location_name: "Mode")) ObjectLockRetention.add_member(:retain_until_date, Shapes::ShapeRef.new(shape: Date, location_name: "RetainUntilDate")) ObjectLockRetention.struct_class = Types::ObjectLockRetention ObjectLockRule.add_member(:default_retention, Shapes::ShapeRef.new(shape: DefaultRetention, location_name: "DefaultRetention")) ObjectLockRule.struct_class = Types::ObjectLockRule ObjectVersion.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) ObjectVersion.add_member(:size, Shapes::ShapeRef.new(shape: Size, location_name: "Size")) ObjectVersion.add_member(:storage_class, Shapes::ShapeRef.new(shape: ObjectVersionStorageClass, location_name: "StorageClass")) ObjectVersion.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, location_name: "Key")) ObjectVersion.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location_name: "VersionId")) ObjectVersion.add_member(:is_latest, Shapes::ShapeRef.new(shape: IsLatest, location_name: "IsLatest")) ObjectVersion.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified")) ObjectVersion.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner")) ObjectVersion.struct_class = Types::ObjectVersion ObjectVersionList.member = Shapes::ShapeRef.new(shape: ObjectVersion) OutputLocation.add_member(:s3, Shapes::ShapeRef.new(shape: S3Location, location_name: "S3")) OutputLocation.struct_class = Types::OutputLocation OutputSerialization.add_member(:csv, Shapes::ShapeRef.new(shape: CSVOutput, location_name: "CSV")) OutputSerialization.add_member(:json, Shapes::ShapeRef.new(shape: JSONOutput, location_name: "JSON")) OutputSerialization.struct_class = Types::OutputSerialization Owner.add_member(:display_name, Shapes::ShapeRef.new(shape: DisplayName, location_name: "DisplayName")) Owner.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID")) Owner.struct_class = Types::Owner ParquetInput.struct_class = Types::ParquetInput Part.add_member(:part_number, Shapes::ShapeRef.new(shape: PartNumber, location_name: "PartNumber")) Part.add_member(:last_modified, Shapes::ShapeRef.new(shape: LastModified, location_name: "LastModified")) Part.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location_name: "ETag")) Part.add_member(:size, Shapes::ShapeRef.new(shape: Size, location_name: "Size")) Part.struct_class = Types::Part Parts.member = Shapes::ShapeRef.new(shape: Part) PolicyStatus.add_member(:is_public, Shapes::ShapeRef.new(shape: IsPublic, location_name: "IsPublic")) PolicyStatus.struct_class = Types::PolicyStatus Progress.add_member(:bytes_scanned, Shapes::ShapeRef.new(shape: BytesScanned, location_name: "BytesScanned")) Progress.add_member(:bytes_processed, Shapes::ShapeRef.new(shape: BytesProcessed, location_name: "BytesProcessed")) Progress.add_member(:bytes_returned, Shapes::ShapeRef.new(shape: BytesReturned, location_name: "BytesReturned")) Progress.struct_class = Types::Progress ProgressEvent.add_member(:details, Shapes::ShapeRef.new(shape: Progress, eventpayload: true, eventpayload_type: 'structure', location_name: "Details", metadata: {"eventpayload"=>true})) ProgressEvent.struct_class = Types::ProgressEvent PublicAccessBlockConfiguration.add_member(:block_public_acls, Shapes::ShapeRef.new(shape: Setting, location_name: "BlockPublicAcls")) PublicAccessBlockConfiguration.add_member(:ignore_public_acls, Shapes::ShapeRef.new(shape: Setting, location_name: "IgnorePublicAcls")) PublicAccessBlockConfiguration.add_member(:block_public_policy, Shapes::ShapeRef.new(shape: Setting, location_name: "BlockPublicPolicy")) PublicAccessBlockConfiguration.add_member(:restrict_public_buckets, Shapes::ShapeRef.new(shape: Setting, location_name: "RestrictPublicBuckets")) PublicAccessBlockConfiguration.struct_class = Types::PublicAccessBlockConfiguration PutBucketAccelerateConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketAccelerateConfigurationRequest.add_member(:accelerate_configuration, Shapes::ShapeRef.new(shape: AccelerateConfiguration, required: true, location_name: "AccelerateConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketAccelerateConfigurationRequest.struct_class = Types::PutBucketAccelerateConfigurationRequest PutBucketAccelerateConfigurationRequest[:payload] = :accelerate_configuration PutBucketAccelerateConfigurationRequest[:payload_member] = PutBucketAccelerateConfigurationRequest.member(:accelerate_configuration) PutBucketAclRequest.add_member(:acl, Shapes::ShapeRef.new(shape: BucketCannedACL, location: "header", location_name: "x-amz-acl")) PutBucketAclRequest.add_member(:access_control_policy, Shapes::ShapeRef.new(shape: AccessControlPolicy, location_name: "AccessControlPolicy", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketAclRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketAclRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketAclRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control")) PutBucketAclRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read")) PutBucketAclRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp")) PutBucketAclRequest.add_member(:grant_write, Shapes::ShapeRef.new(shape: GrantWrite, location: "header", location_name: "x-amz-grant-write")) PutBucketAclRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp")) PutBucketAclRequest.struct_class = Types::PutBucketAclRequest PutBucketAclRequest[:payload] = :access_control_policy PutBucketAclRequest[:payload_member] = PutBucketAclRequest.member(:access_control_policy) PutBucketAnalyticsConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketAnalyticsConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: AnalyticsId, required: true, location: "querystring", location_name: "id")) PutBucketAnalyticsConfigurationRequest.add_member(:analytics_configuration, Shapes::ShapeRef.new(shape: AnalyticsConfiguration, required: true, location_name: "AnalyticsConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketAnalyticsConfigurationRequest.struct_class = Types::PutBucketAnalyticsConfigurationRequest PutBucketAnalyticsConfigurationRequest[:payload] = :analytics_configuration PutBucketAnalyticsConfigurationRequest[:payload_member] = PutBucketAnalyticsConfigurationRequest.member(:analytics_configuration) PutBucketCorsRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketCorsRequest.add_member(:cors_configuration, Shapes::ShapeRef.new(shape: CORSConfiguration, required: true, location_name: "CORSConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketCorsRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketCorsRequest.struct_class = Types::PutBucketCorsRequest PutBucketCorsRequest[:payload] = :cors_configuration PutBucketCorsRequest[:payload_member] = PutBucketCorsRequest.member(:cors_configuration) PutBucketEncryptionRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketEncryptionRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketEncryptionRequest.add_member(:server_side_encryption_configuration, Shapes::ShapeRef.new(shape: ServerSideEncryptionConfiguration, required: true, location_name: "ServerSideEncryptionConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketEncryptionRequest.struct_class = Types::PutBucketEncryptionRequest PutBucketEncryptionRequest[:payload] = :server_side_encryption_configuration PutBucketEncryptionRequest[:payload_member] = PutBucketEncryptionRequest.member(:server_side_encryption_configuration) PutBucketInventoryConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketInventoryConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: InventoryId, required: true, location: "querystring", location_name: "id")) PutBucketInventoryConfigurationRequest.add_member(:inventory_configuration, Shapes::ShapeRef.new(shape: InventoryConfiguration, required: true, location_name: "InventoryConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketInventoryConfigurationRequest.struct_class = Types::PutBucketInventoryConfigurationRequest PutBucketInventoryConfigurationRequest[:payload] = :inventory_configuration PutBucketInventoryConfigurationRequest[:payload_member] = PutBucketInventoryConfigurationRequest.member(:inventory_configuration) PutBucketLifecycleConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketLifecycleConfigurationRequest.add_member(:lifecycle_configuration, Shapes::ShapeRef.new(shape: BucketLifecycleConfiguration, location_name: "LifecycleConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketLifecycleConfigurationRequest.struct_class = Types::PutBucketLifecycleConfigurationRequest PutBucketLifecycleConfigurationRequest[:payload] = :lifecycle_configuration PutBucketLifecycleConfigurationRequest[:payload_member] = PutBucketLifecycleConfigurationRequest.member(:lifecycle_configuration) PutBucketLifecycleRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketLifecycleRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketLifecycleRequest.add_member(:lifecycle_configuration, Shapes::ShapeRef.new(shape: LifecycleConfiguration, location_name: "LifecycleConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketLifecycleRequest.struct_class = Types::PutBucketLifecycleRequest PutBucketLifecycleRequest[:payload] = :lifecycle_configuration PutBucketLifecycleRequest[:payload_member] = PutBucketLifecycleRequest.member(:lifecycle_configuration) PutBucketLoggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketLoggingRequest.add_member(:bucket_logging_status, Shapes::ShapeRef.new(shape: BucketLoggingStatus, required: true, location_name: "BucketLoggingStatus", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketLoggingRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketLoggingRequest.struct_class = Types::PutBucketLoggingRequest PutBucketLoggingRequest[:payload] = :bucket_logging_status PutBucketLoggingRequest[:payload_member] = PutBucketLoggingRequest.member(:bucket_logging_status) PutBucketMetricsConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketMetricsConfigurationRequest.add_member(:id, Shapes::ShapeRef.new(shape: MetricsId, required: true, location: "querystring", location_name: "id")) PutBucketMetricsConfigurationRequest.add_member(:metrics_configuration, Shapes::ShapeRef.new(shape: MetricsConfiguration, required: true, location_name: "MetricsConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketMetricsConfigurationRequest.struct_class = Types::PutBucketMetricsConfigurationRequest PutBucketMetricsConfigurationRequest[:payload] = :metrics_configuration PutBucketMetricsConfigurationRequest[:payload_member] = PutBucketMetricsConfigurationRequest.member(:metrics_configuration) PutBucketNotificationConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketNotificationConfigurationRequest.add_member(:notification_configuration, Shapes::ShapeRef.new(shape: NotificationConfiguration, required: true, location_name: "NotificationConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketNotificationConfigurationRequest.struct_class = Types::PutBucketNotificationConfigurationRequest PutBucketNotificationConfigurationRequest[:payload] = :notification_configuration PutBucketNotificationConfigurationRequest[:payload_member] = PutBucketNotificationConfigurationRequest.member(:notification_configuration) PutBucketNotificationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketNotificationRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketNotificationRequest.add_member(:notification_configuration, Shapes::ShapeRef.new(shape: NotificationConfigurationDeprecated, required: true, location_name: "NotificationConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketNotificationRequest.struct_class = Types::PutBucketNotificationRequest PutBucketNotificationRequest[:payload] = :notification_configuration PutBucketNotificationRequest[:payload_member] = PutBucketNotificationRequest.member(:notification_configuration) PutBucketPolicyRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketPolicyRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketPolicyRequest.add_member(:confirm_remove_self_bucket_access, Shapes::ShapeRef.new(shape: ConfirmRemoveSelfBucketAccess, location: "header", location_name: "x-amz-confirm-remove-self-bucket-access")) PutBucketPolicyRequest.add_member(:policy, Shapes::ShapeRef.new(shape: Policy, required: true, location_name: "Policy")) PutBucketPolicyRequest.struct_class = Types::PutBucketPolicyRequest PutBucketPolicyRequest[:payload] = :policy PutBucketPolicyRequest[:payload_member] = PutBucketPolicyRequest.member(:policy) PutBucketReplicationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketReplicationRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketReplicationRequest.add_member(:replication_configuration, Shapes::ShapeRef.new(shape: ReplicationConfiguration, required: true, location_name: "ReplicationConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketReplicationRequest.add_member(:token, Shapes::ShapeRef.new(shape: ObjectLockToken, location: "header", location_name: "x-amz-bucket-object-lock-token")) PutBucketReplicationRequest.struct_class = Types::PutBucketReplicationRequest PutBucketReplicationRequest[:payload] = :replication_configuration PutBucketReplicationRequest[:payload_member] = PutBucketReplicationRequest.member(:replication_configuration) PutBucketRequestPaymentRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketRequestPaymentRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketRequestPaymentRequest.add_member(:request_payment_configuration, Shapes::ShapeRef.new(shape: RequestPaymentConfiguration, required: true, location_name: "RequestPaymentConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketRequestPaymentRequest.struct_class = Types::PutBucketRequestPaymentRequest PutBucketRequestPaymentRequest[:payload] = :request_payment_configuration PutBucketRequestPaymentRequest[:payload_member] = PutBucketRequestPaymentRequest.member(:request_payment_configuration) PutBucketTaggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketTaggingRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketTaggingRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: Tagging, required: true, location_name: "Tagging", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketTaggingRequest.struct_class = Types::PutBucketTaggingRequest PutBucketTaggingRequest[:payload] = :tagging PutBucketTaggingRequest[:payload_member] = PutBucketTaggingRequest.member(:tagging) PutBucketVersioningRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketVersioningRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketVersioningRequest.add_member(:mfa, Shapes::ShapeRef.new(shape: MFA, location: "header", location_name: "x-amz-mfa")) PutBucketVersioningRequest.add_member(:versioning_configuration, Shapes::ShapeRef.new(shape: VersioningConfiguration, required: true, location_name: "VersioningConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketVersioningRequest.struct_class = Types::PutBucketVersioningRequest PutBucketVersioningRequest[:payload] = :versioning_configuration PutBucketVersioningRequest[:payload_member] = PutBucketVersioningRequest.member(:versioning_configuration) PutBucketWebsiteRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutBucketWebsiteRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutBucketWebsiteRequest.add_member(:website_configuration, Shapes::ShapeRef.new(shape: WebsiteConfiguration, required: true, location_name: "WebsiteConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutBucketWebsiteRequest.struct_class = Types::PutBucketWebsiteRequest PutBucketWebsiteRequest[:payload] = :website_configuration PutBucketWebsiteRequest[:payload_member] = PutBucketWebsiteRequest.member(:website_configuration) PutObjectAclOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) PutObjectAclOutput.struct_class = Types::PutObjectAclOutput PutObjectAclRequest.add_member(:acl, Shapes::ShapeRef.new(shape: ObjectCannedACL, location: "header", location_name: "x-amz-acl")) PutObjectAclRequest.add_member(:access_control_policy, Shapes::ShapeRef.new(shape: AccessControlPolicy, location_name: "AccessControlPolicy", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutObjectAclRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutObjectAclRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutObjectAclRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control")) PutObjectAclRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read")) PutObjectAclRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp")) PutObjectAclRequest.add_member(:grant_write, Shapes::ShapeRef.new(shape: GrantWrite, location: "header", location_name: "x-amz-grant-write")) PutObjectAclRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp")) PutObjectAclRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) PutObjectAclRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) PutObjectAclRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) PutObjectAclRequest.struct_class = Types::PutObjectAclRequest PutObjectAclRequest[:payload] = :access_control_policy PutObjectAclRequest[:payload_member] = PutObjectAclRequest.member(:access_control_policy) PutObjectLegalHoldOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) PutObjectLegalHoldOutput.struct_class = Types::PutObjectLegalHoldOutput PutObjectLegalHoldRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutObjectLegalHoldRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) PutObjectLegalHoldRequest.add_member(:legal_hold, Shapes::ShapeRef.new(shape: ObjectLockLegalHold, location_name: "LegalHold", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutObjectLegalHoldRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) PutObjectLegalHoldRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) PutObjectLegalHoldRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutObjectLegalHoldRequest.struct_class = Types::PutObjectLegalHoldRequest PutObjectLegalHoldRequest[:payload] = :legal_hold PutObjectLegalHoldRequest[:payload_member] = PutObjectLegalHoldRequest.member(:legal_hold) PutObjectLockConfigurationOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) PutObjectLockConfigurationOutput.struct_class = Types::PutObjectLockConfigurationOutput PutObjectLockConfigurationRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutObjectLockConfigurationRequest.add_member(:object_lock_configuration, Shapes::ShapeRef.new(shape: ObjectLockConfiguration, location_name: "ObjectLockConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutObjectLockConfigurationRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) PutObjectLockConfigurationRequest.add_member(:token, Shapes::ShapeRef.new(shape: ObjectLockToken, location: "header", location_name: "x-amz-bucket-object-lock-token")) PutObjectLockConfigurationRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutObjectLockConfigurationRequest.struct_class = Types::PutObjectLockConfigurationRequest PutObjectLockConfigurationRequest[:payload] = :object_lock_configuration PutObjectLockConfigurationRequest[:payload_member] = PutObjectLockConfigurationRequest.member(:object_lock_configuration) PutObjectOutput.add_member(:expiration, Shapes::ShapeRef.new(shape: Expiration, location: "header", location_name: "x-amz-expiration")) PutObjectOutput.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location: "header", location_name: "ETag")) PutObjectOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) PutObjectOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) PutObjectOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) PutObjectOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) PutObjectOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) PutObjectOutput.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context")) PutObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) PutObjectOutput.struct_class = Types::PutObjectOutput PutObjectRequest.add_member(:acl, Shapes::ShapeRef.new(shape: ObjectCannedACL, location: "header", location_name: "x-amz-acl")) PutObjectRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "Body", metadata: {"streaming"=>true})) PutObjectRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutObjectRequest.add_member(:cache_control, Shapes::ShapeRef.new(shape: CacheControl, location: "header", location_name: "Cache-Control")) PutObjectRequest.add_member(:content_disposition, Shapes::ShapeRef.new(shape: ContentDisposition, location: "header", location_name: "Content-Disposition")) PutObjectRequest.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "Content-Encoding")) PutObjectRequest.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "Content-Language")) PutObjectRequest.add_member(:content_length, Shapes::ShapeRef.new(shape: ContentLength, location: "header", location_name: "Content-Length")) PutObjectRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutObjectRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type")) PutObjectRequest.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "Expires")) PutObjectRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control")) PutObjectRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read")) PutObjectRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp")) PutObjectRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp")) PutObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) PutObjectRequest.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-")) PutObjectRequest.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) PutObjectRequest.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location: "header", location_name: "x-amz-storage-class")) PutObjectRequest.add_member(:website_redirect_location, Shapes::ShapeRef.new(shape: WebsiteRedirectLocation, location: "header", location_name: "x-amz-website-redirect-location")) PutObjectRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) PutObjectRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) PutObjectRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) PutObjectRequest.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) PutObjectRequest.add_member(:ssekms_encryption_context, Shapes::ShapeRef.new(shape: SSEKMSEncryptionContext, location: "header", location_name: "x-amz-server-side-encryption-context")) PutObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) PutObjectRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: TaggingHeader, location: "header", location_name: "x-amz-tagging")) PutObjectRequest.add_member(:object_lock_mode, Shapes::ShapeRef.new(shape: ObjectLockMode, location: "header", location_name: "x-amz-object-lock-mode")) PutObjectRequest.add_member(:object_lock_retain_until_date, Shapes::ShapeRef.new(shape: ObjectLockRetainUntilDate, location: "header", location_name: "x-amz-object-lock-retain-until-date")) PutObjectRequest.add_member(:object_lock_legal_hold_status, Shapes::ShapeRef.new(shape: ObjectLockLegalHoldStatus, location: "header", location_name: "x-amz-object-lock-legal-hold")) PutObjectRequest.struct_class = Types::PutObjectRequest PutObjectRequest[:payload] = :body PutObjectRequest[:payload_member] = PutObjectRequest.member(:body) PutObjectRetentionOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) PutObjectRetentionOutput.struct_class = Types::PutObjectRetentionOutput PutObjectRetentionRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutObjectRetentionRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) PutObjectRetentionRequest.add_member(:retention, Shapes::ShapeRef.new(shape: ObjectLockRetention, location_name: "Retention", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutObjectRetentionRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) PutObjectRetentionRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) PutObjectRetentionRequest.add_member(:bypass_governance_retention, Shapes::ShapeRef.new(shape: BypassGovernanceRetention, location: "header", location_name: "x-amz-bypass-governance-retention")) PutObjectRetentionRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutObjectRetentionRequest.struct_class = Types::PutObjectRetentionRequest PutObjectRetentionRequest[:payload] = :retention PutObjectRetentionRequest[:payload_member] = PutObjectRetentionRequest.member(:retention) PutObjectTaggingOutput.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "header", location_name: "x-amz-version-id")) PutObjectTaggingOutput.struct_class = Types::PutObjectTaggingOutput PutObjectTaggingRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutObjectTaggingRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) PutObjectTaggingRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) PutObjectTaggingRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutObjectTaggingRequest.add_member(:tagging, Shapes::ShapeRef.new(shape: Tagging, required: true, location_name: "Tagging", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutObjectTaggingRequest.struct_class = Types::PutObjectTaggingRequest PutObjectTaggingRequest[:payload] = :tagging PutObjectTaggingRequest[:payload_member] = PutObjectTaggingRequest.member(:tagging) PutPublicAccessBlockRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) PutPublicAccessBlockRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) PutPublicAccessBlockRequest.add_member(:public_access_block_configuration, Shapes::ShapeRef.new(shape: PublicAccessBlockConfiguration, required: true, location_name: "PublicAccessBlockConfiguration", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) PutPublicAccessBlockRequest.struct_class = Types::PutPublicAccessBlockRequest PutPublicAccessBlockRequest[:payload] = :public_access_block_configuration PutPublicAccessBlockRequest[:payload_member] = PutPublicAccessBlockRequest.member(:public_access_block_configuration) QueueConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: NotificationId, location_name: "Id")) QueueConfiguration.add_member(:queue_arn, Shapes::ShapeRef.new(shape: QueueArn, required: true, location_name: "Queue")) QueueConfiguration.add_member(:events, Shapes::ShapeRef.new(shape: EventList, required: true, location_name: "Event")) QueueConfiguration.add_member(:filter, Shapes::ShapeRef.new(shape: NotificationConfigurationFilter, location_name: "Filter")) QueueConfiguration.struct_class = Types::QueueConfiguration QueueConfigurationDeprecated.add_member(:id, Shapes::ShapeRef.new(shape: NotificationId, location_name: "Id")) QueueConfigurationDeprecated.add_member(:event, Shapes::ShapeRef.new(shape: Event, deprecated: true, location_name: "Event")) QueueConfigurationDeprecated.add_member(:events, Shapes::ShapeRef.new(shape: EventList, location_name: "Event")) QueueConfigurationDeprecated.add_member(:queue, Shapes::ShapeRef.new(shape: QueueArn, location_name: "Queue")) QueueConfigurationDeprecated.struct_class = Types::QueueConfigurationDeprecated QueueConfigurationList.member = Shapes::ShapeRef.new(shape: QueueConfiguration) RecordsEvent.add_member(:payload, Shapes::ShapeRef.new(shape: Body, eventpayload: true, eventpayload_type: 'blob', location_name: "Payload", metadata: {"eventpayload"=>true})) RecordsEvent.struct_class = Types::RecordsEvent Redirect.add_member(:host_name, Shapes::ShapeRef.new(shape: HostName, location_name: "HostName")) Redirect.add_member(:http_redirect_code, Shapes::ShapeRef.new(shape: HttpRedirectCode, location_name: "HttpRedirectCode")) Redirect.add_member(:protocol, Shapes::ShapeRef.new(shape: Protocol, location_name: "Protocol")) Redirect.add_member(:replace_key_prefix_with, Shapes::ShapeRef.new(shape: ReplaceKeyPrefixWith, location_name: "ReplaceKeyPrefixWith")) Redirect.add_member(:replace_key_with, Shapes::ShapeRef.new(shape: ReplaceKeyWith, location_name: "ReplaceKeyWith")) Redirect.struct_class = Types::Redirect RedirectAllRequestsTo.add_member(:host_name, Shapes::ShapeRef.new(shape: HostName, required: true, location_name: "HostName")) RedirectAllRequestsTo.add_member(:protocol, Shapes::ShapeRef.new(shape: Protocol, location_name: "Protocol")) RedirectAllRequestsTo.struct_class = Types::RedirectAllRequestsTo ReplicationConfiguration.add_member(:role, Shapes::ShapeRef.new(shape: Role, required: true, location_name: "Role")) ReplicationConfiguration.add_member(:rules, Shapes::ShapeRef.new(shape: ReplicationRules, required: true, location_name: "Rule")) ReplicationConfiguration.struct_class = Types::ReplicationConfiguration ReplicationRule.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID")) ReplicationRule.add_member(:priority, Shapes::ShapeRef.new(shape: Priority, location_name: "Priority")) ReplicationRule.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, deprecated: true, location_name: "Prefix")) ReplicationRule.add_member(:filter, Shapes::ShapeRef.new(shape: ReplicationRuleFilter, location_name: "Filter")) ReplicationRule.add_member(:status, Shapes::ShapeRef.new(shape: ReplicationRuleStatus, required: true, location_name: "Status")) ReplicationRule.add_member(:source_selection_criteria, Shapes::ShapeRef.new(shape: SourceSelectionCriteria, location_name: "SourceSelectionCriteria")) ReplicationRule.add_member(:destination, Shapes::ShapeRef.new(shape: Destination, required: true, location_name: "Destination")) ReplicationRule.add_member(:delete_marker_replication, Shapes::ShapeRef.new(shape: DeleteMarkerReplication, location_name: "DeleteMarkerReplication")) ReplicationRule.struct_class = Types::ReplicationRule ReplicationRuleAndOperator.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) ReplicationRuleAndOperator.add_member(:tags, Shapes::ShapeRef.new(shape: TagSet, location_name: "Tag", metadata: {"flattened"=>true})) ReplicationRuleAndOperator.struct_class = Types::ReplicationRuleAndOperator ReplicationRuleFilter.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, location_name: "Prefix")) ReplicationRuleFilter.add_member(:tag, Shapes::ShapeRef.new(shape: Tag, location_name: "Tag")) ReplicationRuleFilter.add_member(:and, Shapes::ShapeRef.new(shape: ReplicationRuleAndOperator, location_name: "And")) ReplicationRuleFilter.struct_class = Types::ReplicationRuleFilter ReplicationRules.member = Shapes::ShapeRef.new(shape: ReplicationRule) RequestPaymentConfiguration.add_member(:payer, Shapes::ShapeRef.new(shape: Payer, required: true, location_name: "Payer")) RequestPaymentConfiguration.struct_class = Types::RequestPaymentConfiguration RequestProgress.add_member(:enabled, Shapes::ShapeRef.new(shape: EnableRequestProgress, location_name: "Enabled")) RequestProgress.struct_class = Types::RequestProgress RestoreObjectOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) RestoreObjectOutput.add_member(:restore_output_path, Shapes::ShapeRef.new(shape: RestoreOutputPath, location: "header", location_name: "x-amz-restore-output-path")) RestoreObjectOutput.struct_class = Types::RestoreObjectOutput RestoreObjectRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) RestoreObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) RestoreObjectRequest.add_member(:version_id, Shapes::ShapeRef.new(shape: ObjectVersionId, location: "querystring", location_name: "versionId")) RestoreObjectRequest.add_member(:restore_request, Shapes::ShapeRef.new(shape: RestoreRequest, location_name: "RestoreRequest", metadata: {"xmlNamespace"=>{"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"}})) RestoreObjectRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) RestoreObjectRequest.struct_class = Types::RestoreObjectRequest RestoreObjectRequest[:payload] = :restore_request RestoreObjectRequest[:payload_member] = RestoreObjectRequest.member(:restore_request) RestoreRequest.add_member(:days, Shapes::ShapeRef.new(shape: Days, location_name: "Days")) RestoreRequest.add_member(:glacier_job_parameters, Shapes::ShapeRef.new(shape: GlacierJobParameters, location_name: "GlacierJobParameters")) RestoreRequest.add_member(:type, Shapes::ShapeRef.new(shape: RestoreRequestType, location_name: "Type")) RestoreRequest.add_member(:tier, Shapes::ShapeRef.new(shape: Tier, location_name: "Tier")) RestoreRequest.add_member(:description, Shapes::ShapeRef.new(shape: Description, location_name: "Description")) RestoreRequest.add_member(:select_parameters, Shapes::ShapeRef.new(shape: SelectParameters, location_name: "SelectParameters")) RestoreRequest.add_member(:output_location, Shapes::ShapeRef.new(shape: OutputLocation, location_name: "OutputLocation")) RestoreRequest.struct_class = Types::RestoreRequest RoutingRule.add_member(:condition, Shapes::ShapeRef.new(shape: Condition, location_name: "Condition")) RoutingRule.add_member(:redirect, Shapes::ShapeRef.new(shape: Redirect, required: true, location_name: "Redirect")) RoutingRule.struct_class = Types::RoutingRule RoutingRules.member = Shapes::ShapeRef.new(shape: RoutingRule, location_name: "RoutingRule") Rule.add_member(:expiration, Shapes::ShapeRef.new(shape: LifecycleExpiration, location_name: "Expiration")) Rule.add_member(:id, Shapes::ShapeRef.new(shape: ID, location_name: "ID")) Rule.add_member(:prefix, Shapes::ShapeRef.new(shape: Prefix, required: true, location_name: "Prefix")) Rule.add_member(:status, Shapes::ShapeRef.new(shape: ExpirationStatus, required: true, location_name: "Status")) Rule.add_member(:transition, Shapes::ShapeRef.new(shape: Transition, location_name: "Transition")) Rule.add_member(:noncurrent_version_transition, Shapes::ShapeRef.new(shape: NoncurrentVersionTransition, location_name: "NoncurrentVersionTransition")) Rule.add_member(:noncurrent_version_expiration, Shapes::ShapeRef.new(shape: NoncurrentVersionExpiration, location_name: "NoncurrentVersionExpiration")) Rule.add_member(:abort_incomplete_multipart_upload, Shapes::ShapeRef.new(shape: AbortIncompleteMultipartUpload, location_name: "AbortIncompleteMultipartUpload")) Rule.struct_class = Types::Rule Rules.member = Shapes::ShapeRef.new(shape: Rule) S3KeyFilter.add_member(:filter_rules, Shapes::ShapeRef.new(shape: FilterRuleList, location_name: "FilterRule")) S3KeyFilter.struct_class = Types::S3KeyFilter S3Location.add_member(:bucket_name, Shapes::ShapeRef.new(shape: BucketName, required: true, location_name: "BucketName")) S3Location.add_member(:prefix, Shapes::ShapeRef.new(shape: LocationPrefix, required: true, location_name: "Prefix")) S3Location.add_member(:encryption, Shapes::ShapeRef.new(shape: Encryption, location_name: "Encryption")) S3Location.add_member(:canned_acl, Shapes::ShapeRef.new(shape: ObjectCannedACL, location_name: "CannedACL")) S3Location.add_member(:access_control_list, Shapes::ShapeRef.new(shape: Grants, location_name: "AccessControlList")) S3Location.add_member(:tagging, Shapes::ShapeRef.new(shape: Tagging, location_name: "Tagging")) S3Location.add_member(:user_metadata, Shapes::ShapeRef.new(shape: UserMetadata, location_name: "UserMetadata")) S3Location.add_member(:storage_class, Shapes::ShapeRef.new(shape: StorageClass, location_name: "StorageClass")) S3Location.struct_class = Types::S3Location SSEKMS.add_member(:key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, required: true, location_name: "KeyId")) SSEKMS.struct_class = Types::SSEKMS SSES3.struct_class = Types::SSES3 SelectObjectContentEventStream.add_member(:records, Shapes::ShapeRef.new(shape: RecordsEvent, event: true, location_name: "Records")) SelectObjectContentEventStream.add_member(:stats, Shapes::ShapeRef.new(shape: StatsEvent, event: true, location_name: "Stats")) SelectObjectContentEventStream.add_member(:progress, Shapes::ShapeRef.new(shape: ProgressEvent, event: true, location_name: "Progress")) SelectObjectContentEventStream.add_member(:cont, Shapes::ShapeRef.new(shape: ContinuationEvent, event: true, location_name: "Cont")) SelectObjectContentEventStream.add_member(:end, Shapes::ShapeRef.new(shape: EndEvent, event: true, location_name: "End")) SelectObjectContentEventStream.struct_class = Types::SelectObjectContentEventStream SelectObjectContentOutput.add_member(:payload, Shapes::ShapeRef.new(shape: SelectObjectContentEventStream, eventstream: true, location_name: "Payload")) SelectObjectContentOutput.struct_class = Types::SelectObjectContentOutput SelectObjectContentOutput[:payload] = :payload SelectObjectContentOutput[:payload_member] = SelectObjectContentOutput.member(:payload) SelectObjectContentRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) SelectObjectContentRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) SelectObjectContentRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) SelectObjectContentRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) SelectObjectContentRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) SelectObjectContentRequest.add_member(:expression, Shapes::ShapeRef.new(shape: Expression, required: true, location_name: "Expression")) SelectObjectContentRequest.add_member(:expression_type, Shapes::ShapeRef.new(shape: ExpressionType, required: true, location_name: "ExpressionType")) SelectObjectContentRequest.add_member(:request_progress, Shapes::ShapeRef.new(shape: RequestProgress, location_name: "RequestProgress")) SelectObjectContentRequest.add_member(:input_serialization, Shapes::ShapeRef.new(shape: InputSerialization, required: true, location_name: "InputSerialization")) SelectObjectContentRequest.add_member(:output_serialization, Shapes::ShapeRef.new(shape: OutputSerialization, required: true, location_name: "OutputSerialization")) SelectObjectContentRequest.struct_class = Types::SelectObjectContentRequest SelectParameters.add_member(:input_serialization, Shapes::ShapeRef.new(shape: InputSerialization, required: true, location_name: "InputSerialization")) SelectParameters.add_member(:expression_type, Shapes::ShapeRef.new(shape: ExpressionType, required: true, location_name: "ExpressionType")) SelectParameters.add_member(:expression, Shapes::ShapeRef.new(shape: Expression, required: true, location_name: "Expression")) SelectParameters.add_member(:output_serialization, Shapes::ShapeRef.new(shape: OutputSerialization, required: true, location_name: "OutputSerialization")) SelectParameters.struct_class = Types::SelectParameters ServerSideEncryptionByDefault.add_member(:sse_algorithm, Shapes::ShapeRef.new(shape: ServerSideEncryption, required: true, location_name: "SSEAlgorithm")) ServerSideEncryptionByDefault.add_member(:kms_master_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location_name: "KMSMasterKeyID")) ServerSideEncryptionByDefault.struct_class = Types::ServerSideEncryptionByDefault ServerSideEncryptionConfiguration.add_member(:rules, Shapes::ShapeRef.new(shape: ServerSideEncryptionRules, required: true, location_name: "Rule")) ServerSideEncryptionConfiguration.struct_class = Types::ServerSideEncryptionConfiguration ServerSideEncryptionRule.add_member(:apply_server_side_encryption_by_default, Shapes::ShapeRef.new(shape: ServerSideEncryptionByDefault, location_name: "ApplyServerSideEncryptionByDefault")) ServerSideEncryptionRule.struct_class = Types::ServerSideEncryptionRule ServerSideEncryptionRules.member = Shapes::ShapeRef.new(shape: ServerSideEncryptionRule) SourceSelectionCriteria.add_member(:sse_kms_encrypted_objects, Shapes::ShapeRef.new(shape: SseKmsEncryptedObjects, location_name: "SseKmsEncryptedObjects")) SourceSelectionCriteria.struct_class = Types::SourceSelectionCriteria SseKmsEncryptedObjects.add_member(:status, Shapes::ShapeRef.new(shape: SseKmsEncryptedObjectsStatus, required: true, location_name: "Status")) SseKmsEncryptedObjects.struct_class = Types::SseKmsEncryptedObjects Stats.add_member(:bytes_scanned, Shapes::ShapeRef.new(shape: BytesScanned, location_name: "BytesScanned")) Stats.add_member(:bytes_processed, Shapes::ShapeRef.new(shape: BytesProcessed, location_name: "BytesProcessed")) Stats.add_member(:bytes_returned, Shapes::ShapeRef.new(shape: BytesReturned, location_name: "BytesReturned")) Stats.struct_class = Types::Stats StatsEvent.add_member(:details, Shapes::ShapeRef.new(shape: Stats, eventpayload: true, eventpayload_type: 'structure', location_name: "Details", metadata: {"eventpayload"=>true})) StatsEvent.struct_class = Types::StatsEvent StorageClassAnalysis.add_member(:data_export, Shapes::ShapeRef.new(shape: StorageClassAnalysisDataExport, location_name: "DataExport")) StorageClassAnalysis.struct_class = Types::StorageClassAnalysis StorageClassAnalysisDataExport.add_member(:output_schema_version, Shapes::ShapeRef.new(shape: StorageClassAnalysisSchemaVersion, required: true, location_name: "OutputSchemaVersion")) StorageClassAnalysisDataExport.add_member(:destination, Shapes::ShapeRef.new(shape: AnalyticsExportDestination, required: true, location_name: "Destination")) StorageClassAnalysisDataExport.struct_class = Types::StorageClassAnalysisDataExport Tag.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location_name: "Key")) Tag.add_member(:value, Shapes::ShapeRef.new(shape: Value, required: true, location_name: "Value")) Tag.struct_class = Types::Tag TagSet.member = Shapes::ShapeRef.new(shape: Tag, location_name: "Tag") Tagging.add_member(:tag_set, Shapes::ShapeRef.new(shape: TagSet, required: true, location_name: "TagSet")) Tagging.struct_class = Types::Tagging TargetGrant.add_member(:grantee, Shapes::ShapeRef.new(shape: Grantee, location_name: "Grantee")) TargetGrant.add_member(:permission, Shapes::ShapeRef.new(shape: BucketLogsPermission, location_name: "Permission")) TargetGrant.struct_class = Types::TargetGrant TargetGrants.member = Shapes::ShapeRef.new(shape: TargetGrant, location_name: "Grant") TopicConfiguration.add_member(:id, Shapes::ShapeRef.new(shape: NotificationId, location_name: "Id")) TopicConfiguration.add_member(:topic_arn, Shapes::ShapeRef.new(shape: TopicArn, required: true, location_name: "Topic")) TopicConfiguration.add_member(:events, Shapes::ShapeRef.new(shape: EventList, required: true, location_name: "Event")) TopicConfiguration.add_member(:filter, Shapes::ShapeRef.new(shape: NotificationConfigurationFilter, location_name: "Filter")) TopicConfiguration.struct_class = Types::TopicConfiguration TopicConfigurationDeprecated.add_member(:id, Shapes::ShapeRef.new(shape: NotificationId, location_name: "Id")) TopicConfigurationDeprecated.add_member(:events, Shapes::ShapeRef.new(shape: EventList, location_name: "Event")) TopicConfigurationDeprecated.add_member(:event, Shapes::ShapeRef.new(shape: Event, deprecated: true, location_name: "Event")) TopicConfigurationDeprecated.add_member(:topic, Shapes::ShapeRef.new(shape: TopicArn, location_name: "Topic")) TopicConfigurationDeprecated.struct_class = Types::TopicConfigurationDeprecated TopicConfigurationList.member = Shapes::ShapeRef.new(shape: TopicConfiguration) Transition.add_member(:date, Shapes::ShapeRef.new(shape: Date, location_name: "Date")) Transition.add_member(:days, Shapes::ShapeRef.new(shape: Days, location_name: "Days")) Transition.add_member(:storage_class, Shapes::ShapeRef.new(shape: TransitionStorageClass, location_name: "StorageClass")) Transition.struct_class = Types::Transition TransitionList.member = Shapes::ShapeRef.new(shape: Transition) UploadPartCopyOutput.add_member(:copy_source_version_id, Shapes::ShapeRef.new(shape: CopySourceVersionId, location: "header", location_name: "x-amz-copy-source-version-id")) UploadPartCopyOutput.add_member(:copy_part_result, Shapes::ShapeRef.new(shape: CopyPartResult, location_name: "CopyPartResult")) UploadPartCopyOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) UploadPartCopyOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) UploadPartCopyOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) UploadPartCopyOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) UploadPartCopyOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) UploadPartCopyOutput.struct_class = Types::UploadPartCopyOutput UploadPartCopyOutput[:payload] = :copy_part_result UploadPartCopyOutput[:payload_member] = UploadPartCopyOutput.member(:copy_part_result) UploadPartCopyRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) UploadPartCopyRequest.add_member(:copy_source, Shapes::ShapeRef.new(shape: CopySource, required: true, location: "header", location_name: "x-amz-copy-source")) UploadPartCopyRequest.add_member(:copy_source_if_match, Shapes::ShapeRef.new(shape: CopySourceIfMatch, location: "header", location_name: "x-amz-copy-source-if-match")) UploadPartCopyRequest.add_member(:copy_source_if_modified_since, Shapes::ShapeRef.new(shape: CopySourceIfModifiedSince, location: "header", location_name: "x-amz-copy-source-if-modified-since")) UploadPartCopyRequest.add_member(:copy_source_if_none_match, Shapes::ShapeRef.new(shape: CopySourceIfNoneMatch, location: "header", location_name: "x-amz-copy-source-if-none-match")) UploadPartCopyRequest.add_member(:copy_source_if_unmodified_since, Shapes::ShapeRef.new(shape: CopySourceIfUnmodifiedSince, location: "header", location_name: "x-amz-copy-source-if-unmodified-since")) UploadPartCopyRequest.add_member(:copy_source_range, Shapes::ShapeRef.new(shape: CopySourceRange, location: "header", location_name: "x-amz-copy-source-range")) UploadPartCopyRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) UploadPartCopyRequest.add_member(:part_number, Shapes::ShapeRef.new(shape: PartNumber, required: true, location: "querystring", location_name: "partNumber")) UploadPartCopyRequest.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, required: true, location: "querystring", location_name: "uploadId")) UploadPartCopyRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) UploadPartCopyRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) UploadPartCopyRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) UploadPartCopyRequest.add_member(:copy_source_sse_customer_algorithm, Shapes::ShapeRef.new(shape: CopySourceSSECustomerAlgorithm, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-algorithm")) UploadPartCopyRequest.add_member(:copy_source_sse_customer_key, Shapes::ShapeRef.new(shape: CopySourceSSECustomerKey, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-key")) UploadPartCopyRequest.add_member(:copy_source_sse_customer_key_md5, Shapes::ShapeRef.new(shape: CopySourceSSECustomerKeyMD5, location: "header", location_name: "x-amz-copy-source-server-side-encryption-customer-key-MD5")) UploadPartCopyRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) UploadPartCopyRequest.struct_class = Types::UploadPartCopyRequest UploadPartOutput.add_member(:server_side_encryption, Shapes::ShapeRef.new(shape: ServerSideEncryption, location: "header", location_name: "x-amz-server-side-encryption")) UploadPartOutput.add_member(:etag, Shapes::ShapeRef.new(shape: ETag, location: "header", location_name: "ETag")) UploadPartOutput.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) UploadPartOutput.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) UploadPartOutput.add_member(:ssekms_key_id, Shapes::ShapeRef.new(shape: SSEKMSKeyId, location: "header", location_name: "x-amz-server-side-encryption-aws-kms-key-id")) UploadPartOutput.add_member(:request_charged, Shapes::ShapeRef.new(shape: RequestCharged, location: "header", location_name: "x-amz-request-charged")) UploadPartOutput.struct_class = Types::UploadPartOutput UploadPartRequest.add_member(:body, Shapes::ShapeRef.new(shape: Body, location_name: "Body", metadata: {"streaming"=>true})) UploadPartRequest.add_member(:bucket, Shapes::ShapeRef.new(shape: BucketName, required: true, location: "uri", location_name: "Bucket")) UploadPartRequest.add_member(:content_length, Shapes::ShapeRef.new(shape: ContentLength, location: "header", location_name: "Content-Length")) UploadPartRequest.add_member(:content_md5, Shapes::ShapeRef.new(shape: ContentMD5, location: "header", location_name: "Content-MD5")) UploadPartRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key")) UploadPartRequest.add_member(:part_number, Shapes::ShapeRef.new(shape: PartNumber, required: true, location: "querystring", location_name: "partNumber")) UploadPartRequest.add_member(:upload_id, Shapes::ShapeRef.new(shape: MultipartUploadId, required: true, location: "querystring", location_name: "uploadId")) UploadPartRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm")) UploadPartRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key")) UploadPartRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5")) UploadPartRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer")) UploadPartRequest.struct_class = Types::UploadPartRequest UploadPartRequest[:payload] = :body UploadPartRequest[:payload_member] = UploadPartRequest.member(:body) UserMetadata.member = Shapes::ShapeRef.new(shape: MetadataEntry, location_name: "MetadataEntry") VersioningConfiguration.add_member(:mfa_delete, Shapes::ShapeRef.new(shape: MFADelete, location_name: "MfaDelete")) VersioningConfiguration.add_member(:status, Shapes::ShapeRef.new(shape: BucketVersioningStatus, location_name: "Status")) VersioningConfiguration.struct_class = Types::VersioningConfiguration WebsiteConfiguration.add_member(:error_document, Shapes::ShapeRef.new(shape: ErrorDocument, location_name: "ErrorDocument")) WebsiteConfiguration.add_member(:index_document, Shapes::ShapeRef.new(shape: IndexDocument, location_name: "IndexDocument")) WebsiteConfiguration.add_member(:redirect_all_requests_to, Shapes::ShapeRef.new(shape: RedirectAllRequestsTo, location_name: "RedirectAllRequestsTo")) WebsiteConfiguration.add_member(:routing_rules, Shapes::ShapeRef.new(shape: RoutingRules, location_name: "RoutingRules")) WebsiteConfiguration.struct_class = Types::WebsiteConfiguration # @api private API = Seahorse::Model::Api.new.tap do |api| api.version = "2006-03-01" api.metadata = { "apiVersion" => "2006-03-01", "checksumFormat" => "md5", "endpointPrefix" => "s3", "globalEndpoint" => "s3.amazonaws.com", "protocol" => "rest-xml", "serviceAbbreviation" => "Amazon S3", "serviceFullName" => "Amazon Simple Storage Service", "serviceId" => "S3", "uid" => "s3-2006-03-01", } api.add_operation(:abort_multipart_upload, Seahorse::Model::Operation.new.tap do |o| o.name = "AbortMultipartUpload" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: AbortMultipartUploadRequest) o.output = Shapes::ShapeRef.new(shape: AbortMultipartUploadOutput) o.errors << Shapes::ShapeRef.new(shape: NoSuchUpload) end) api.add_operation(:complete_multipart_upload, Seahorse::Model::Operation.new.tap do |o| o.name = "CompleteMultipartUpload" o.http_method = "POST" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: CompleteMultipartUploadRequest) o.output = Shapes::ShapeRef.new(shape: CompleteMultipartUploadOutput) end) api.add_operation(:copy_object, Seahorse::Model::Operation.new.tap do |o| o.name = "CopyObject" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: CopyObjectRequest) o.output = Shapes::ShapeRef.new(shape: CopyObjectOutput) o.errors << Shapes::ShapeRef.new(shape: ObjectNotInActiveTierError) end) api.add_operation(:create_bucket, Seahorse::Model::Operation.new.tap do |o| o.name = "CreateBucket" o.http_method = "PUT" o.http_request_uri = "/{Bucket}" o.input = Shapes::ShapeRef.new(shape: CreateBucketRequest) o.output = Shapes::ShapeRef.new(shape: CreateBucketOutput) o.errors << Shapes::ShapeRef.new(shape: BucketAlreadyExists) o.errors << Shapes::ShapeRef.new(shape: BucketAlreadyOwnedByYou) end) api.add_operation(:create_multipart_upload, Seahorse::Model::Operation.new.tap do |o| o.name = "CreateMultipartUpload" o.http_method = "POST" o.http_request_uri = "/{Bucket}/{Key+}?uploads" o.input = Shapes::ShapeRef.new(shape: CreateMultipartUploadRequest) o.output = Shapes::ShapeRef.new(shape: CreateMultipartUploadOutput) end) api.add_operation(:delete_bucket, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucket" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}" o.input = Shapes::ShapeRef.new(shape: DeleteBucketRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_analytics_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketAnalyticsConfiguration" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?analytics" o.input = Shapes::ShapeRef.new(shape: DeleteBucketAnalyticsConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_cors, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketCors" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?cors" o.input = Shapes::ShapeRef.new(shape: DeleteBucketCorsRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_encryption, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketEncryption" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?encryption" o.input = Shapes::ShapeRef.new(shape: DeleteBucketEncryptionRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_inventory_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketInventoryConfiguration" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?inventory" o.input = Shapes::ShapeRef.new(shape: DeleteBucketInventoryConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_lifecycle, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketLifecycle" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?lifecycle" o.input = Shapes::ShapeRef.new(shape: DeleteBucketLifecycleRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_metrics_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketMetricsConfiguration" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?metrics" o.input = Shapes::ShapeRef.new(shape: DeleteBucketMetricsConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_policy, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketPolicy" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?policy" o.input = Shapes::ShapeRef.new(shape: DeleteBucketPolicyRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_replication, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketReplication" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?replication" o.input = Shapes::ShapeRef.new(shape: DeleteBucketReplicationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_tagging, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketTagging" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?tagging" o.input = Shapes::ShapeRef.new(shape: DeleteBucketTaggingRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_bucket_website, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteBucketWebsite" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?website" o.input = Shapes::ShapeRef.new(shape: DeleteBucketWebsiteRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:delete_object, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteObject" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: DeleteObjectRequest) o.output = Shapes::ShapeRef.new(shape: DeleteObjectOutput) end) api.add_operation(:delete_object_tagging, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteObjectTagging" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}/{Key+}?tagging" o.input = Shapes::ShapeRef.new(shape: DeleteObjectTaggingRequest) o.output = Shapes::ShapeRef.new(shape: DeleteObjectTaggingOutput) end) api.add_operation(:delete_objects, Seahorse::Model::Operation.new.tap do |o| o.name = "DeleteObjects" o.http_method = "POST" o.http_request_uri = "/{Bucket}?delete" o.input = Shapes::ShapeRef.new(shape: DeleteObjectsRequest) o.output = Shapes::ShapeRef.new(shape: DeleteObjectsOutput) end) api.add_operation(:delete_public_access_block, Seahorse::Model::Operation.new.tap do |o| o.name = "DeletePublicAccessBlock" o.http_method = "DELETE" o.http_request_uri = "/{Bucket}?publicAccessBlock" o.input = Shapes::ShapeRef.new(shape: DeletePublicAccessBlockRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:get_bucket_accelerate_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketAccelerateConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?accelerate" o.input = Shapes::ShapeRef.new(shape: GetBucketAccelerateConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketAccelerateConfigurationOutput) end) api.add_operation(:get_bucket_acl, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketAcl" o.http_method = "GET" o.http_request_uri = "/{Bucket}?acl" o.input = Shapes::ShapeRef.new(shape: GetBucketAclRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketAclOutput) end) api.add_operation(:get_bucket_analytics_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketAnalyticsConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?analytics" o.input = Shapes::ShapeRef.new(shape: GetBucketAnalyticsConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketAnalyticsConfigurationOutput) end) api.add_operation(:get_bucket_cors, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketCors" o.http_method = "GET" o.http_request_uri = "/{Bucket}?cors" o.input = Shapes::ShapeRef.new(shape: GetBucketCorsRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketCorsOutput) end) api.add_operation(:get_bucket_encryption, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketEncryption" o.http_method = "GET" o.http_request_uri = "/{Bucket}?encryption" o.input = Shapes::ShapeRef.new(shape: GetBucketEncryptionRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketEncryptionOutput) end) api.add_operation(:get_bucket_inventory_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketInventoryConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?inventory" o.input = Shapes::ShapeRef.new(shape: GetBucketInventoryConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketInventoryConfigurationOutput) end) api.add_operation(:get_bucket_lifecycle, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketLifecycle" o.http_method = "GET" o.http_request_uri = "/{Bucket}?lifecycle" o.deprecated = true o.input = Shapes::ShapeRef.new(shape: GetBucketLifecycleRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketLifecycleOutput) end) api.add_operation(:get_bucket_lifecycle_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketLifecycleConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?lifecycle" o.input = Shapes::ShapeRef.new(shape: GetBucketLifecycleConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketLifecycleConfigurationOutput) end) api.add_operation(:get_bucket_location, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketLocation" o.http_method = "GET" o.http_request_uri = "/{Bucket}?location" o.input = Shapes::ShapeRef.new(shape: GetBucketLocationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketLocationOutput) end) api.add_operation(:get_bucket_logging, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketLogging" o.http_method = "GET" o.http_request_uri = "/{Bucket}?logging" o.input = Shapes::ShapeRef.new(shape: GetBucketLoggingRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketLoggingOutput) end) api.add_operation(:get_bucket_metrics_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketMetricsConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?metrics" o.input = Shapes::ShapeRef.new(shape: GetBucketMetricsConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketMetricsConfigurationOutput) end) api.add_operation(:get_bucket_notification, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketNotification" o.http_method = "GET" o.http_request_uri = "/{Bucket}?notification" o.deprecated = true o.input = Shapes::ShapeRef.new(shape: GetBucketNotificationConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: NotificationConfigurationDeprecated) end) api.add_operation(:get_bucket_notification_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketNotificationConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?notification" o.input = Shapes::ShapeRef.new(shape: GetBucketNotificationConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: NotificationConfiguration) end) api.add_operation(:get_bucket_policy, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketPolicy" o.http_method = "GET" o.http_request_uri = "/{Bucket}?policy" o.input = Shapes::ShapeRef.new(shape: GetBucketPolicyRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketPolicyOutput) end) api.add_operation(:get_bucket_policy_status, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketPolicyStatus" o.http_method = "GET" o.http_request_uri = "/{Bucket}?policyStatus" o.input = Shapes::ShapeRef.new(shape: GetBucketPolicyStatusRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketPolicyStatusOutput) end) api.add_operation(:get_bucket_replication, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketReplication" o.http_method = "GET" o.http_request_uri = "/{Bucket}?replication" o.input = Shapes::ShapeRef.new(shape: GetBucketReplicationRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketReplicationOutput) end) api.add_operation(:get_bucket_request_payment, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketRequestPayment" o.http_method = "GET" o.http_request_uri = "/{Bucket}?requestPayment" o.input = Shapes::ShapeRef.new(shape: GetBucketRequestPaymentRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketRequestPaymentOutput) end) api.add_operation(:get_bucket_tagging, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketTagging" o.http_method = "GET" o.http_request_uri = "/{Bucket}?tagging" o.input = Shapes::ShapeRef.new(shape: GetBucketTaggingRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketTaggingOutput) end) api.add_operation(:get_bucket_versioning, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketVersioning" o.http_method = "GET" o.http_request_uri = "/{Bucket}?versioning" o.input = Shapes::ShapeRef.new(shape: GetBucketVersioningRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketVersioningOutput) end) api.add_operation(:get_bucket_website, Seahorse::Model::Operation.new.tap do |o| o.name = "GetBucketWebsite" o.http_method = "GET" o.http_request_uri = "/{Bucket}?website" o.input = Shapes::ShapeRef.new(shape: GetBucketWebsiteRequest) o.output = Shapes::ShapeRef.new(shape: GetBucketWebsiteOutput) end) api.add_operation(:get_object, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObject" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: GetObjectRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectOutput) o.errors << Shapes::ShapeRef.new(shape: NoSuchKey) end) api.add_operation(:get_object_acl, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObjectAcl" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}?acl" o.input = Shapes::ShapeRef.new(shape: GetObjectAclRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectAclOutput) o.errors << Shapes::ShapeRef.new(shape: NoSuchKey) end) api.add_operation(:get_object_legal_hold, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObjectLegalHold" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}?legal-hold" o.input = Shapes::ShapeRef.new(shape: GetObjectLegalHoldRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectLegalHoldOutput) end) api.add_operation(:get_object_lock_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObjectLockConfiguration" o.http_method = "GET" o.http_request_uri = "/{Bucket}?object-lock" o.input = Shapes::ShapeRef.new(shape: GetObjectLockConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectLockConfigurationOutput) end) api.add_operation(:get_object_retention, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObjectRetention" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}?retention" o.input = Shapes::ShapeRef.new(shape: GetObjectRetentionRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectRetentionOutput) end) api.add_operation(:get_object_tagging, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObjectTagging" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}?tagging" o.input = Shapes::ShapeRef.new(shape: GetObjectTaggingRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectTaggingOutput) end) api.add_operation(:get_object_torrent, Seahorse::Model::Operation.new.tap do |o| o.name = "GetObjectTorrent" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}?torrent" o.input = Shapes::ShapeRef.new(shape: GetObjectTorrentRequest) o.output = Shapes::ShapeRef.new(shape: GetObjectTorrentOutput) end) api.add_operation(:get_public_access_block, Seahorse::Model::Operation.new.tap do |o| o.name = "GetPublicAccessBlock" o.http_method = "GET" o.http_request_uri = "/{Bucket}?publicAccessBlock" o.input = Shapes::ShapeRef.new(shape: GetPublicAccessBlockRequest) o.output = Shapes::ShapeRef.new(shape: GetPublicAccessBlockOutput) end) api.add_operation(:head_bucket, Seahorse::Model::Operation.new.tap do |o| o.name = "HeadBucket" o.http_method = "HEAD" o.http_request_uri = "/{Bucket}" o.input = Shapes::ShapeRef.new(shape: HeadBucketRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) o.errors << Shapes::ShapeRef.new(shape: NoSuchBucket) end) api.add_operation(:head_object, Seahorse::Model::Operation.new.tap do |o| o.name = "HeadObject" o.http_method = "HEAD" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: HeadObjectRequest) o.output = Shapes::ShapeRef.new(shape: HeadObjectOutput) o.errors << Shapes::ShapeRef.new(shape: NoSuchKey) end) api.add_operation(:list_bucket_analytics_configurations, Seahorse::Model::Operation.new.tap do |o| o.name = "ListBucketAnalyticsConfigurations" o.http_method = "GET" o.http_request_uri = "/{Bucket}?analytics" o.input = Shapes::ShapeRef.new(shape: ListBucketAnalyticsConfigurationsRequest) o.output = Shapes::ShapeRef.new(shape: ListBucketAnalyticsConfigurationsOutput) end) api.add_operation(:list_bucket_inventory_configurations, Seahorse::Model::Operation.new.tap do |o| o.name = "ListBucketInventoryConfigurations" o.http_method = "GET" o.http_request_uri = "/{Bucket}?inventory" o.input = Shapes::ShapeRef.new(shape: ListBucketInventoryConfigurationsRequest) o.output = Shapes::ShapeRef.new(shape: ListBucketInventoryConfigurationsOutput) end) api.add_operation(:list_bucket_metrics_configurations, Seahorse::Model::Operation.new.tap do |o| o.name = "ListBucketMetricsConfigurations" o.http_method = "GET" o.http_request_uri = "/{Bucket}?metrics" o.input = Shapes::ShapeRef.new(shape: ListBucketMetricsConfigurationsRequest) o.output = Shapes::ShapeRef.new(shape: ListBucketMetricsConfigurationsOutput) end) api.add_operation(:list_buckets, Seahorse::Model::Operation.new.tap do |o| o.name = "ListBuckets" o.http_method = "GET" o.http_request_uri = "/" o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) o.output = Shapes::ShapeRef.new(shape: ListBucketsOutput) end) api.add_operation(:list_multipart_uploads, Seahorse::Model::Operation.new.tap do |o| o.name = "ListMultipartUploads" o.http_method = "GET" o.http_request_uri = "/{Bucket}?uploads" o.input = Shapes::ShapeRef.new(shape: ListMultipartUploadsRequest) o.output = Shapes::ShapeRef.new(shape: ListMultipartUploadsOutput) o[:pager] = Aws::Pager.new( more_results: "is_truncated", limit_key: "max_uploads", tokens: { "next_key_marker" => "key_marker", "next_upload_id_marker" => "upload_id_marker" } ) end) api.add_operation(:list_object_versions, Seahorse::Model::Operation.new.tap do |o| o.name = "ListObjectVersions" o.http_method = "GET" o.http_request_uri = "/{Bucket}?versions" o.input = Shapes::ShapeRef.new(shape: ListObjectVersionsRequest) o.output = Shapes::ShapeRef.new(shape: ListObjectVersionsOutput) o[:pager] = Aws::Pager.new( more_results: "is_truncated", limit_key: "max_keys", tokens: { "next_key_marker" => "key_marker", "next_version_id_marker" => "version_id_marker" } ) end) api.add_operation(:list_objects, Seahorse::Model::Operation.new.tap do |o| o.name = "ListObjects" o.http_method = "GET" o.http_request_uri = "/{Bucket}" o.input = Shapes::ShapeRef.new(shape: ListObjectsRequest) o.output = Shapes::ShapeRef.new(shape: ListObjectsOutput) o.errors << Shapes::ShapeRef.new(shape: NoSuchBucket) o[:pager] = Aws::Pager.new( more_results: "is_truncated", limit_key: "max_keys", tokens: { "next_marker || contents[-1].key" => "marker" } ) end) api.add_operation(:list_objects_v2, Seahorse::Model::Operation.new.tap do |o| o.name = "ListObjectsV2" o.http_method = "GET" o.http_request_uri = "/{Bucket}?list-type=2" o.input = Shapes::ShapeRef.new(shape: ListObjectsV2Request) o.output = Shapes::ShapeRef.new(shape: ListObjectsV2Output) o.errors << Shapes::ShapeRef.new(shape: NoSuchBucket) o[:pager] = Aws::Pager.new( limit_key: "max_keys", tokens: { "next_continuation_token" => "continuation_token" } ) end) api.add_operation(:list_parts, Seahorse::Model::Operation.new.tap do |o| o.name = "ListParts" o.http_method = "GET" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: ListPartsRequest) o.output = Shapes::ShapeRef.new(shape: ListPartsOutput) o[:pager] = Aws::Pager.new( more_results: "is_truncated", limit_key: "max_parts", tokens: { "next_part_number_marker" => "part_number_marker" } ) end) api.add_operation(:put_bucket_accelerate_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketAccelerateConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?accelerate" o.input = Shapes::ShapeRef.new(shape: PutBucketAccelerateConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_acl, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketAcl" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?acl" o.input = Shapes::ShapeRef.new(shape: PutBucketAclRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_analytics_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketAnalyticsConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?analytics" o.input = Shapes::ShapeRef.new(shape: PutBucketAnalyticsConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_cors, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketCors" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?cors" o.input = Shapes::ShapeRef.new(shape: PutBucketCorsRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_encryption, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketEncryption" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?encryption" o.input = Shapes::ShapeRef.new(shape: PutBucketEncryptionRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_inventory_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketInventoryConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?inventory" o.input = Shapes::ShapeRef.new(shape: PutBucketInventoryConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_lifecycle, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketLifecycle" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?lifecycle" o.deprecated = true o.input = Shapes::ShapeRef.new(shape: PutBucketLifecycleRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_lifecycle_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketLifecycleConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?lifecycle" o.input = Shapes::ShapeRef.new(shape: PutBucketLifecycleConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_logging, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketLogging" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?logging" o.input = Shapes::ShapeRef.new(shape: PutBucketLoggingRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_metrics_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketMetricsConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?metrics" o.input = Shapes::ShapeRef.new(shape: PutBucketMetricsConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_notification, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketNotification" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?notification" o.deprecated = true o.input = Shapes::ShapeRef.new(shape: PutBucketNotificationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_notification_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketNotificationConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?notification" o.input = Shapes::ShapeRef.new(shape: PutBucketNotificationConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_policy, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketPolicy" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?policy" o.input = Shapes::ShapeRef.new(shape: PutBucketPolicyRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_replication, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketReplication" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?replication" o.input = Shapes::ShapeRef.new(shape: PutBucketReplicationRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_request_payment, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketRequestPayment" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?requestPayment" o.input = Shapes::ShapeRef.new(shape: PutBucketRequestPaymentRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_tagging, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketTagging" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?tagging" o.input = Shapes::ShapeRef.new(shape: PutBucketTaggingRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_versioning, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketVersioning" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?versioning" o.input = Shapes::ShapeRef.new(shape: PutBucketVersioningRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_bucket_website, Seahorse::Model::Operation.new.tap do |o| o.name = "PutBucketWebsite" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?website" o.input = Shapes::ShapeRef.new(shape: PutBucketWebsiteRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:put_object, Seahorse::Model::Operation.new.tap do |o| o.name = "PutObject" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: PutObjectRequest) o.output = Shapes::ShapeRef.new(shape: PutObjectOutput) end) api.add_operation(:put_object_acl, Seahorse::Model::Operation.new.tap do |o| o.name = "PutObjectAcl" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}?acl" o.input = Shapes::ShapeRef.new(shape: PutObjectAclRequest) o.output = Shapes::ShapeRef.new(shape: PutObjectAclOutput) o.errors << Shapes::ShapeRef.new(shape: NoSuchKey) end) api.add_operation(:put_object_legal_hold, Seahorse::Model::Operation.new.tap do |o| o.name = "PutObjectLegalHold" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}?legal-hold" o.input = Shapes::ShapeRef.new(shape: PutObjectLegalHoldRequest) o.output = Shapes::ShapeRef.new(shape: PutObjectLegalHoldOutput) end) api.add_operation(:put_object_lock_configuration, Seahorse::Model::Operation.new.tap do |o| o.name = "PutObjectLockConfiguration" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?object-lock" o.input = Shapes::ShapeRef.new(shape: PutObjectLockConfigurationRequest) o.output = Shapes::ShapeRef.new(shape: PutObjectLockConfigurationOutput) end) api.add_operation(:put_object_retention, Seahorse::Model::Operation.new.tap do |o| o.name = "PutObjectRetention" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}?retention" o.input = Shapes::ShapeRef.new(shape: PutObjectRetentionRequest) o.output = Shapes::ShapeRef.new(shape: PutObjectRetentionOutput) end) api.add_operation(:put_object_tagging, Seahorse::Model::Operation.new.tap do |o| o.name = "PutObjectTagging" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}?tagging" o.input = Shapes::ShapeRef.new(shape: PutObjectTaggingRequest) o.output = Shapes::ShapeRef.new(shape: PutObjectTaggingOutput) end) api.add_operation(:put_public_access_block, Seahorse::Model::Operation.new.tap do |o| o.name = "PutPublicAccessBlock" o.http_method = "PUT" o.http_request_uri = "/{Bucket}?publicAccessBlock" o.input = Shapes::ShapeRef.new(shape: PutPublicAccessBlockRequest) o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure)) end) api.add_operation(:restore_object, Seahorse::Model::Operation.new.tap do |o| o.name = "RestoreObject" o.http_method = "POST" o.http_request_uri = "/{Bucket}/{Key+}?restore" o.input = Shapes::ShapeRef.new(shape: RestoreObjectRequest) o.output = Shapes::ShapeRef.new(shape: RestoreObjectOutput) o.errors << Shapes::ShapeRef.new(shape: ObjectAlreadyInActiveTierError) end) api.add_operation(:select_object_content, Seahorse::Model::Operation.new.tap do |o| o.name = "SelectObjectContent" o.http_method = "POST" o.http_request_uri = "/{Bucket}/{Key+}?select&select-type=2" o.input = Shapes::ShapeRef.new(shape: SelectObjectContentRequest, location_name: "SelectObjectContentRequest", metadata: { "xmlNamespace" => {"uri"=>"http://s3.amazonaws.com/doc/2006-03-01/"} } ) o.output = Shapes::ShapeRef.new(shape: SelectObjectContentOutput) end) api.add_operation(:upload_part, Seahorse::Model::Operation.new.tap do |o| o.name = "UploadPart" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: UploadPartRequest) o.output = Shapes::ShapeRef.new(shape: UploadPartOutput) end) api.add_operation(:upload_part_copy, Seahorse::Model::Operation.new.tap do |o| o.name = "UploadPartCopy" o.http_method = "PUT" o.http_request_uri = "/{Bucket}/{Key+}" o.input = Shapes::ShapeRef.new(shape: UploadPartCopyRequest) o.output = Shapes::ShapeRef.new(shape: UploadPartCopyOutput) end) end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/0000755000004100000410000000000013536452011017653 5ustar www-datawww-dataaws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/expect_100_continue.rb0000644000004100000410000000125413536452011023756 0ustar www-datawww-datamodule Aws module S3 module Plugins class Expect100Continue < Seahorse::Client::Plugin def add_handlers(handlers, config) if config.http_continue_timeout && config.http_continue_timeout > 0 handlers.add(Handler) end end # @api private class Handler < Seahorse::Client::Handler def call(context) if context.http_request.body && context.http_request.body.size > 0 then context.http_request.headers['expect'] = '100-continue' end @handler.call(context) end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/s3_signer.rb0000644000004100000410000001557013536452011022104 0ustar www-datawww-datarequire 'aws-sigv4' module Aws module S3 module Plugins # This plugin is an implementation detail and may be modified. # @api private class S3Signer < Seahorse::Client::Plugin option(:signature_version, 'v4') option(:sigv4_signer) do |cfg| S3Signer.build_v4_signer( region: cfg.sigv4_region, credentials: cfg.credentials ) end option(:sigv4_region) do |cfg| Aws::Partitions::EndpointProvider.signing_region(cfg.region, 's3') end def add_handlers(handlers, cfg) case cfg.signature_version when 'v4' then add_v4_handlers(handlers) when 's3' then add_legacy_handler(handlers) else msg = "unsupported signature version `#{cfg.signature_version}'" raise ArgumentError, msg end end def add_v4_handlers(handlers) handlers.add(CachedBucketRegionHandler, step: :sign, priority: 60) handlers.add(V4Handler, step: :sign) handlers.add(BucketRegionErrorHandler, step: :sign, priority: 40) end def add_legacy_handler(handlers) handlers.add(LegacyHandler, step: :sign) end class LegacyHandler < Seahorse::Client::Handler def call(context) LegacySigner.sign(context) @handler.call(context) end end class V4Handler < Seahorse::Client::Handler def call(context) Aws::Plugins::SignatureV4.apply_signature( context: context, signer: sigv4_signer(context) ) @handler.call(context) end private def sigv4_signer(context) # If the client was configured with the wrong region, # we have to build a new signer. if context[:cached_sigv4_region] && context[:cached_sigv4_region] != context.config.sigv4_signer.region then S3Signer.build_v4_signer( region: context[:cached_sigv4_region], credentials: context.config.credentials ) else context.config.sigv4_signer end end end # This handler will update the http endpoint when the bucket region # is known/cached. class CachedBucketRegionHandler < Seahorse::Client::Handler def call(context) bucket = context.params[:bucket] check_for_cached_region(context, bucket) if bucket @handler.call(context) end private def check_for_cached_region(context, bucket) cached_region = S3::BUCKET_REGIONS[bucket] if cached_region && cached_region != context.config.region context.http_request.endpoint.host = S3Signer.new_hostname(context, cached_region) context[:cached_sigv4_region] = cached_region end end end # This handler detects when a request fails because of a mismatched bucket # region. It follows up by making a request to determine the correct # region, then finally a version 4 signed request against the correct # regional endpoint. class BucketRegionErrorHandler < Seahorse::Client::Handler def call(context) response = @handler.call(context) handle_region_errors(response) end private def handle_region_errors(response) if wrong_sigv4_region?(response) && !fips_region?(response) get_region_and_retry(response.context) else response end end def get_region_and_retry(context) actual_region = context.http_response.headers['x-amz-bucket-region'] actual_region ||= region_from_body(context.http_response.body_contents) update_bucket_cache(context, actual_region) log_warning(context, actual_region) resign_with_new_region(context, actual_region) @handler.call(context) end def update_bucket_cache(context, actual_region) S3::BUCKET_REGIONS[context.params[:bucket]] = actual_region end def fips_region?(resp) resp.context.http_request.endpoint.host.include?('fips') end def wrong_sigv4_region?(resp) resp.context.http_response.status_code == 400 && ( resp.context.http_response.headers['x-amz-bucket-region'] || resp.context.http_response.body_contents.match(/.+?<\/Region>/) ) end def resign_with_new_region(context, actual_region) context.http_response.body.truncate(0) context.http_request.endpoint.host = S3Signer.new_hostname(context, actual_region) context.metadata[:redirect_region] = actual_region Aws::Plugins::SignatureV4.apply_signature( context: context, signer: S3Signer.build_v4_signer( region: actual_region, credentials: context.config.credentials ) ) end def region_from_body(body) region = body.match(/(.+?)<\/Region>/)[1] if region.nil? || region == "" raise "couldn't get region from body: #{body}" else region end end def log_warning(context, actual_region) msg = "S3 client configured for #{context.config.region.inspect} " + "but the bucket #{context.params[:bucket].inspect} is in " + "#{actual_region.inspect}; Please configure the proper region " + "to avoid multiple unnecessary redirects and signing attempts\n" if logger = context.config.logger logger.warn(msg) else warn(msg) end end end class << self # @option options [required, String] :region # @option options [required, #credentials] :credentials # @api private def build_v4_signer(options = {}) Aws::Sigv4::Signer.new({ service: 's3', region: options[:region], credentials_provider: options[:credentials], uri_escape_path: false, unsigned_headers: ['content-length', 'x-amzn-trace-id'], }) end def new_hostname(context, region) bucket = context.params[:bucket] if region == 'us-east-1' "#{bucket}.s3.amazonaws.com" else endpoint = Aws::Partitions::EndpointProvider.resolve(region, 's3') bucket + '.' + URI.parse(endpoint).host end end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/bucket_dns.rb0000644000004100000410000000517413536452011022330 0ustar www-datawww-datamodule Aws module S3 module Plugins # Amazon S3 requires DNS style addressing for buckets outside of # the classic region when possible. class BucketDns < Seahorse::Client::Plugin # When set to `false` DNS compatible bucket names are moved from # the request URI path to the host as a subdomain, unless the request # is using SSL and the bucket name contains a dot. # # When set to `true`, the bucket name is always forced to be part # of the request URI path. This will not work with buckets outside # the classic region. option(:force_path_style, default: false, doc_type: 'Boolean', docstring: <<-DOCS) When set to `true`, the bucket name is always left in the request URI and never moved to the host as a sub-domain. DOCS def add_handlers(handlers, config) handlers.add(Handler) unless config.force_path_style end # @api private class Handler < Seahorse::Client::Handler def call(context) move_dns_compat_bucket_to_subdomain(context) @handler.call(context) end private def move_dns_compat_bucket_to_subdomain(context) bucket_name = context.params[:bucket] endpoint = context.http_request.endpoint if bucket_name && BucketDns.dns_compatible?(bucket_name, https?(endpoint)) && context.operation_name.to_s != 'get_bucket_location' then move_bucket_to_subdomain(bucket_name, endpoint) end end def move_bucket_to_subdomain(bucket_name, endpoint) endpoint.host = "#{bucket_name}.#{endpoint.host}" path = endpoint.path.sub("/#{bucket_name}", '') path = "/#{path}" unless path.match(/^\//) endpoint.path = path end def https?(uri) uri.scheme == 'https' end end class << self # @param [String] bucket_name # @param [Boolean] ssl # @return [Boolean] def dns_compatible?(bucket_name, ssl) if valid_subdomain?(bucket_name) bucket_name.match(/\./) && ssl ? false : true else false end end private def valid_subdomain?(bucket_name) bucket_name.size < 64 && bucket_name =~ /^[a-z0-9][a-z0-9.-]+[a-z0-9]$/ && bucket_name !~ /(\d+\.){3}\d+/ && bucket_name !~ /[.-]{2}/ end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/sse_cpk.rb0000644000004100000410000000364613536452011021640 0ustar www-datawww-datarequire 'uri' require 'openssl' module Aws module S3 module Plugins class SseCpk < Seahorse::Client::Plugin option(:require_https_for_sse_cpk, default: true, doc_type: 'Boolean', docstring: <<-DOCS) When `true`, the endpoint **must** be HTTPS for all operations where server-side-encryption is used with customer-provided keys. This should only be disabled for local testing. DOCS class Handler < Seahorse::Client::Handler def call(context) compute_key_md5(context) @handler.call(context) end private def compute_key_md5(context) params = context.params if key = params[:sse_customer_key] require_https(context) params[:sse_customer_key] = base64(key) params[:sse_customer_key_md5] = base64(md5(key)) end if key = params[:copy_source_sse_customer_key] require_https(context) params[:copy_source_sse_customer_key] = base64(key) params[:copy_source_sse_customer_key_md5] = base64(md5(key)) end end def require_https(context) unless URI::HTTPS === context.config.endpoint msg = <<-MSG.strip.gsub("\n", ' ') Attempting to send customer-provided-keys for S3 server-side-encryption over HTTP; Please configure a HTTPS endpoint. If you are attempting to use a test endpoint, you can disable this check via `:require_https_for_sse_cpk` MSG raise ArgumentError, msg end end def md5(str) OpenSSL::Digest::MD5.digest(str) end def base64(str) Base64.encode64(str).strip end end handler(Handler, step: :initialize) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/dualstack.rb0000644000004100000410000000453113536452011022156 0ustar www-datawww-datamodule Aws module S3 module Plugins # @api private class Dualstack < Seahorse::Client::Plugin option(:use_dualstack_endpoint, default: false, doc_type: 'Boolean', docstring: <<-DOCS) When set to `true`, IPv6-compatible bucket endpoints will be used for all operations. DOCS def add_handlers(handlers, config) handlers.add(OptionHandler, step: :initialize) handlers.add(DualstackHandler, step: :build, priority: 0) end # @api private class OptionHandler < Seahorse::Client::Handler def call(context) dualstack = context.params.delete(:use_dualstack_endpoint) dualstack = context.config.use_dualstack_endpoint if dualstack.nil? context[:use_dualstack_endpoint] = dualstack @handler.call(context) end end # @api private class DualstackHandler < Seahorse::Client::Handler def call(context) apply_dualstack_endpoint(context) if use_dualstack_endpoint?(context) @handler.call(context) end private def apply_dualstack_endpoint(context) bucket_name = context.params[:bucket] region = context.config.region context.config.force_path_style dns_suffix = Aws::Partitions::EndpointProvider.dns_suffix_for(region) if use_bucket_dns?(bucket_name, context) host = "#{bucket_name}.s3.dualstack.#{region}.#{dns_suffix}" else host = "s3.dualstack.#{region}.#{dns_suffix}" end endpoint = URI.parse(context.http_request.endpoint.to_s) endpoint.scheme = context.http_request.endpoint.scheme endpoint.port = context.http_request.endpoint.port endpoint.host = host context.http_request.endpoint = endpoint.to_s end def use_bucket_dns?(bucket_name, context) ssl = context.http_request.endpoint.scheme == "https" bucket_name && BucketDns.dns_compatible?(bucket_name, ssl) && !context.config.force_path_style end def use_dualstack_endpoint?(context) context[:use_dualstack_endpoint] && !context[:use_accelerate_endpoint] end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/http_200_errors.rb0000644000004100000410000000251113536452011023133 0ustar www-datawww-datamodule Aws module S3 module Plugins # A handful of Amazon S3 operations will respond with a 200 status # code but will send an error in the response body. This plugin # injects a handler that will parse 200 response bodies for potential # errors, allowing them to be retried. # @api private class Http200Errors < Seahorse::Client::Plugin class Handler < Seahorse::Client::Handler def call(context) @handler.call(context).on(200) do |response| if error = check_for_error(context) context.http_response.status_code = 500 response.data = nil response.error = error end end end def check_for_error(context) xml = context.http_response.body_contents if xml.match(//) error_code = xml.match(/(.+?)<\/Code>/)[1] error_message = xml.match(/(.+?)<\/Message>/)[1] S3::Errors.error_class(error_code).new(context, error_message) end end end handler(Handler, step: :sign, operations: [ :complete_multipart_upload, :copy_object, :upload_part_copy, ] ) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb0000644000004100000410000000102713536452011025265 0ustar www-datawww-datamodule Aws module S3 module Plugins # @api private class BucketNameRestrictions < Seahorse::Client::Plugin class Handler < Seahorse::Client::Handler def call(context) if context.params.key?(:bucket) && context.params[:bucket].include?('/') msg = ":bucket option must not contain a forward-slash (/)" raise ArgumentError, msg end @handler.call(context) end end handler(Handler) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb0000644000004100000410000000121713536452011025053 0ustar www-datawww-datamodule Aws module S3 module Plugins class GetBucketLocationFix < Seahorse::Client::Plugin class Handler < Seahorse::Client::Handler def call(context) @handler.call(context).on(200) do |response| response.data = S3::Types::GetBucketLocationOutput.new xml = context.http_response.body_contents matches = xml.match(/>(.+?)<\/LocationConstraint>/) response.data[:location_constraint] = matches ? matches[1] : '' end end end handler(Handler, priority: 60, operations: [:get_bucket_location]) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/md5s.rb0000644000004100000410000000462213536452011021054 0ustar www-datawww-datarequire 'openssl' require 'base64' module Aws module S3 module Plugins class Md5s < Seahorse::Client::Plugin # Amazon S3 requires these operations to have an MD5 checksum REQUIRED_OPERATIONS = [ :delete_objects, :put_bucket_cors, :put_bucket_lifecycle, :put_bucket_policy, :put_bucket_tagging, :put_object_legal_hold, :put_object_lock_configuration, :put_object_retention ] # @api private class Handler < Seahorse::Client::Handler CHUNK_SIZE = 1 * 1024 * 1024 # one MB def call(context) body = context.http_request.body if body.size > 0 context.http_request.headers['Content-Md5'] ||= md5(body) end @handler.call(context) end private # @param [File, Tempfile, IO#read, String] value # @return [String] def md5(value) if (File === value || Tempfile === value) && !value.path.nil? && File.exist?(value.path) Base64.encode64(OpenSSL::Digest::MD5.file(value).digest).strip elsif value.respond_to?(:read) md5 = OpenSSL::Digest::MD5.new update_in_chunks(md5, value) Base64.encode64(md5.digest).strip else Base64.encode64(OpenSSL::Digest::MD5.digest(value)).strip end end def update_in_chunks(digest, io) while chunk = io.read(CHUNK_SIZE, buffer ||= "") digest.update(chunk) end io.rewind end end option(:compute_checksums, default: true, doc_type: 'Boolean', docstring: <<-DOCS) When `true` a MD5 checksum will be computed for every request that sends a body. When `false`, MD5 checksums will only be computed for operations that require them. Checksum errors returned by Amazon S3 are automatically retried up to `:retry_limit` times. DOCS def add_handlers(handlers, config) # priority set low to ensure md5 is computed AFTER the request is # built but before it is signed handlers.add(Handler, { priority: 10, step: :build, operations: config.compute_checksums ? nil : REQUIRED_OPERATIONS, }) end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/accelerate.rb0000644000004100000410000000722613536452011022277 0ustar www-datawww-datamodule Aws module S3 module Plugins # Provides support for using `Aws::S3::Client` with Amazon S3 Transfer # Acceleration. # # Go here for more information about transfer acceleration: # [http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) class Accelerate < Seahorse::Client::Plugin option(:use_accelerate_endpoint, default: false, doc_type: 'Boolean', docstring: <<-DOCS) When set to `true`, accelerated bucket endpoints will be used for all object operations. You must first enable accelerate for each bucket. [Go here for more information](http://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html). DOCS def add_handlers(handlers, config) operations = config.api.operation_names - [ :create_bucket, :list_buckets, :delete_bucket, ] handlers.add(OptionHandler, step: :initialize, operations: operations) handlers.add(AccelerateHandler, step: :build, priority: 0, operations: operations) end # @api private class OptionHandler < Seahorse::Client::Handler def call(context) accelerate = context.params.delete(:use_accelerate_endpoint) accelerate = context.config.use_accelerate_endpoint if accelerate.nil? context[:use_accelerate_endpoint] = accelerate @handler.call(context) end end # @api private class AccelerateHandler < Seahorse::Client::Handler def call(context) if context[:use_accelerate_endpoint] if context[:use_dualstack_endpoint] use_combined_accelerate_dualstack_endpoint(context) else use_accelerate_endpoint(context) end end @handler.call(context) end private def use_accelerate_endpoint(context) bucket_name = context.params[:bucket] validate_bucket_name!(bucket_name) endpoint = URI.parse(context.http_request.endpoint.to_s) endpoint.scheme = 'https' endpoint.port = 443 endpoint.host = "#{bucket_name}.s3-accelerate.amazonaws.com" context.http_request.endpoint = endpoint.to_s # s3 accelerate endpoint doesn't work with 'expect' header context.http_request.headers.delete('expect') end def use_combined_accelerate_dualstack_endpoint(context) bucket_name = context.params[:bucket] validate_bucket_name!(bucket_name) endpoint = URI.parse(context.http_request.endpoint.to_s) endpoint.scheme = 'https' endpoint.port = 443 endpoint.host = "#{bucket_name}.s3-accelerate.dualstack.amazonaws.com" context.http_request.endpoint = endpoint.to_s # s3 accelerate endpoint doesn't work with 'expect' header context.http_request.headers.delete('expect') end def validate_bucket_name!(bucket_name) unless BucketDns.dns_compatible?(bucket_name, _ssl = true) msg = "unable to use `accelerate: true` on buckets with " msg << "non-DNS compatible names" raise ArgumentError, msg end if bucket_name.include?('.') msg = "unable to use `accelerate: true` on buckets with dots" msg << "in their name: #{bucket_name.inspect}" raise ArgumentError, msg end end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/location_constraint.rb0000644000004100000410000000167013536452011024260 0ustar www-datawww-datamodule Aws module S3 module Plugins # When making calls to {S3::Client#create_bucket} outside the # "classic" region, the bucket location constraint must be specified. # This plugin auto populates the constraint to the configured region. class LocationConstraint < Seahorse::Client::Plugin class Handler < Seahorse::Client::Handler def call(context) unless context.config.region == 'us-east-1' populate_location_constraint(context.params, context.config.region) end @handler.call(context) end private def populate_location_constraint(params, region) params[:create_bucket_configuration] ||= {} params[:create_bucket_configuration][:location_constraint] ||= region end end handler(Handler, step: :initialize, operations: [:create_bucket]) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/s3_host_id.rb0000644000004100000410000000123413536452011022236 0ustar www-datawww-datamodule Aws module S3 module Plugins # Support S3 host id, more information, see: # http://docs.aws.amazon.com/AmazonS3/latest/dev/troubleshooting.html#sdk-request-ids # # This plugin adds :host_id for s3 responses when available # @api private class S3HostId < Seahorse::Client::Plugin class Handler < Seahorse::Client::Handler def call(context) response = @handler.call(context) h = context.http_response.headers context[:s3_host_id] = h['x-amz-id-2'] response end end handler(Handler, step: :sign) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/url_encoded_keys.rb0000644000004100000410000000572213536452011023524 0ustar www-datawww-datarequire 'uri' require 'cgi' module Aws module S3 module Plugins # This plugin auto-populates the `:encoding_type` request parameter # to all calls made to Amazon S3 that accept it. # # This enables Amazon S3 to return object keys that might contain # invalid XML characters as URL encoded strings. This plugin also # automatically decodes these keys so that the key management is # transparent to the user. # # If you specify the `:encoding_type` parameter, then this plugin # will be disabled, and you will need to decode the keys yourself. # # The following operations are managed: # # * {S3::Client#list_objects} # * {S3::Client#list_multipart_uploads} # * {S3::Client#list_object_versions} # class UrlEncodedKeys < Seahorse::Client::Plugin class Handler < Seahorse::Client::Handler def call(context) if context.params.key?(:encoding_type) @handler.call(context) # user managed else manage_keys(context) end end private def manage_keys(context) context.params[:encoding_type] = 'url' @handler.call(context).on_success do |resp| send("decode_#{resp.context.operation_name}_keys", resp.data) end end def decode_list_objects_keys(data) decode(:marker, data) decode(:next_marker, data) decode(:prefix, data) decode(:delimiter, data) data.contents.each { |o| decode(:key, o) } if data.contents data.common_prefixes.each { |o| decode(:prefix, o) } if data.common_prefixes end def decode_list_object_versions_keys(data) decode(:key_marker, data) decode(:next_key_marker, data) decode(:prefix, data) decode(:delimiter, data) data.versions.each { |o| decode(:key, o) } if data.versions data.delete_markers.each { |o| decode(:key, o) } if data.delete_markers data.common_prefixes.each { |o| decode(:prefix, o) } if data.common_prefixes end def decode_list_multipart_uploads_keys(data) decode(:key_marker, data) decode(:next_key_marker, data) decode(:prefix, data) decode(:delimiter, data) data.uploads.each { |o| decode(:key, o) } if data.uploads data.common_prefixes.each { |o| decode(:prefix, o) } if data.common_prefixes end def decode(member, struct) if struct[member] struct[member] = CGI.unescape(struct[member]) end end end handler(Handler, step: :validate, priority: 0, operations: [ :list_objects, :list_object_versions, :list_multipart_uploads, ] ) end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3/plugins/redirects.rb0000644000004100000410000000216713536452011022172 0ustar www-datawww-datamodule Aws module S3 module Plugins class Redirects < Seahorse::Client::Plugin option(:follow_redirects, default: true, doc_type: 'Boolean', docstring: <<-DOCS) When `true`, this client will follow 307 redirects returned by Amazon S3. DOCS # @api private class Handler < Seahorse::Client::Handler def call(context) response = @handler.call(context) if context.http_response.status_code == 307 endpoint = context.http_response.headers['location'] unless context.http_request.endpoint.host.include?('fips') context.http_request.endpoint = endpoint end context.http_response.body.truncate(0) @handler.call(context) else response end end end def add_handlers(handlers, config) if config.follow_redirects # we want to re-trigger request signing handlers.add(Handler, step: :sign, priority: 90) end end end end end end aws-sdk-s3-1.48.0/lib/aws-sdk-s3.rb0000644000004100000410000000404013536452011016515 0ustar www-datawww-data# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'aws-sdk-kms' require 'aws-sigv4' require 'aws-sdk-core' require_relative 'aws-sdk-s3/types' require_relative 'aws-sdk-s3/client_api' require_relative 'aws-sdk-s3/client' require_relative 'aws-sdk-s3/errors' require_relative 'aws-sdk-s3/waiters' require_relative 'aws-sdk-s3/resource' require_relative 'aws-sdk-s3/bucket' require_relative 'aws-sdk-s3/bucket_acl' require_relative 'aws-sdk-s3/bucket_cors' require_relative 'aws-sdk-s3/bucket_lifecycle' require_relative 'aws-sdk-s3/bucket_lifecycle_configuration' require_relative 'aws-sdk-s3/bucket_logging' require_relative 'aws-sdk-s3/bucket_notification' require_relative 'aws-sdk-s3/bucket_policy' require_relative 'aws-sdk-s3/bucket_request_payment' require_relative 'aws-sdk-s3/bucket_tagging' require_relative 'aws-sdk-s3/bucket_versioning' require_relative 'aws-sdk-s3/bucket_website' require_relative 'aws-sdk-s3/multipart_upload' require_relative 'aws-sdk-s3/multipart_upload_part' require_relative 'aws-sdk-s3/object' require_relative 'aws-sdk-s3/object_acl' require_relative 'aws-sdk-s3/object_summary' require_relative 'aws-sdk-s3/object_version' require_relative 'aws-sdk-s3/customizations' require_relative 'aws-sdk-s3/event_streams' # This module provides support for Amazon Simple Storage Service. This module is available in the # `aws-sdk-s3` gem. # # # Client # # The {Client} class provides one method for each API operation. Operation # methods each accept a hash of request parameters and return a response # structure. # # See {Client} for more information. # # # Errors # # Errors returned from Amazon Simple Storage Service all # extend {Errors::ServiceError}. # # begin # # do stuff # rescue Aws::S3::Errors::ServiceError # # rescues all service API errors # end # # See {Errors} for more information. # # @service module Aws::S3 GEM_VERSION = '1.48.0' end aws-sdk-s3-1.48.0/aws-sdk-s3.gemspec0000644000004100000410000001227113536452011016774 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- # stub: aws-sdk-s3 1.48.0 ruby lib Gem::Specification.new do |s| s.name = "aws-sdk-s3".freeze s.version = "1.48.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "changelog_uri" => "https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-s3/CHANGELOG.md", "source_code_uri" => "https://github.com/aws/aws-sdk-ruby/tree/master/gems/aws-sdk-s3" } if s.respond_to? :metadata= s.require_paths = ["lib".freeze] s.authors = ["Amazon Web Services".freeze] s.date = "2019-08-30" s.description = "Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3). This gem is part of the AWS SDK for Ruby.".freeze s.email = ["trevrowe@amazon.com".freeze] s.files = ["lib/aws-sdk-s3.rb".freeze, "lib/aws-sdk-s3/bucket.rb".freeze, "lib/aws-sdk-s3/bucket_acl.rb".freeze, "lib/aws-sdk-s3/bucket_cors.rb".freeze, "lib/aws-sdk-s3/bucket_lifecycle.rb".freeze, "lib/aws-sdk-s3/bucket_lifecycle_configuration.rb".freeze, "lib/aws-sdk-s3/bucket_logging.rb".freeze, "lib/aws-sdk-s3/bucket_notification.rb".freeze, "lib/aws-sdk-s3/bucket_policy.rb".freeze, "lib/aws-sdk-s3/bucket_region_cache.rb".freeze, "lib/aws-sdk-s3/bucket_request_payment.rb".freeze, "lib/aws-sdk-s3/bucket_tagging.rb".freeze, "lib/aws-sdk-s3/bucket_versioning.rb".freeze, "lib/aws-sdk-s3/bucket_website.rb".freeze, "lib/aws-sdk-s3/client.rb".freeze, "lib/aws-sdk-s3/client_api.rb".freeze, "lib/aws-sdk-s3/customizations.rb".freeze, "lib/aws-sdk-s3/customizations/bucket.rb".freeze, "lib/aws-sdk-s3/customizations/multipart_upload.rb".freeze, "lib/aws-sdk-s3/customizations/object.rb".freeze, "lib/aws-sdk-s3/customizations/object_summary.rb".freeze, "lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb".freeze, "lib/aws-sdk-s3/encryption.rb".freeze, "lib/aws-sdk-s3/encryption/client.rb".freeze, "lib/aws-sdk-s3/encryption/decrypt_handler.rb".freeze, "lib/aws-sdk-s3/encryption/default_cipher_provider.rb".freeze, "lib/aws-sdk-s3/encryption/default_key_provider.rb".freeze, "lib/aws-sdk-s3/encryption/encrypt_handler.rb".freeze, "lib/aws-sdk-s3/encryption/errors.rb".freeze, "lib/aws-sdk-s3/encryption/io_auth_decrypter.rb".freeze, "lib/aws-sdk-s3/encryption/io_decrypter.rb".freeze, "lib/aws-sdk-s3/encryption/io_encrypter.rb".freeze, "lib/aws-sdk-s3/encryption/key_provider.rb".freeze, "lib/aws-sdk-s3/encryption/kms_cipher_provider.rb".freeze, "lib/aws-sdk-s3/encryption/materials.rb".freeze, "lib/aws-sdk-s3/encryption/utils.rb".freeze, "lib/aws-sdk-s3/errors.rb".freeze, "lib/aws-sdk-s3/event_streams.rb".freeze, "lib/aws-sdk-s3/file_downloader.rb".freeze, "lib/aws-sdk-s3/file_part.rb".freeze, "lib/aws-sdk-s3/file_uploader.rb".freeze, "lib/aws-sdk-s3/legacy_signer.rb".freeze, "lib/aws-sdk-s3/multipart_file_uploader.rb".freeze, "lib/aws-sdk-s3/multipart_stream_uploader.rb".freeze, "lib/aws-sdk-s3/multipart_upload.rb".freeze, "lib/aws-sdk-s3/multipart_upload_error.rb".freeze, "lib/aws-sdk-s3/multipart_upload_part.rb".freeze, "lib/aws-sdk-s3/object.rb".freeze, "lib/aws-sdk-s3/object_acl.rb".freeze, "lib/aws-sdk-s3/object_copier.rb".freeze, "lib/aws-sdk-s3/object_multipart_copier.rb".freeze, "lib/aws-sdk-s3/object_summary.rb".freeze, "lib/aws-sdk-s3/object_version.rb".freeze, "lib/aws-sdk-s3/plugins/accelerate.rb".freeze, "lib/aws-sdk-s3/plugins/bucket_dns.rb".freeze, "lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb".freeze, "lib/aws-sdk-s3/plugins/dualstack.rb".freeze, "lib/aws-sdk-s3/plugins/expect_100_continue.rb".freeze, "lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb".freeze, "lib/aws-sdk-s3/plugins/http_200_errors.rb".freeze, "lib/aws-sdk-s3/plugins/location_constraint.rb".freeze, "lib/aws-sdk-s3/plugins/md5s.rb".freeze, "lib/aws-sdk-s3/plugins/redirects.rb".freeze, "lib/aws-sdk-s3/plugins/s3_host_id.rb".freeze, "lib/aws-sdk-s3/plugins/s3_signer.rb".freeze, "lib/aws-sdk-s3/plugins/sse_cpk.rb".freeze, "lib/aws-sdk-s3/plugins/url_encoded_keys.rb".freeze, "lib/aws-sdk-s3/presigned_post.rb".freeze, "lib/aws-sdk-s3/presigner.rb".freeze, "lib/aws-sdk-s3/resource.rb".freeze, "lib/aws-sdk-s3/types.rb".freeze, "lib/aws-sdk-s3/waiters.rb".freeze] s.homepage = "https://github.com/aws/aws-sdk-ruby".freeze s.licenses = ["Apache-2.0".freeze] s.rubygems_version = "2.5.2.1".freeze s.summary = "AWS SDK for Ruby - Amazon S3".freeze if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q.freeze, [">= 3.61.1", "~> 3"]) s.add_runtime_dependency(%q.freeze, ["~> 1"]) s.add_runtime_dependency(%q.freeze, ["~> 1.1"]) else s.add_dependency(%q.freeze, [">= 3.61.1", "~> 3"]) s.add_dependency(%q.freeze, ["~> 1"]) s.add_dependency(%q.freeze, ["~> 1.1"]) end else s.add_dependency(%q.freeze, [">= 3.61.1", "~> 3"]) s.add_dependency(%q.freeze, ["~> 1"]) s.add_dependency(%q.freeze, ["~> 1.1"]) end end