Module Object.Get

type options = {
  1. range : Range.t option;
    (*

    Optional HTTP byte range.

    *)
  2. preconditions : Preconditions.Read.t;
    (*

    Conditional read headers.

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

    Object version to read instead of the current version.

    *)
  4. checksum_mode : Checksum.Mode.t option;
    (*

    Request S3 checksum metadata in the response.

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

    SSE-C source-object key headers for reading encrypted objects.

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

    x-amz-expected-bucket-owner.

    *)
}

GetObject request options.

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

    Object ETag returned by S3.

    *)
  2. content_type : Content_type.t option;
    (*

    Object Content-Type response header.

    *)
  3. content_length : int64 option;
    (*

    Number of response-body bytes when S3 supplied Content-Length.

    *)
  4. content_range : Range.Content_range.t option;
    (*

    Parsed Content-Range response header for ranged responses.

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

    Last modified timestamp parsed from the response.

    *)
  6. metadata : Metadata.t;
    (*

    User metadata parsed from x-amz-meta-* headers.

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

    Storage class reported for the object, if present.

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

    Version id of the returned object.

    *)
  9. checksum : Checksum.response;
    (*

    Checksum response headers.

    *)
  10. encryption : Encryption.Observed.t option;
    (*

    Encryption metadata reported by S3.

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

    Raw response metadata.

    *)
}

GetObject response metadata. The object body is consumed through the selected runtime and is not stored in info.

type 'a result = {
  1. value : 'a;
    (*

    Value returned by the response-body consumer.

    *)
  2. etag : Etag.t option;
    (*

    Object ETag returned by S3.

    *)
  3. content_type : Content_type.t option;
    (*

    Object Content-Type response header.

    *)
  4. content_length : int64 option;
    (*

    Number of response-body bytes when S3 supplied Content-Length.

    *)
  5. content_range : Range.Content_range.t option;
    (*

    Parsed Content-Range response header for ranged responses.

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

    Last modified timestamp parsed from the response.

    *)
  7. metadata : Metadata.t;
    (*

    User metadata parsed from x-amz-meta-* headers.

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

    Storage class reported for the object, if present.

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

    Version id of the returned object.

    *)
  10. checksum : Checksum.response;
    (*

    Checksum response headers.

    *)
  11. encryption : Encryption.Observed.t option;
    (*

    Encryption metadata reported by S3.

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

    Raw response metadata.

    *)
}

GetObject result containing response metadata and the caller's consumed body value.

val default_options : options

Default GetObject options: full current object, no checksum mode, and no conditional headers.

val options : ?range:Range.t -> ?preconditions:Preconditions.Read.t -> ?version_id:Version_id.t -> ?checksum_mode:Checksum.Mode.t -> ?source_encryption:Encryption.Source.t -> ?expected_bucket_owner:Account_id.t -> unit -> (options, Awskit.Error.t) Stdlib.result

Build GetObject options.

val options_exn : ?range:Range.t -> ?preconditions:Preconditions.Read.t -> ?version_id:Version_id.t -> ?checksum_mode:Checksum.Mode.t -> ?source_encryption:Encryption.Source.t -> ?expected_bucket_owner:Account_id.t -> unit -> options

Like options, but raises on validation failure.