The best way to control Claude Code, Codex and more from any computer or phone
| 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 DeleteObjectRequest extends Omit<S3.DeleteObjectRequest, "Bucket"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `s3:DeleteObject`. |
| 10 | * |
| 11 | * Bind this operation to a bucket to get a callable that deletes objects — |
| 12 | * the bucket name is injected automatically and `s3:DeleteObject` is granted |
| 13 | * on the bucket. Provide the implementation with |
| 14 | * `Effect.provide(AWS.S3.DeleteObjectHttp)`. |
| 15 | * ### Deleting Objects |
| 16 | * **Example:** Delete an Object |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the bucket |
| 19 | * const deleteObject = yield* AWS.S3.DeleteObject(bucket); |
| 20 | * |
| 21 | * // runtime — deleting a non-existent key succeeds (S3 delete is idempotent) |
| 22 | * yield* deleteObject({ Key: "jobs/job-123.json" }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface DeleteObject extends Binding.Service< |
| 28 | DeleteObject, |
| 29 | "AWS.S3.DeleteObject", |
| 30 | ( |
| 31 | bucket: Bucket, |
| 32 | ) => Effect.Effect< |
| 33 | (request: DeleteObjectRequest) => Effect.Effect<S3.DeleteObjectOutput, S3.DeleteObjectError> |
| 34 | > |
| 35 | > {} |
| 36 | export const DeleteObject = Binding.Service<DeleteObject>("AWS.S3.DeleteObject"); |