Module Object.Copy

type metadata_directive = [
  1. | `Copy
  2. | `Replace of Metadata.t
]

CopyObject request options and result metadata.

`Copy preserves source metadata. `Replace metadata writes new user metadata on the destination object.

type options = {
  1. source_version_id : Version_id.t option;
    (*

    Source object version to copy.

    *)
  2. source_preconditions : Preconditions.Copy_source.t;
    (*

    Preconditions applied to the source object.

    *)
  3. metadata_directive : metadata_directive option;
    (*

    Whether to copy source metadata or replace it.

    *)
  4. storage_class : Storage_class.t option;
    (*

    Storage class for the destination object.

    *)
  5. checksum_algorithm : Checksum.Algorithm.t option;
    (*

    Checksum algorithm S3 should use for the destination object.

    *)
  6. destination_encryption : Encryption.Destination.t option;
    (*

    Encryption for the destination object.

    *)
  7. source_encryption : Encryption.Source.t option;
    (*

    SSE-C source-object key headers for the object being copied.

    *)
  8. expected_bucket_owner : Account_id.t option;
    (*

    Expected owner for the destination bucket.

    *)
  9. source_expected_bucket_owner : Account_id.t option;
    (*

    Expected owner for the source bucket.

    *)
}

CopyObject request options.

type result = {
  1. etag : Etag.t option;
    (*

    Destination object ETag.

    *)
  2. last_modified : Ptime.t option;
    (*

    Destination last-modified timestamp returned in the copy payload.

    *)
  3. version_id : Version_id.t option;
    (*

    Destination object version id.

    *)
  4. copy_source_version_id : Version_id.t option;
    (*

    Source version id reported by S3.

    *)
  5. response : Awskit.Response.t;
    (*

    Raw response metadata.

    *)
}

CopyObject result metadata.

val default_options : options
val options : ?source_version_id:Version_id.t -> ?source_preconditions:Preconditions.Copy_source.t -> ?metadata_directive:metadata_directive -> ?storage_class:Storage_class.t -> ?checksum_algorithm:Checksum.Algorithm.t -> ?destination_encryption:Encryption.Destination.t -> ?source_encryption:Encryption.Source.t -> ?expected_bucket_owner:Account_id.t -> ?source_expected_bucket_owner:Account_id.t -> unit -> (options, Awskit.Error.t) Stdlib.result

Build CopyObject options.

val options_exn : ?source_version_id:Version_id.t -> ?source_preconditions:Preconditions.Copy_source.t -> ?metadata_directive:metadata_directive -> ?storage_class:Storage_class.t -> ?checksum_algorithm:Checksum.Algorithm.t -> ?destination_encryption:Encryption.Destination.t -> ?source_encryption:Encryption.Source.t -> ?expected_bucket_owner:Account_id.t -> ?source_expected_bucket_owner:Account_id.t -> unit -> options

Like options, but raises on validation failure.