| 1 | import type * as grafana from "@distilled.cloud/aws/grafana"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Workspace } from "./Workspace.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for the `ListWorkspaceServiceAccounts` operation (IAM |
| 8 | * action `grafana:ListWorkspaceServiceAccounts`), scoped to one |
| 9 | * {@link Workspace}. |
| 10 | * |
| 11 | * Lists the Grafana service accounts in the workspace. Provide the |
| 12 | * implementation with |
| 13 | * `Effect.provide(AWS.Grafana.ListWorkspaceServiceAccountsHttp)`. |
| 14 | * ### Managing Service Accounts |
| 15 | * **Example:** List the Workspace's Service Accounts |
| 16 | * ```typescript |
| 17 | * const listServiceAccounts = |
| 18 | * yield* Grafana.ListWorkspaceServiceAccounts(workspace); |
| 19 | * |
| 20 | * const { serviceAccounts } = yield* listServiceAccounts(); |
| 21 | * for (const account of serviceAccounts) { |
| 22 | * yield* Effect.logInfo(`${account.name} (${account.grafanaRole})`); |
| 23 | * } |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface ListWorkspaceServiceAccounts extends Binding.Service< |
| 29 | ListWorkspaceServiceAccounts, |
| 30 | "AWS.Grafana.ListWorkspaceServiceAccounts", |
| 31 | ( |
| 32 | workspace: Workspace, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request?: Omit< |
| 36 | grafana.ListWorkspaceServiceAccountsRequest, |
| 37 | "workspaceId" |
| 38 | >, |
| 39 | ) => Effect.Effect< |
| 40 | grafana.ListWorkspaceServiceAccountsResponse, |
| 41 | grafana.ListWorkspaceServiceAccountsError |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | export const ListWorkspaceServiceAccounts = |
| 46 | Binding.Service<ListWorkspaceServiceAccounts>( |
| 47 | "AWS.Grafana.ListWorkspaceServiceAccounts", |
| 48 | ); |