1import * as S3 from "@distilled.cloud/aws/s3";
2import * as Effect from "effect/Effect";
3
4import * as Binding from "../../Binding.ts";
5import type { Bucket } from "./Bucket.ts";
6
7export interface ListObjectVersionsRequest extends Omit<
8 S3.ListObjectVersionsRequest,
9 "Bucket"
10> {}
11
12/**
13 * Runtime binding for `s3:ListBucketVersions`.
14 *
15 * Bind this operation to a bucket to get a callable that lists object
16 * versions and delete markers — the bucket name is injected automatically and
17 * `s3:ListBucketVersions` is granted on the bucket. Provide the
18 * implementation with `Effect.provide(AWS.S3.ListObjectVersionsHttp)`.
19 * ### Listing Objects
20 * **Example:** List Versions Under a Prefix
21 * ```typescript
22 * const listObjectVersions = yield* AWS.S3.ListObjectVersions(bucket);
23 *
24 * const result = yield* listObjectVersions({ Prefix: "reports/" });
25 * const versions = result.Versions ?? [];
26 * ```
27 *
28 * @binding
29 */
30export interface ListObjectVersions extends Binding.Service<
31 ListObjectVersions,
32 "AWS.S3.ListObjectVersions",
33 (
34 bucket: Bucket,
35 ) => Effect.Effect<
36 (
37 request?: ListObjectVersionsRequest,
38 ) => Effect.Effect<S3.ListObjectVersionsOutput, S3.ListObjectVersionsError>
39 >
40> {}
41export const ListObjectVersions = Binding.Service<ListObjectVersions>(
42 "AWS.S3.ListObjectVersions",
43);