S.ObjectObject operations produced by runtime-backed S3 clients.
type connection = connectionClient connection handle.
type 'a io = 'a ioRuntime effect type.
type request_body = request_bodyRuntime-owned request body type.
type response_body_reader = response_body_readerScoped runtime response-body reader type.
val put :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Put.options ->
body:request_body ->
unit ->
(Object.Put.result, Awskit.Error.t) Stdlib.result ioUpload 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 :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Put.options ->
contents:string ->
unit ->
(Object.Put.result, Awskit.Error.t) Stdlib.result ioUpload an in-memory string using the same PutObject operation model as put.
val put_bytes :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Put.options ->
contents:bytes ->
unit ->
(Object.Put.result, Awskit.Error.t) Stdlib.result ioUpload in-memory bytes using the same PutObject operation model as put.
val get :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Get.options ->
consume:(response_body_reader -> ('a, Awskit.Error.t) Stdlib.result io) ->
unit ->
('a Object.Get.result, Awskit.Error.t) Stdlib.result ioFetch 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 :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Get.options ->
max_bytes:int64 ->
unit ->
(string Object.Get.result, Awskit.Error.t) Stdlib.result ioFetch 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 :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Get.options ->
max_bytes:int64 ->
unit ->
(bytes Object.Get.result, Awskit.Error.t) Stdlib.result ioFetch an object into memory as bytes, bounded by max_bytes.
val find :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Get.options ->
consume:(response_body_reader -> ('a, Awskit.Error.t) Stdlib.result io) ->
unit ->
('a Object.Get.result option, Awskit.Error.t) Stdlib.result ioReturn 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 :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Get.options ->
max_bytes:int64 ->
unit ->
(string Object.Get.result option, Awskit.Error.t) Stdlib.result ioReturn and consume an object as a bounded in-memory string when it is present.
val find_bytes :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Get.options ->
max_bytes:int64 ->
unit ->
(bytes Object.Get.result option, Awskit.Error.t) Stdlib.result ioReturn and consume an object as bounded in-memory bytes when it is present.
val head :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Head.options ->
unit ->
(Object.Head.result, Awskit.Error.t) Stdlib.result ioFetch object metadata without reading an object body.
val find_metadata :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Head.options ->
unit ->
(Object.Head.result option, Awskit.Error.t) Stdlib.result ioReturn 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 :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Head.options ->
unit ->
(bool, Awskit.Error.t) Stdlib.result ioReturn 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 :
connection ->
bucket:Bucket_name.t ->
key:Object_key.t ->
?options:Object.Delete.options ->
unit ->
(Object.Delete.result, Awskit.Error.t) Stdlib.result ioDelete an object or a specific object version.
val delete_objects :
connection ->
bucket:Bucket_name.t ->
objects:Object.Delete_many.object_ list ->
?options:Object.Delete_many.options ->
unit ->
(Object.Delete_many.result, Awskit.Error.t) Stdlib.result ioDelete multiple objects with DeleteObjects.
Per-object failures are represented in Object.Delete_many.result.errors even when the operation itself returns Ok.
val copy :
connection ->
source_bucket:Bucket_name.t ->
source_key:Object_key.t ->
destination_bucket:Bucket_name.t ->
destination_key:Object_key.t ->
?options:Object.Copy.options ->
unit ->
(Object.Copy.result, Awskit.Error.t) Stdlib.result ioCopy an object from one bucket/key to another.
val list_versions :
connection ->
bucket:Bucket_name.t ->
?options:Object.Versions.options ->
unit ->
(Object.Versions.page, Awskit.Error.t) Stdlib.result ioFetch one ListObjectVersions page. Use Versions helpers to follow pagination.
val list :
connection ->
bucket:Bucket_name.t ->
?options:Object.List.options ->
unit ->
(Object.List.page, Awskit.Error.t) Stdlib.result ioFetch 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.