| 1 | import type * as S3 from "@distilled.cloud/aws/s3"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../RuntimeContext.ts"; |
| 5 | import type { Bucket } from "./Bucket.ts"; |
| 6 | import type { TigrisCredentialsMissing } from "./Errors.ts"; |
| 7 | |
| 8 | export interface DeleteObjectRequest extends Omit< |
| 9 | S3.DeleteObjectRequest, |
| 10 | "Bucket" |
| 11 | > {} |
| 12 | |
| 13 | /** |
| 14 | * Runtime binding for Tigris `DeleteObject` over the S3 API. |
| 15 | * |
| 16 | * Bind this operation to a {@link Bucket} in Service init. Provide |
| 17 | * {@link DeleteObjectHttp}. |
| 18 | * |
| 19 | * |
| 20 | * ### Deleting Objects |
| 21 | * **Example:** Delete an Object |
| 22 | * ```typescript |
| 23 | * const deleteObject = yield* Fly.DeleteObject(Data); |
| 24 | * yield* deleteObject({ Key: "hello.txt" }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | * @product Bucket |
| 29 | */ |
| 30 | export interface DeleteObject extends Binding.Service< |
| 31 | DeleteObject, |
| 32 | "Fly.DeleteObject", |
| 33 | ( |
| 34 | bucket: Bucket, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request: DeleteObjectRequest, |
| 38 | ) => Effect.Effect< |
| 39 | S3.DeleteObjectOutput, |
| 40 | S3.DeleteObjectError | TigrisCredentialsMissing, |
| 41 | RuntimeContext |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const DeleteObject = Binding.Service<DeleteObject>("Fly.DeleteObject"); |