| 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:GetSessionsStatisticsAggregation`. |
| 8 | * |
| 9 | * Fetches the status and results (cost in USD, runtime, per-group stats) |
| 10 | * of an aggregation started with |
| 11 | * {@link StartSessionsStatisticsAggregation} on the bound {@link Farm}. |
| 12 | * The farm's `farmId` is injected from the binding. Provide the |
| 13 | * implementation with |
| 14 | * `Effect.provide(AWS.Deadline.GetSessionsStatisticsAggregationHttp)`. |
| 15 | * ### Usage Statistics |
| 16 | * **Example:** Poll An Aggregation Until It Completes |
| 17 | * ```typescript |
| 18 | * // init — bind the operation to the farm |
| 19 | * const getAggregation = |
| 20 | * yield* AWS.Deadline.GetSessionsStatisticsAggregation(farm); |
| 21 | * |
| 22 | * // runtime |
| 23 | * const result = yield* getAggregation({ aggregationId }).pipe( |
| 24 | * Effect.repeat({ |
| 25 | * schedule: Schedule.spaced("2 seconds"), |
| 26 | * until: (r) => r.status !== "IN_PROGRESS", |
| 27 | * times: 30, |
| 28 | * }), |
| 29 | * ); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface GetSessionsStatisticsAggregation extends Binding.Service< |
| 35 | GetSessionsStatisticsAggregation, |
| 36 | "AWS.Deadline.GetSessionsStatisticsAggregation", |
| 37 | ( |
| 38 | farm: Farm, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: Omit<deadline.GetSessionsStatisticsAggregationRequest, "farmId">, |
| 42 | ) => Effect.Effect< |
| 43 | deadline.GetSessionsStatisticsAggregationResponse, |
| 44 | deadline.GetSessionsStatisticsAggregationError |
| 45 | > |
| 46 | > |
| 47 | > {} |
| 48 | export const GetSessionsStatisticsAggregation = |
| 49 | Binding.Service<GetSessionsStatisticsAggregation>( |
| 50 | "AWS.Deadline.GetSessionsStatisticsAggregation", |
| 51 | ); |