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 HeadObjectRequest extends Omit<
9 S3.HeadObjectRequest,
10 "Bucket"
11> {}
12
13/**
14 * Runtime binding for Tigris `HeadObject` over the S3 API.
15 *
16 * Bind this operation to a {@link Bucket} in Service init. Provide
17 * {@link HeadObjectHttp}.
18 *
19 *
20 * ### Inspecting Objects
21 * **Example:** Check an Object's Metadata
22 * ```typescript
23 * const headObject = yield* Fly.HeadObject(Data);
24 * const head = yield* headObject({ Key: "hello.txt" });
25 * ```
26 *
27 * @binding
28 * @product Bucket
29 */
30export interface HeadObject extends Binding.Service<
31 HeadObject,
32 "Fly.HeadObject",
33 (
34 bucket: Bucket,
35 ) => Effect.Effect<
36 (
37 request: HeadObjectRequest,
38 ) => Effect.Effect<
39 S3.HeadObjectOutput,
40 S3.HeadObjectError | TigrisCredentialsMissing,
41 RuntimeContext
42 >
43 >
44> {}
45
46export const HeadObject = Binding.Service<HeadObject>("Fly.HeadObject");