| 1 | import type * as guardduty from "@distilled.cloud/aws/guardduty"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Detector } from "./Detector.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `guardduty:GetCoverageStatistics`. |
| 8 | * |
| 9 | * Aggregates runtime-monitoring coverage counts (healthy vs unhealthy) for the detector's monitored resources. |
| 10 | * The detector id is injected from the bound {@link Detector}. |
| 11 | * Provide the implementation with |
| 12 | * `Effect.provide(AWS.GuardDuty.GetCoverageStatisticsHttp)`. |
| 13 | * ### Usage & Coverage |
| 14 | * **Example:** Coverage by Resource Type |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const getCoverageStatistics = yield* AWS.GuardDuty.GetCoverageStatistics(detector); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { CoverageStatistics } = yield* getCoverageStatistics({ |
| 21 | * StatisticsType: ["COUNT_BY_RESOURCE_TYPE"], |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetCoverageStatistics extends Binding.Service< |
| 28 | GetCoverageStatistics, |
| 29 | "AWS.GuardDuty.GetCoverageStatistics", |
| 30 | ( |
| 31 | detector: Detector, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request?: Omit<guardduty.GetCoverageStatisticsRequest, "DetectorId">, |
| 35 | ) => Effect.Effect< |
| 36 | guardduty.GetCoverageStatisticsResponse, |
| 37 | guardduty.GetCoverageStatisticsError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const GetCoverageStatistics = Binding.Service<GetCoverageStatistics>( |
| 42 | "AWS.GuardDuty.GetCoverageStatistics", |
| 43 | ); |