| 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 `AssociateLicense` operation (IAM action |
| 8 | * `grafana:AssociateLicense`), scoped to one {@link Workspace}. |
| 9 | * |
| 10 | * Assigns a Grafana Enterprise license to the workspace. Pass a valid |
| 11 | * Grafana Labs token as `grafanaToken` when upgrading to `ENTERPRISE`. |
| 12 | * Upgrading incurs additional fees. Provide the implementation with |
| 13 | * `Effect.provide(AWS.Grafana.AssociateLicenseHttp)`. |
| 14 | * ### Managing Licenses |
| 15 | * **Example:** Upgrade to Grafana Enterprise |
| 16 | * ```typescript |
| 17 | * const associateLicense = yield* Grafana.AssociateLicense(workspace); |
| 18 | * |
| 19 | * const { workspace: ws } = yield* associateLicense({ |
| 20 | * licenseType: "ENTERPRISE", |
| 21 | * grafanaToken: token, |
| 22 | * }); |
| 23 | * // ws.licenseType → "ENTERPRISE" |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface AssociateLicense extends Binding.Service< |
| 29 | AssociateLicense, |
| 30 | "AWS.Grafana.AssociateLicense", |
| 31 | ( |
| 32 | workspace: Workspace, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: Omit<grafana.AssociateLicenseRequest, "workspaceId">, |
| 36 | ) => Effect.Effect< |
| 37 | grafana.AssociateLicenseResponse, |
| 38 | grafana.AssociateLicenseError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const AssociateLicense = Binding.Service<AssociateLicense>( |
| 43 | "AWS.Grafana.AssociateLicense", |
| 44 | ); |