@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, 06:00 UTC

main
ts 50 lines 1.74 KB
Raw
1 import type * as deadline from "@distilled.cloud/aws/deadline";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Farm } from "./Farm.ts";
5
6 /**
7 * Runtime binding for `deadline:StartSessionsStatisticsAggregation`.
8 *
9 * Starts an asynchronous usage/cost statistics aggregation over the bound
10 * {@link Farm}'s queues or fleets. Poll the returned `aggregationId` with
11 * {@link GetSessionsStatisticsAggregation} for the results. The farm's
12 * `farmId` is injected from the binding. Provide the implementation with
13 * `Effect.provide(AWS.Deadline.StartSessionsStatisticsAggregationHttp)`.
14 * ### Usage Statistics
15 * **Example:** Aggregate The Last 24 Hours Of Queue Cost
16 * ```typescript
17 * // init — bind the operation to the farm
18 * const startAggregation =
19 * yield* AWS.Deadline.StartSessionsStatisticsAggregation(farm);
20 *
21 * // runtime
22 * const { aggregationId } = yield* startAggregation({
23 * resourceIds: { queueIds: [queueId] },
24 * startTime: new Date(Date.now() - 24 * 3600 * 1000),
25 * endTime: new Date(),
26 * groupBy: ["QUEUE_ID"],
27 * statistics: ["SUM"],
28 * });
29 * ```
30 *
31 * @binding
32 */
33 export interface StartSessionsStatisticsAggregation extends Binding.Service<
34 StartSessionsStatisticsAggregation,
35 "AWS.Deadline.StartSessionsStatisticsAggregation",
36 (
37 farm: Farm,
38 ) => Effect.Effect<
39 (
40 request: Omit<deadline.StartSessionsStatisticsAggregationRequest, "farmId">,
41 ) => Effect.Effect<
42 deadline.StartSessionsStatisticsAggregationResponse,
43 deadline.StartSessionsStatisticsAggregationError
44 >
45 >
46 > {}
47 export const StartSessionsStatisticsAggregation =
48 Binding.Service<StartSessionsStatisticsAggregation>(
49 "AWS.Deadline.StartSessionsStatisticsAggregation",
50 );