lib/oci/object_storage/transfer/multipart/multipart_object_assembler.rb
# Initializes a new multipart upload.
#
# @return [Response] A Response object with data of type OCI::ObjectStorage::Models::MultipartUpload
Initializes a new multipart upload.
Initializes a new multipart upload .
def new_upload
            raise 'This MultipartObjectAssembler has already been initialized with an upload' if @manifest[:upload_id]
            create_multipart_upload_opts = {}
            create_multipart_upload_opts[:if_match] = @multipart_upload_opts[:if_match] if @multipart_upload_opts[:if_match]
            create_multipart_upload_opts[:if_none_match] = @multipart_upload_opts[:if_none_match] \
              if @multipart_upload_opts[:if_none_match]
            create_multipart_upload_opts[:opc_client_request_id] = @multipart_upload_opts[:opc_client_request_id] \
              if @multipart_upload_opts[:opc_client_request_id]
            create_multipart_upload_details =
              OCI::ObjectStorage::Models::CreateMultipartUploadDetails.new(object: @object_name)
            create_multipart_upload_details.content_type = @multipart_upload_opts[:content_type] \
              if @multipart_upload_opts[:content_type]
            create_multipart_upload_details.content_language = @multipart_upload_opts[:content_language] \
              if @multipart_upload_opts[:content_language]
            create_multipart_upload_details.content_encoding = @multipart_upload_opts[:content_encoding] \
              if @multipart_upload_opts[:content_encoding]
            create_multipart_upload_details.storage_tier = @multipart_upload_opts[:storage_tier] \
              if @multipart_upload_opts[:storage_tier]
            if @multipart_upload_opts[:metadata] && !@multipart_upload_opts[:metadata].empty?
              processed_metadata = {}
              @multipart_upload_opts[:metadata].each do |key, value|
                processed_metadata[key] = value if key.to_s.start_with?('opc-meta-')
                processed_metadata["opc-meta-#{key}"] = value unless key.to_s.start_with?('opc-meta-')
              end
              create_multipart_upload_details.metadata = processed_metadata
            end
            response = make_retrying_call do
              @object_storage_client.create_multipart_upload(
                @namespace, @bucket_name,
                create_multipart_upload_details,
                create_multipart_upload_opts
              )
            end
            @manifest[:upload_id] = response.data.upload_id
            response
          end
def new_upload raise 'This MultipartObjectAssembler has already been initialized with an upload' if @manifest [ :upload_id ] create_multipart_upload_opts = { } create_multipart_upload_opts [ :if_match ] = @multipart_upload_opts [ :if_match ] if @multipart_upload_opts [ :if_match ] create_multipart_upload_opts [ :if_none_match ] = @multipart_upload_opts [ :if_none_match ] if @multipart_upload_opts [ :if_none_match ] create_multipart_upload_opts [ :opc_client_request_id ] = @multipart_upload_opts [ :opc_client_request_id ] if @multipart_upload_opts [ :opc_client_request_id ] create_multipart_upload_details = OCI :: ObjectStorage :: Models :: CreateMultipartUploadDetails . new ( object : @object_name ) create_multipart_upload_details . content_type = @multipart_upload_opts [ :content_type ] if @multipart_upload_opts [ :content_type ] create_multipart_upload_details . content_language = @multipart_upload_opts [ :content_language ] if @multipart_upload_opts [ :content_language ] create_multipart_upload_details . content_encoding = @multipart_upload_opts [ :content_encoding ] if @multipart_upload_opts [ :content_encoding ] create_multipart_upload_details . storage_tier = @multipart_upload_opts [ :storage_tier ] if @multipart_upload_opts [ :storage_tier ] if @multipart_upload_opts [ :metadata ] && ! @multipart_upload_opts [ :metadata ] . empty? processed_metadata = { } @multipart_upload_opts [ :metadata ] . each do | key , value | processed_metadata [ key ] = value if key . to_s . start_with? ( 'opc-meta-' ) processed_metadata [ "opc-meta-#{key}" ] = value unless key . to_s . start_with? ( 'opc-meta-' ) end create_multipart_upload_details . metadata = processed_metadata end response = make_retrying_call do @object_storage_client . create_multipart_upload ( @namespace , @bucket_name , create_multipart_upload_details , create_multipart_upload_opts ) end @manifest [ :upload_id ] = response . data . upload_id response end
Initializes a new multipart upload.
Initializes a new multipart upload .
A Response object with data of type OCI::ObjectStorage::Models::MultipartUpload
A Response object with data of type OCI :: ObjectStorage :: Models :: MultipartUpload
Response