| 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 `UpdateWorkspaceConfiguration` operation (IAM |
| 8 | * action `grafana:UpdateWorkspaceConfiguration`), scoped to one |
| 9 | * {@link Workspace}. |
| 10 | * |
| 11 | * Writes the workspace's Grafana configuration JSON string and can also |
| 12 | * trigger an in-place Grafana version upgrade via `grafanaVersion`. Provide |
| 13 | * the implementation with |
| 14 | * `Effect.provide(AWS.Grafana.UpdateWorkspaceConfigurationHttp)`. |
| 15 | * ### Managing Configuration |
| 16 | * **Example:** Enable Unified Alerting |
| 17 | * ```typescript |
| 18 | * const updateConfig = yield* Grafana.UpdateWorkspaceConfiguration(workspace); |
| 19 | * |
| 20 | * yield* updateConfig({ |
| 21 | * configuration: JSON.stringify({ |
| 22 | * unifiedAlerting: { enabled: true }, |
| 23 | * }), |
| 24 | * }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface UpdateWorkspaceConfiguration extends Binding.Service< |
| 30 | UpdateWorkspaceConfiguration, |
| 31 | "AWS.Grafana.UpdateWorkspaceConfiguration", |
| 32 | ( |
| 33 | workspace: Workspace, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request: Omit<grafana.UpdateWorkspaceConfigurationRequest, "workspaceId">, |
| 37 | ) => Effect.Effect< |
| 38 | grafana.UpdateWorkspaceConfigurationResponse, |
| 39 | grafana.UpdateWorkspaceConfigurationError |
| 40 | > |
| 41 | > |
| 42 | > {} |
| 43 | export const UpdateWorkspaceConfiguration = |
| 44 | Binding.Service<UpdateWorkspaceConfiguration>( |
| 45 | "AWS.Grafana.UpdateWorkspaceConfiguration", |
| 46 | ); |