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:GetUsageStatistics`.
8 *
9 * Reports GuardDuty usage (cost) statistics for the detector, grouped by data source, feature, or member account.
10 * The detector id is injected from the bound {@link Detector}.
11 * Provide the implementation with
12 * `Effect.provide(AWS.GuardDuty.GetUsageStatisticsHttp)`.
13 * ### Usage & Coverage
14 * **Example:** Usage by Data Source
15 * ```typescript
16 * // init
17 * const getUsageStatistics = yield* AWS.GuardDuty.GetUsageStatistics(detector);
18 *
19 * // runtime
20 * const { UsageStatistics } = yield* getUsageStatistics({
21 * UsageStatisticType: "SUM_BY_DATA_SOURCE",
22 * UsageCriteria: { DataSources: ["FLOW_LOGS"] },
23 * });
24 * ```
25 *
26 * @binding
27 */
28export interface GetUsageStatistics extends Binding.Service<
29 GetUsageStatistics,
30 "AWS.GuardDuty.GetUsageStatistics",
31 (
32 detector: Detector,
33 ) => Effect.Effect<
34 (
35 request?: Omit<guardduty.GetUsageStatisticsRequest, "DetectorId">,
36 ) => Effect.Effect<
37 guardduty.GetUsageStatisticsResponse,
38 guardduty.GetUsageStatisticsError
39 >
40 >
41> {}
42export const GetUsageStatistics = Binding.Service<GetUsageStatistics>(
43 "AWS.GuardDuty.GetUsageStatistics",
44);