1import type * as compute from "@distilled.cloud/gcp/compute_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Instance } from "./Instance.ts";
6
7export interface StopInstanceRequest extends Omit<
8 compute.StopInstancesRequest,
9 "instance" | "zone" | "project"
10> {}
11
12/**
13 * Runtime binding for Compute Engine `instances.stop`.
14 *
15 * Bind this operation to an {@link Instance} in a Function/Action init phase.
16 * Provide {@link StopInstanceHttp}.
17 *
18 * ### Instance Lifecycle Control
19 * **Example:** Stop the bound instance
20 * ```typescript
21 * const stopInstance = yield* GCP.Compute.StopInstance(vm);
22 * yield* stopInstance();
23 * ```
24 *
25 * @binding
26 * @category Compute
27 */
28export interface StopInstance extends Binding.Service<
29 StopInstance,
30 "GCP.Compute.StopInstance",
31 (
32 instance: Instance,
33 ) => Effect.Effect<
34 (
35 request?: StopInstanceRequest,
36 ) => Effect.Effect<
37 compute.Operation,
38 compute.StopInstancesError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const StopInstance = Binding.Service<StopInstance>(
45 "GCP.Compute.StopInstance",
46);