class Aws::S3::MultipartUpload

def abort(options = {})

Returns:
  • (Types::AbortMultipartUploadOutput) -

Options Hash: (**options)
  • :expected_bucket_owner (String) --
  • :request_payer (String) --

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

Other tags:
    Example: Request syntax with placeholder values -
def abort(options = {})
  options = options.merge(
    bucket: @bucket_name,
    key: @object_key,
    upload_id: @id
  )
  resp = @client.abort_multipart_upload(options)
  resp.data
end

def bucket_name

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

def checksum_algorithm

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

def client

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

def complete(options = {})

Options Hash: (**options)
  • :compute_parts (Boolean) -- When `true`,
def complete(options = {})
  if options.delete(:compute_parts)
    options[:multipart_upload] = { parts: compute_parts }
  end
  basic_complete(options)
end

def complete(options = {})

Returns:
  • (Object) -

Options Hash: (**options)
  • :sse_customer_key_md5 (String) --
  • :sse_customer_key (String) --
  • :sse_customer_algorithm (String) --
  • :expected_bucket_owner (String) --
  • :request_payer (String) --
  • :checksum_sha256 (String) --
  • :checksum_sha1 (String) --
  • :checksum_crc32c (String) --
  • :checksum_crc32 (String) --
  • :multipart_upload (Types::CompletedMultipartUpload) --

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

Other tags:
    Example: Request syntax with placeholder values -
def complete(options = {})
  options = options.merge(
    bucket: @bucket_name,
    key: @object_key,
    upload_id: @id
  )
  @client.complete_multipart_upload(options)
  Object.new(
    bucket_name: @bucket_name,
    key: @object_key,
    client: @client
  )
end

def compute_parts

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

def data

Returns:
  • (Types::MultipartUpload) -

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 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 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 initiated

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

def initiator

Returns:
  • (Types::Initiator) -
def initiator
  data[:initiator]
end

def key

Returns:
  • (String) -
def key
  data[:key]
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 part(part_number)

Returns:
  • (MultipartUploadPart) -

Parameters:
  • part_number (String) --
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

def parts(options = {})

Returns:
  • (MultipartUploadPart::Collection) -

Options Hash: (**options)
  • :sse_customer_key_md5 (String) --
  • :sse_customer_key (String) --
  • :sse_customer_algorithm (String) --
  • :expected_bucket_owner (String) --
  • :request_payer (String) --

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

Other tags:
    Example: Request syntax with placeholder values -
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

def storage_class

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

def upload_id

Returns:
  • (String) -
def upload_id
  data[:upload_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::Waiters::Waiter.new(options).wait({})
end