The best way to control Claude Code, Codex and more from any computer or phone

main
ts 37 lines 1.32 KB
Raw
1 import * as S3 from "@distilled.cloud/aws/s3";
2 import * as Binding from "alchemy/Binding";
3 import * as Effect from "effect/Effect";
4 import type { Bucket } from "./Bucket.ts";
5
6 export interface GetObjectLegalHoldRequest extends Omit<S3.GetObjectLegalHoldRequest, "Bucket"> {}
7
8 /**
9 * Runtime binding for `s3:GetObjectLegalHold`.
10 *
11 * Bind this operation to a bucket to get a callable that reads an object's
12 * legal-hold status — the bucket name is injected automatically and
13 * `s3:GetObjectLegalHold` is granted on the bucket's objects. Requires a
14 * bucket created with `objectLockEnabled: true`. Provide the implementation
15 * with `Effect.provide(AWS.S3.GetObjectLegalHoldHttp)`.
16 * ### Object Lock
17 * **Example:** Read an Object's Legal-Hold Status
18 * ```typescript
19 * const getObjectLegalHold = yield* AWS.S3.GetObjectLegalHold(bucket);
20 *
21 * const { LegalHold } = yield* getObjectLegalHold({ Key: "records/1.json" });
22 * ```
23 *
24 * @binding
25 */
26 export interface GetObjectLegalHold extends Binding.Service<
27 GetObjectLegalHold,
28 "AWS.S3.GetObjectLegalHold",
29 (
30 bucket: Bucket,
31 ) => Effect.Effect<
32 (
33 request: GetObjectLegalHoldRequest,
34 ) => Effect.Effect<S3.GetObjectLegalHoldOutput, S3.GetObjectLegalHoldError>
35 >
36 > {}
37 export const GetObjectLegalHold = Binding.Service<GetObjectLegalHold>("AWS.S3.GetObjectLegalHold");