1import type * as S3 from "@distilled.cloud/aws/s3";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../Binding.ts";
4import type { RuntimeContext } from "../RuntimeContext.ts";
5import type { Bucket } from "./Bucket.ts";
6import type { TigrisCredentialsMissing } from "./Errors.ts";
7
8export interface ListObjectsV2Request extends Omit<
9 S3.ListObjectsV2Request,
10 "Bucket"
11> {}
12
13/**
14 * Runtime binding for Tigris `ListObjectsV2` over the S3 API.
15 *
16 * Bind this operation to a {@link Bucket} in Service init. Provide
17 * {@link ListObjectsV2Http}.
18 *
19 *
20 * ### Listing Objects
21 * **Example:** List Objects Under a Prefix
22 * ```typescript
23 * const listObjects = yield* Fly.ListObjectsV2(Data);
24 * const result = yield* listObjects({ Prefix: "jobs/", MaxKeys: 100 });
25 * ```
26 *
27 * @binding
28 * @product Bucket
29 */
30export interface ListObjectsV2 extends Binding.Service<
31 ListObjectsV2,
32 "Fly.ListObjectsV2",
33 (
34 bucket: Bucket,
35 ) => Effect.Effect<
36 (
37 request?: ListObjectsV2Request,
38 ) => Effect.Effect<
39 S3.ListObjectsV2Output,
40 S3.ListObjectsV2Error | TigrisCredentialsMissing,
41 RuntimeContext
42 >
43 >
44> {}
45
46export const ListObjectsV2 =
47 Binding.Service<ListObjectsV2>("Fly.ListObjectsV2");