| 1 | import * as cloudwatch from "@distilled.cloud/aws/cloudwatch"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | export interface ListDashboardsRequest extends cloudwatch.ListDashboardsInput {} |
| 6 | |
| 7 | /** |
| 8 | * Runtime binding for `cloudwatch:ListDashboards` — list the dashboards in |
| 9 | * the account, optionally filtered by name prefix. |
| 10 | * |
| 11 | * Provide `CloudWatch.ListDashboardsHttp` on the hosting Lambda Function |
| 12 | * to satisfy the requirement. |
| 13 | * ### Reading Dashboards |
| 14 | * **Example:** List Dashboards |
| 15 | * ```typescript |
| 16 | * // init — grants cloudwatch:ListDashboards |
| 17 | * const listDashboards = yield* AWS.CloudWatch.ListDashboards(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const result = yield* listDashboards(); |
| 21 | * const names = (result.DashboardEntries ?? []).map((e) => e.DashboardName); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | */ |
| 26 | export interface ListDashboards extends Binding.Service< |
| 27 | ListDashboards, |
| 28 | "AWS.CloudWatch.ListDashboards", |
| 29 | () => Effect.Effect< |
| 30 | ( |
| 31 | request?: ListDashboardsRequest, |
| 32 | ) => Effect.Effect< |
| 33 | cloudwatch.ListDashboardsOutput, |
| 34 | cloudwatch.ListDashboardsError |
| 35 | > |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const ListDashboards = Binding.Service<ListDashboards>( |
| 40 | "AWS.CloudWatch.ListDashboards", |
| 41 | ); |