@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 45 lines 1.54 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 PutObjectRetentionRequest extends Omit<S3.PutObjectRetentionRequest, "Bucket"> {}
7
8 /**
9 * Runtime binding for `s3:PutObjectRetention`.
10 *
11 * Bind this operation to a bucket to get a callable that places an Object
12 * Lock retention configuration on an object — the bucket name is injected
13 * automatically and `s3:PutObjectRetention` is granted on the bucket's
14 * objects. Requires a bucket created with `objectLockEnabled: true`;
15 * bypassing a GOVERNANCE retention additionally requires
16 * `s3:BypassGovernanceRetention`. Provide the implementation with
17 * `Effect.provide(AWS.S3.PutObjectRetentionHttp)`.
18 * ### Object Lock
19 * **Example:** Retain an Object in GOVERNANCE Mode
20 * ```typescript
21 * const putObjectRetention = yield* AWS.S3.PutObjectRetention(bucket);
22 *
23 * yield* putObjectRetention({
24 * Key: "records/1.json",
25 * Retention: {
26 * Mode: "GOVERNANCE",
27 * RetainUntilDate: new Date(Date.now() + 24 * 60 * 60 * 1000),
28 * },
29 * });
30 * ```
31 *
32 * @binding
33 */
34 export interface PutObjectRetention extends Binding.Service<
35 PutObjectRetention,
36 "AWS.S3.PutObjectRetention",
37 (
38 bucket: Bucket,
39 ) => Effect.Effect<
40 (
41 request: PutObjectRetentionRequest,
42 ) => Effect.Effect<S3.PutObjectRetentionOutput, S3.PutObjectRetentionError>
43 >
44 > {}
45 export const PutObjectRetention = Binding.Service<PutObjectRetention>("AWS.S3.PutObjectRetention");