Module Multipart.Upload

type created

Upload handle returned by CreateMultipartUpload. High-level helpers may abort these handles automatically when they created the upload and post-create work fails before completion.

type caller_owned

Upload handle supplied by the caller, typically from persisted multipart state. High-level helpers do not abort caller-owned uploads automatically.

type +'ownership t

Identifies one multipart upload for a bucket/key pair. The ownership phantom tracks whether Awskit created the upload or the caller resumed it.

val created : bucket:Bucket_name.t -> key:Object_key.t -> upload_id:Upload_id.t -> created t

Create an Awskit-owned handle after a successful CreateMultipartUpload response. This is primarily for runtime and simulator implementations.

val resume : bucket:Bucket_name.t -> key:Object_key.t -> upload_id:Upload_id.t -> caller_owned t

Rebuild a caller-owned upload handle from persisted multipart state.

val of_strings : bucket:string -> key:string -> upload_id:Upload_id.t -> (caller_owned t, Awskit.Error.t) Stdlib.result

Validate raw bucket/key strings and create a caller-owned upload handle. Raw string construction is only an edge convenience; standard operations use typed bucket and key values.

val of_strings_exn : bucket:string -> key:string -> upload_id:Upload_id.t -> caller_owned t

Like of_strings, but raises on validation failure.

val bucket : _ t -> Bucket_name.t

Return the upload bucket.

val key : _ t -> Object_key.t

Return the upload key.

val upload_id : _ t -> Upload_id.t

Return the S3 upload id.

val as_caller_owned : _ t -> caller_owned t

Forget Awskit cleanup ownership. Use when persisting or returning a handle to callers that own future cleanup.