uploads
Uploads module.
uploads module
Uploads module.
class CreateUploadParams
Bases: TypedDict
Parameters for creating an upload.
size : int
The size of the file to upload in bytes. This should be the exact size of the file. Any mismatch will result in the url being invalid or a corrupt file being uploaded.
mime_type : str
The MIME type of the file.
class Upload
Bases: TypedDict
Represents an upload.
urls : list[str]
The urls used to upload the file.
id : str
The identifier for the upload.
part_size : int
The size, in bytes, of each part. All parts are this size except the last one, which may be smaller. If the upload consists of a single part, this value equals the total file size.
class CompleteUploadParams
Bases: TypedDict
Parameters for completing an upload.
etags : list[str]
The list of etags of the uploaded parts matching the ordering of urls.
class Uploads(api)
Bases: Resource
Initializes the Resource with an API instance.
- Parameters: api (API) – An instance of the API class.
create(params)
Create an upload.
- Parameters: params (CreateUploadParams) – Upload creation parameters.
- Returns: The new upload.
- Return type: Upload
async async_create(params)
Create an upload.
- Parameters: params (CreateUploadParams) – Upload creation parameters.
- Returns: The new upload.
- Return type: Upload
complete(upload_id, params)
Complete an upload.
- Parameters:
- upload_id (str) – The unique identifier of the upload.
- params (CompleteUploadParams) – Parameters to complete an upload.
- Returns: The completion result.
- Return type: UploadCompletionResult
async async_complete(upload_id, params)
Complete an upload.
- Parameters:
- upload_id (str) – The unique identifier of the upload.
- params (CompleteUploadParams) – Parameters to complete an upload.
- Returns: The completion result.
- Return type: UploadCompletionResult