Module Awskit_s3_sim.Object

Object operations against the in-memory simulator store.

Object operations produced by runtime-backed S3 clients.

val put : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Put.options -> body:Body.t -> unit -> (Awskit_s3.Object.Put.result, Awskit.Error.t) Stdlib.result

Upload an object body with PutObject.

body must carry an accurate request-body descriptor. S3 uploads require a known content length in this library; adapter body constructors such as Body.of_string and Body.of_bytes satisfy that contract.

val put_string : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Put.options -> contents:string -> unit -> (Awskit_s3.Object.Put.result, Awskit.Error.t) Stdlib.result

Upload an in-memory string using the same PutObject operation model as put.

val put_bytes : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Put.options -> contents:bytes -> unit -> (Awskit_s3.Object.Put.result, Awskit.Error.t) Stdlib.result

Upload in-memory bytes using the same PutObject operation model as put.

val get : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Get.options -> consume:(Reader.t -> ('a, Awskit.Error.t) Stdlib.result) -> unit -> ('a Awskit_s3.Object.Get.result, Awskit.Error.t) Stdlib.result

Fetch an object and consume its body inside consume.

The response-body reader is scoped to the callback and must not escape it. The returned record contains response metadata and the callback result.

val get_string : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Get.options -> max_bytes:int64 -> unit -> (string Awskit_s3.Object.Get.result, Awskit.Error.t) Stdlib.result

Fetch an object into memory as a string.

max_bytes is required so callers choose an explicit memory bound. Use get with a streaming consume callback for large objects.

val get_bytes : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Get.options -> max_bytes:int64 -> unit -> (bytes Awskit_s3.Object.Get.result, Awskit.Error.t) Stdlib.result

Fetch an object into memory as bytes, bounded by max_bytes.

val find : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Get.options -> consume:(Reader.t -> ('a, Awskit.Error.t) Stdlib.result) -> unit -> ('a Awskit_s3.Object.Get.result option, Awskit.Error.t) Stdlib.result

Return and consume an object when it is present.

This is the option-returning lookup form. It returns Ok None for object not-found errors; other service, auth, transport, and decode failures remain Error. Use get when callers need the raw GetObject service behavior.

val find_string : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Get.options -> max_bytes:int64 -> unit -> (string Awskit_s3.Object.Get.result option, Awskit.Error.t) Stdlib.result

Return and consume an object as a bounded in-memory string when it is present.

val find_bytes : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Get.options -> max_bytes:int64 -> unit -> (bytes Awskit_s3.Object.Get.result option, Awskit.Error.t) Stdlib.result

Return and consume an object as bounded in-memory bytes when it is present.

Fetch object metadata without reading an object body.

val find_metadata : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Head.options -> unit -> (Awskit_s3.Object.Head.result option, Awskit.Error.t) Stdlib.result

Return object metadata when the object is present.

This is the option-returning lookup form. It returns Ok None for object not-found errors. S3 HeadObject responses may only expose HTTP status, so a code-less 404 response is treated as an absent object. Coded NoSuchBucket responses and other service, auth, transport, and decode failures remain Error. Use head when callers need the raw HeadObject service behavior.

val exists : t -> bucket:Awskit_s3.Bucket_name.t -> key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Head.options -> unit -> (bool, Awskit.Error.t) Stdlib.result

Return false for object-not-found responses and true for success.

Accepts the same options as head, including version id, preconditions, checksum mode, and expected-owner guards. Code-less HeadObject 404 responses are treated as absent objects. Coded NoSuchBucket responses and other service, auth, transport, and decode failures remain Error.

Delete an object or a specific object version.

Delete multiple objects with DeleteObjects.

Per-object failures are represented in Object.Delete_many.result.errors even when the operation itself returns Ok.

val copy : t -> source_bucket:Awskit_s3.Bucket_name.t -> source_key:Awskit_s3.Object_key.t -> destination_bucket:Awskit_s3.Bucket_name.t -> destination_key:Awskit_s3.Object_key.t -> ?options:Awskit_s3.Object.Copy.options -> unit -> (Awskit_s3.Object.Copy.result, Awskit.Error.t) Stdlib.result

Copy an object from one bucket/key to another.

val list_versions : t -> bucket:Awskit_s3.Bucket_name.t -> ?options:Awskit_s3.Object.Versions.options -> unit -> (Awskit_s3.Object.Versions.page, Awskit.Error.t) Stdlib.result

Fetch one ListObjectVersions page. Use Versions helpers to follow pagination.

val list : t -> bucket:Awskit_s3.Bucket_name.t -> ?options:Awskit_s3.Object.List.options -> unit -> (Awskit_s3.Object.List.page, Awskit.Error.t) Stdlib.result

Fetch one ListObjectsV2 page. Use List helpers to follow pagination.

module List : sig ... end

Pagination helpers for ListObjectsV2.

module Versions : sig ... end

Pagination helpers for ListObjectVersions.

module Tagging : sig ... end

Object tagging operations.