sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ CloudWatch/ DescribeAnomalyDetectors.ts

import * as cloudwatch from "@distilled.cloud/aws/cloudwatch";
import * as Binding from "alchemy/Binding";
import * as Effect from "effect/Effect";

export interface DescribeAnomalyDetectorsRequest extends cloudwatch.DescribeAnomalyDetectorsInput {}

/**
 * Runtime binding for `cloudwatch:DescribeAnomalyDetectors` — list the
 * anomaly detection models in the account/region, optionally filtered by
 * namespace, metric name, or dimensions.
 *
 * Provide `CloudWatch.DescribeAnomalyDetectorsHttp` on the hosting Lambda
 * Function to satisfy the requirement.
 * ### Reading Anomaly Detectors
 * **Example:** List Detectors in a Namespace
 * ```typescript
 * // init — grants cloudwatch:DescribeAnomalyDetectors
 * const describeAnomalyDetectors = yield* AWS.CloudWatch.DescribeAnomalyDetectors();
 *
 * // runtime
 * const result = yield* describeAnomalyDetectors({
 *   Namespace: "MyApp/Payments",
 * });
 * const detectors = result.AnomalyDetectors ?? [];
 * ```
 *
 * @binding
 */
export interface DescribeAnomalyDetectors extends Binding.Service<
  DescribeAnomalyDetectors,
  "AWS.CloudWatch.DescribeAnomalyDetectors",
  () => Effect.Effect<
    (
      request?: DescribeAnomalyDetectorsRequest,
    ) => Effect.Effect<
      cloudwatch.DescribeAnomalyDetectorsOutput,
      cloudwatch.DescribeAnomalyDetectorsError
    >
  >
> {}

export const DescribeAnomalyDetectors = Binding.Service<DescribeAnomalyDetectors>(
  "AWS.CloudWatch.DescribeAnomalyDetectors",
);