@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, 03:37 UTC

main
ts 38 lines 1.11 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 PutObjectRequest extends Omit<S3.PutObjectRequest, "Bucket"> {}
7
8 /**
9 * Runtime binding for `s3:PutObject`.
10 *
11 * Bind this operation to a bucket to get a callable that writes objects without
12 * manually supplying the bucket name on every request. `s3:PutObject` is
13 * granted on the bucket automatically. Provide the implementation with
14 * `Effect.provide(AWS.S3.PutObjectHttp)`.
15 * ### Writing Objects
16 * **Example:** Put an Object
17 * ```typescript
18 * const putObject = yield* PutObject(bucket);
19 *
20 * yield* putObject({
21 * Key: "hello.txt",
22 * Body: "Hello, world!",
23 * ContentType: "text/plain",
24 * });
25 * ```
26 *
27 * @binding
28 */
29 export interface PutObject extends Binding.Service<
30 PutObject,
31 "AWS.S3.PutObject",
32 (
33 bucket: Bucket,
34 ) => Effect.Effect<
35 (request: PutObjectRequest) => Effect.Effect<S3.PutObjectOutput, S3.PutObjectError>
36 >
37 > {}
38 export const PutObject = Binding.Service<PutObject>("AWS.S3.PutObject");