class Aws::S3::ObjectVersion

def bucket_name

Returns:
  • (String) -
def bucket_name
  @bucket_name
end

def checksum_algorithm

Returns:
  • (Array) -
def checksum_algorithm
  data[:checksum_algorithm]
end

def checksum_type

Returns:
  • (String) -
def checksum_type
  data[:checksum_type]
end

def client

Returns:
  • (Client) -
def client
  @client
end

def data

Returns:
  • (Types::ObjectVersion) -

Raises:
  • (NotImplementedError) - Raises when {#data_loaded?} is `false`.
def data
  load unless @data
  @data
end

def data_loaded?

Returns:
  • (Boolean) -
def data_loaded?
  !!@data
end

def delete(options = {})

Returns:
  • (Types::DeleteObjectOutput) -

Options Hash: (**options)
  • :if_match_size (Integer) --
  • :if_match_last_modified_time (Time, DateTime, Date, Integer, String) --
  • :if_match (String) --
  • :expected_bucket_owner (String) --
  • :bypass_governance_retention (Boolean) --
  • :request_payer (String) --
  • :mfa (String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def delete(options = {})
  options = options.merge(
    bucket: @bucket_name,
    key: @object_key,
    version_id: @id
  )
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.delete_object(options)
  end
  resp.data
end

def etag

Returns:
  • (String) -
def etag
  data[:etag]
end

def extract_bucket_name(args, options)

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_id(args, options)

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

def extract_object_key(args, options)

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 get(options = {}, &block)

Returns:
  • (Types::GetObjectOutput) -

Options Hash: (**options)
  • :checksum_mode (String) --
  • :expected_bucket_owner (String) --
  • :part_number (Integer) --
  • :request_payer (String) --
  • :sse_customer_key_md5 (String) --
  • :sse_customer_key (String) --
  • :sse_customer_algorithm (String) --
  • :response_expires (Time, DateTime, Date, Integer, String) --
  • :response_content_type (String) --
  • :response_content_language (String) --
  • :response_content_encoding (String) --
  • :response_content_disposition (String) --
  • :response_cache_control (String) --
  • :range (String) --
  • :if_unmodified_since (Time, DateTime, Date, Integer, String) --
  • :if_none_match (String) --
  • :if_modified_since (Time, DateTime, Date, Integer, String) --
  • :if_match (String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def get(options = {}, &block)
  options = options.merge(
    bucket: @bucket_name,
    key: @object_key,
    version_id: @id
  )
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.get_object(options, &block)
  end
  resp.data
end

def head(options = {})

Returns:
  • (Types::HeadObjectOutput) -

Options Hash: (**options)
  • :checksum_mode (String) --
  • :expected_bucket_owner (String) --
  • :part_number (Integer) --
  • :request_payer (String) --
  • :sse_customer_key_md5 (String) --
  • :sse_customer_key (String) --
  • :sse_customer_algorithm (String) --
  • :response_expires (Time, DateTime, Date, Integer, String) --
  • :response_content_type (String) --
  • :response_content_language (String) --
  • :response_content_encoding (String) --
  • :response_content_disposition (String) --
  • :response_cache_control (String) --
  • :range (String) --
  • :if_unmodified_since (Time, DateTime, Date, Integer, String) --
  • :if_none_match (String) --
  • :if_modified_since (Time, DateTime, Date, Integer, String) --
  • :if_match (String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def head(options = {})
  options = options.merge(
    bucket: @bucket_name,
    key: @object_key,
    version_id: @id
  )
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    @client.head_object(options)
  end
  resp.data
end

def id

Returns:
  • (String) -
def id
  @id
end

def identifiers

Other tags:
    Api: - private

Deprecated:
def identifiers
  {
    bucket_name: @bucket_name,
    object_key: @object_key,
    id: @id
  }
end

def initialize(*args)

Options Hash: (**options)
  • :client (Client) --
  • :id (required, String) --
  • :object_key (required, String) --
  • :bucket_name (required, String) --
  • :client (Client) --

Overloads:
  • def initialize(options = {})
  • def initialize(bucket_name, object_key, id, options = {})

Parameters:
  • id (String) --
  • object_key (String) --
  • bucket_name (String) --
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)
  @waiter_block_warned = false
end

def is_latest

Returns:
  • (Boolean) -
def is_latest
  data[:is_latest]
end

def key

Returns:
  • (String) -
def key
  data[:key]
end

def last_modified

Returns:
  • (Time) -
def last_modified
  data[:last_modified]
end

def load

Other tags:
    Api: - private

Raises:
  • (NotImplementedError) -
def load
  msg = "#load is not implemented, data only available via enumeration"
  raise NotImplementedError, msg
end

def object

Returns:
  • (Object) -
def object
  Object.new(
    bucket_name: @bucket_name,
    key: @object_key,
    client: @client
  )
end

def object_key

Returns:
  • (String) -
def object_key
  @object_key
end

def owner

Returns:
  • (Types::Owner) -
def owner
  data[:owner]
end

def restore_status

Returns:
  • (Types::RestoreStatus) -
def restore_status
  data[:restore_status]
end

def size

Returns:
  • (Integer) -
def size
  data[:size]
end

def storage_class

Returns:
  • (String) -
def storage_class
  data[:storage_class]
end

def version_id

Returns:
  • (String) -
def version_id
  data[:version_id]
end

def wait_until(options = {}, &block)

Returns:
  • (Resource) - if the waiter was successful

Options Hash: (**options)
  • :before_wait (Proc) -- Callback
  • :before_attempt (Proc) -- Callback
  • :delay (Integer) -- Delay between each
  • :max_attempts (Integer) -- Maximum number of

Raises:
  • (NotImplementedError) - Raised when the resource does not
  • (Aws::Waiters::Errors::UnexpectedError) - Raised when an error is
  • (Aws::Waiters::Errors::FailureStateError) - Raised when the waiter

Other tags:
    Yieldparam: resource - to be used in the waiting condition.

Other tags:
    Note: - The waiting operation is performed on a copy. The original resource

Deprecated:
  • Use [Aws::S3::Client] #wait_until instead
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::Plugins::UserAgent.metric('RESOURCE_MODEL') do
    Aws::Waiters::Waiter.new(options).wait({})
  end
end