1import type * as storage from "@distilled.cloud/gcp/storage_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Bucket } from "./Bucket.ts";
6
7export interface DeleteObjectRequest extends Omit<
8 storage.DeleteObjectsRequest,
9 "bucket"
10> {}
11
12/**
13 * Runtime binding for Cloud Storage `objects.delete`.
14 *
15 * Bind this operation to a {@link Bucket} in a Function/Action init phase.
16 * Provide {@link DeleteObjectHttp}.
17 *
18 * ### Deleting Objects
19 * **Example:** Delete an object
20 * ```typescript
21 * const deleteObject = yield* GCP.Storage.DeleteObject(bucket);
22 * yield* deleteObject({ object: "hello.txt" });
23 * ```
24 *
25 * @binding
26 * @category Storage
27 */
28export interface DeleteObject extends Binding.Service<
29 DeleteObject,
30 "GCP.Storage.DeleteObject",
31 (
32 bucket: Bucket,
33 ) => Effect.Effect<
34 (
35 request: DeleteObjectRequest,
36 ) => Effect.Effect<
37 storage.DeleteObjectsResponse,
38 storage.DeleteObjectsError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const DeleteObject = Binding.Service<DeleteObject>(
45 "GCP.Storage.DeleteObject",
46);