Awskit_s3_lwt_unix.Objectinclude Awskit_s3.OBJECT
with type connection := t
and type 'a io := 'a Lwt.t
and type request_body := Body.t
and type response_body_reader := Reader.tval 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 Lwt.tUpload 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 Lwt.tUpload 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 Lwt.tUpload 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 Lwt.t) ->
unit ->
('a Awskit_s3.Object.Get.result, Awskit.Error.t) Stdlib.result Lwt.tFetch 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 Lwt.tFetch 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 Lwt.tFetch 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 Lwt.t) ->
unit ->
('a Awskit_s3.Object.Get.result option, Awskit.Error.t) Stdlib.result Lwt.tReturn 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
Lwt.tReturn 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
Lwt.tReturn and consume an object as bounded in-memory bytes when it is present.
val head :
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, Awskit.Error.t) Stdlib.result Lwt.tFetch 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 Lwt.tReturn 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 Lwt.tReturn 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.
val delete :
t ->
bucket:Awskit_s3.Bucket_name.t ->
key:Awskit_s3.Object_key.t ->
?options:Awskit_s3.Object.Delete.options ->
unit ->
(Awskit_s3.Object.Delete.result, Awskit.Error.t) Stdlib.result Lwt.tDelete an object or a specific object version.
val delete_objects :
t ->
bucket:Awskit_s3.Bucket_name.t ->
objects:Awskit_s3.Object.Delete_many.object_ list ->
?options:Awskit_s3.Object.Delete_many.options ->
unit ->
(Awskit_s3.Object.Delete_many.result, Awskit.Error.t) Stdlib.result Lwt.tDelete 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 Lwt.tCopy 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 Lwt.tFetch 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 Lwt.tFetch one ListObjectsV2 page. Use List helpers to follow pagination.
module List : sig ... endPagination helpers for ListObjectsV2.
module Versions : sig ... endPagination helpers for ListObjectVersions.
module Tagging : sig ... endObject tagging operations.
module Transfer : sig ... end