| 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 DescribeAnomalyDetectorsRequest |
| 6 | extends cloudwatch.DescribeAnomalyDetectorsInput {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `cloudwatch:DescribeAnomalyDetectors` — list the |
| 10 | * anomaly detection models in the account/region, optionally filtered by |
| 11 | * namespace, metric name, or dimensions. |
| 12 | * |
| 13 | * Provide `CloudWatch.DescribeAnomalyDetectorsHttp` on the hosting Lambda |
| 14 | * Function to satisfy the requirement. |
| 15 | * ### Reading Anomaly Detectors |
| 16 | * **Example:** List Detectors in a Namespace |
| 17 | * ```typescript |
| 18 | * // init — grants cloudwatch:DescribeAnomalyDetectors |
| 19 | * const describeAnomalyDetectors = yield* AWS.CloudWatch.DescribeAnomalyDetectors(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const result = yield* describeAnomalyDetectors({ |
| 23 | * Namespace: "MyApp/Payments", |
| 24 | * }); |
| 25 | * const detectors = result.AnomalyDetectors ?? []; |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface DescribeAnomalyDetectors extends Binding.Service< |
| 31 | DescribeAnomalyDetectors, |
| 32 | "AWS.CloudWatch.DescribeAnomalyDetectors", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request?: DescribeAnomalyDetectorsRequest, |
| 36 | ) => Effect.Effect< |
| 37 | cloudwatch.DescribeAnomalyDetectorsOutput, |
| 38 | cloudwatch.DescribeAnomalyDetectorsError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const DescribeAnomalyDetectors = |
| 44 | Binding.Service<DescribeAnomalyDetectors>( |
| 45 | "AWS.CloudWatch.DescribeAnomalyDetectors", |
| 46 | ); |