@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, 06:00 UTC

main
ts 48 lines 1.69 KB
Raw
1 import type * as grafana from "@distilled.cloud/aws/grafana";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Workspace } from "./Workspace.ts";
5
6 /**
7 * Runtime binding for the `CreateWorkspaceServiceAccount` operation (IAM
8 * action `grafana:CreateWorkspaceServiceAccount`), scoped to one
9 * {@link Workspace}.
10 *
11 * Creates a Grafana service account in the workspace — a non-user identity
12 * for machine access to the Grafana HTTP API (dashboards, alerts, data
13 * sources). Mint API tokens for it with
14 * `CreateWorkspaceServiceAccountToken`. Requires Grafana 9 or newer.
15 * Provide the implementation with
16 * `Effect.provide(AWS.Grafana.CreateWorkspaceServiceAccountHttp)`.
17 * ### Managing Service Accounts
18 * **Example:** Create an Automation Service Account
19 * ```typescript
20 * const createServiceAccount =
21 * yield* Grafana.CreateWorkspaceServiceAccount(workspace);
22 *
23 * const account = yield* createServiceAccount({
24 * name: "dashboard-automation",
25 * grafanaRole: "EDITOR",
26 * });
27 * // account.id → the service account id used for token operations
28 * ```
29 *
30 * @binding
31 */
32 export interface CreateWorkspaceServiceAccount extends Binding.Service<
33 CreateWorkspaceServiceAccount,
34 "AWS.Grafana.CreateWorkspaceServiceAccount",
35 (
36 workspace: Workspace,
37 ) => Effect.Effect<
38 (
39 request: Omit<grafana.CreateWorkspaceServiceAccountRequest, "workspaceId">,
40 ) => Effect.Effect<
41 grafana.CreateWorkspaceServiceAccountResponse,
42 grafana.CreateWorkspaceServiceAccountError
43 >
44 >
45 > {}
46 export const CreateWorkspaceServiceAccount = Binding.Service<CreateWorkspaceServiceAccount>(
47 "AWS.Grafana.CreateWorkspaceServiceAccount",
48 );