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 StartInstanceRequest extends Omit<
8 compute.StartInstancesRequest,
9 "instance" | "zone" | "project"
10> {}
11
12/**
13 * Runtime binding for Compute Engine `instances.start`.
14 *
15 * Bind this operation to an {@link Instance} in a Function/Action init phase.
16 * Provide {@link StartInstanceHttp}.
17 *
18 * ### Instance Lifecycle Control
19 * **Example:** Start the bound instance
20 * ```typescript
21 * const startInstance = yield* GCP.Compute.StartInstance(vm);
22 * yield* startInstance();
23 * ```
24 *
25 * @binding
26 * @category Compute
27 */
28export interface StartInstance extends Binding.Service<
29 StartInstance,
30 "GCP.Compute.StartInstance",
31 (
32 instance: Instance,
33 ) => Effect.Effect<
34 (
35 request?: StartInstanceRequest,
36 ) => Effect.Effect<
37 compute.Operation,
38 compute.StartInstancesError,
39 RuntimeContext
40 >
41 >
42> {}
43
44export const StartInstance = Binding.Service<StartInstance>(
45 "GCP.Compute.StartInstance",
46);