@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 43 lines 1.26 KB
Raw
1 import type * as sqladmin from "@distilled.cloud/gcp/sqladmin_v1";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { Instance } from "./Instance.ts";
6
7 export interface GetInstanceRequest extends Omit<
8 sqladmin.GetInstancesRequest,
9 "instance" | "project"
10 > {}
11
12 /**
13 * Runtime binding for Cloud SQL `instances.get`.
14 *
15 * Bind this operation to an {@link Instance} in a Function/Action init
16 * phase. Provide {@link GetInstanceHttp}.
17 *
18 * Grants `roles/cloudsql.viewer` on the project under an IAM Condition
19 * naming only this instance (Cloud SQL has no instance-level IAM policy).
20 *
21 * ### Observing Instances
22 * **Example:** Read the bound instance
23 * ```typescript
24 * const getInstance = yield* GCP.SQL.GetInstance(db);
25 * const live = yield* getInstance();
26 * ```
27 *
28 * @binding
29 * @category SQL
30 */
31 export interface GetInstance extends Binding.Service<
32 GetInstance,
33 "GCP.SQL.GetInstance",
34 (
35 instance: Instance,
36 ) => Effect.Effect<
37 (
38 request?: GetInstanceRequest,
39 ) => Effect.Effect<sqladmin.DatabaseInstance, sqladmin.GetInstancesError, RuntimeContext>
40 >
41 > {}
42
43 export const GetInstance = Binding.Service<GetInstance>("GCP.SQL.GetInstance");