1import type * as guardduty from "@distilled.cloud/aws/guardduty";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Detector } from "./Detector.ts";
5
6/**
7 * Runtime binding for `guardduty:GetFindingsStatistics`.
8 *
9 * Aggregates the detector's findings into statistics (grouped by severity, account, resource, or finding type) for dashboards and alert thresholds.
10 * The detector id is injected from the bound {@link Detector}.
11 * Provide the implementation with
12 * `Effect.provide(AWS.GuardDuty.GetFindingsStatisticsHttp)`.
13 * ### Working with Findings
14 * **Example:** Count Findings by Severity
15 * ```typescript
16 * // init
17 * const getFindingsStatistics = yield* AWS.GuardDuty.GetFindingsStatistics(detector);
18 *
19 * // runtime
20 * const { FindingStatistics } = yield* getFindingsStatistics({
21 * GroupBy: "SEVERITY",
22 * });
23 * ```
24 *
25 * @binding
26 */
27export interface GetFindingsStatistics extends Binding.Service<
28 GetFindingsStatistics,
29 "AWS.GuardDuty.GetFindingsStatistics",
30 (
31 detector: Detector,
32 ) => Effect.Effect<
33 (
34 request?: Omit<guardduty.GetFindingsStatisticsRequest, "DetectorId">,
35 ) => Effect.Effect<
36 guardduty.GetFindingsStatisticsResponse,
37 guardduty.GetFindingsStatisticsError
38 >
39 >
40> {}
41export const GetFindingsStatistics = Binding.Service<GetFindingsStatistics>(
42 "AWS.GuardDuty.GetFindingsStatistics",
43);