Class: Autorender::Resources::MultipartUploads

Inherits:
Object
  • Object
show all
Defined in:
lib/autorender/resources/multipart_uploads.rb

Overview

Upload endpoints (API key required)

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ MultipartUploads

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MultipartUploads.

Parameters:



61
62
63
# File 'lib/autorender/resources/multipart_uploads.rb', line 61

def initialize(client:)
  @client = client
end

Instance Method Details

#complete(session_id:, uuid: nil, request_options: {}) ⇒ Autorender::Models::MultipartUploadCompleteResponse

Finalise a multipart upload session and return the stored file record.

Parameters:

Returns:

See Also:



18
19
20
21
22
23
24
25
26
27
# File 'lib/autorender/resources/multipart_uploads.rb', line 18

def complete(params)
  parsed, options = Autorender::MultipartUploadCompleteParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/multipart/complete",
    body: parsed,
    model: Autorender::Models::MultipartUploadCompleteResponse,
    options: options
  )
end

#start(file_name:, format_:, size:, custom_id: nil, folder: nil, metadata: nil, random_prefix: nil, tags: nil, ttl_seconds: nil, request_options: {}) ⇒ Autorender::Models::MultipartUploadStartResponse

Initialise a multipart upload session and receive pre-signed part URLs.

Parameters:

  • file_name (String)
  • format_ (String)
  • size (Integer)
  • custom_id (String)
  • folder (String)
  • metadata (Hash{Symbol=>Object})
  • random_prefix (Boolean)
  • tags (Array<String>, String)
  • ttl_seconds (Integer)
  • request_options (Autorender::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
# File 'lib/autorender/resources/multipart_uploads.rb', line 47

def start(params)
  parsed, options = Autorender::MultipartUploadStartParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v1/multipart/start",
    body: parsed,
    model: Autorender::Models::MultipartUploadStartResponse,
    options: options
  )
end