@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 41 lines 1.35 KB
Raw
1 import type * as guardduty from "@distilled.cloud/aws/guardduty";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import 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 */
28 export 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<guardduty.GetUsageStatisticsResponse, guardduty.GetUsageStatisticsError>
37 >
38 > {}
39 export const GetUsageStatistics = Binding.Service<GetUsageStatistics>(
40 "AWS.GuardDuty.GetUsageStatistics",
41 );