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

main
ts 45 lines 1.5 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 PutObjectLegalHoldRequest extends Omit<S3.PutObjectLegalHoldRequest, "Bucket"> {}
7
8 /**
9 * Runtime binding for `s3:PutObjectLegalHold`.
10 *
11 * Bind this operation to a bucket to get a callable that applies or removes
12 * a legal hold on an object — the bucket name is injected automatically and
13 * `s3:PutObjectLegalHold` is granted on the bucket's objects. Requires a
14 * bucket created with `objectLockEnabled: true`. Provide the implementation
15 * with `Effect.provide(AWS.S3.PutObjectLegalHoldHttp)`.
16 * ### Object Lock
17 * **Example:** Place and Release a Legal Hold
18 * ```typescript
19 * const putObjectLegalHold = yield* AWS.S3.PutObjectLegalHold(bucket);
20 *
21 * yield* putObjectLegalHold({
22 * Key: "records/1.json",
23 * LegalHold: { Status: "ON" },
24 * });
25 * // … later, release it so the object can be deleted
26 * yield* putObjectLegalHold({
27 * Key: "records/1.json",
28 * LegalHold: { Status: "OFF" },
29 * });
30 * ```
31 *
32 * @binding
33 */
34 export interface PutObjectLegalHold extends Binding.Service<
35 PutObjectLegalHold,
36 "AWS.S3.PutObjectLegalHold",
37 (
38 bucket: Bucket,
39 ) => Effect.Effect<
40 (
41 request: PutObjectLegalHoldRequest,
42 ) => Effect.Effect<S3.PutObjectLegalHoldOutput, S3.PutObjectLegalHoldError>
43 >
44 > {}
45 export const PutObjectLegalHold = Binding.Service<PutObjectLegalHold>("AWS.S3.PutObjectLegalHold");