| 1 | import type * as deadline from "@distilled.cloud/aws/deadline"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 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< |
| 41 | deadline.StartSessionsStatisticsAggregationRequest, |
| 42 | "farmId" |
| 43 | >, |
| 44 | ) => Effect.Effect< |
| 45 | deadline.StartSessionsStatisticsAggregationResponse, |
| 46 | deadline.StartSessionsStatisticsAggregationError |
| 47 | > |
| 48 | > |
| 49 | > {} |
| 50 | export const StartSessionsStatisticsAggregation = |
| 51 | Binding.Service<StartSessionsStatisticsAggregation>( |
| 52 | "AWS.Deadline.StartSessionsStatisticsAggregation", |
| 53 | ); |