1import type * as grafana from "@distilled.cloud/aws/grafana";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Workspace } from "./Workspace.ts";
5
6/**
7 * Runtime binding for the `DeleteWorkspaceServiceAccountToken` operation
8 * (IAM action `grafana:DeleteWorkspaceServiceAccountToken`), scoped to one
9 * {@link Workspace}.
10 *
11 * Revokes a service account API token — the other half of a token-rotation
12 * loop. Provide the implementation with
13 * `Effect.provide(AWS.Grafana.DeleteWorkspaceServiceAccountTokenHttp)`.
14 * ### Managing Service Accounts
15 * **Example:** Revoke a Rotated-Out Token
16 * ```typescript
17 * const deleteToken =
18 * yield* Grafana.DeleteWorkspaceServiceAccountToken(workspace);
19 *
20 * yield* deleteToken({
21 * serviceAccountId: account.id,
22 * tokenId: staleToken.id,
23 * });
24 * ```
25 *
26 * @binding
27 */
28export interface DeleteWorkspaceServiceAccountToken extends Binding.Service<
29 DeleteWorkspaceServiceAccountToken,
30 "AWS.Grafana.DeleteWorkspaceServiceAccountToken",
31 (
32 workspace: Workspace,
33 ) => Effect.Effect<
34 (
35 request: Omit<
36 grafana.DeleteWorkspaceServiceAccountTokenRequest,
37 "workspaceId"
38 >,
39 ) => Effect.Effect<
40 grafana.DeleteWorkspaceServiceAccountTokenResponse,
41 grafana.DeleteWorkspaceServiceAccountTokenError
42 >
43 >
44> {}
45export const DeleteWorkspaceServiceAccountToken =
46 Binding.Service<DeleteWorkspaceServiceAccountToken>(
47 "AWS.Grafana.DeleteWorkspaceServiceAccountToken",
48 );