1import type * as emr from "@distilled.cloud/aws/emr-serverless";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Application } from "./Application.ts";
5
6/**
7 * Request accepted by the {@link GetSession} runtime callable. The
8 * `applicationId` is injected from the bound {@link Application}.
9 */
10export type GetSessionInput = Omit<emr.GetSessionRequest, "applicationId">;
11
12/**
13 * Runtime binding for `emr-serverless:GetSession`.
14 *
15 * Reads an interactive session's detail on the bound {@link Application} —
16 * state, execution role, idle time, resource utilization. Provide the
17 * implementation with `Effect.provide(AWS.EMRServerless.GetSessionHttp)`.
18 * ### Interactive Sessions
19 * **Example:** Poll A Session
20 * ```typescript
21 * // init
22 * const getSession = yield* AWS.EMRServerless.GetSession(app);
23 *
24 * // runtime
25 * const { session } = yield* getSession({ sessionId });
26 * yield* Effect.log(`${session.sessionId} is ${session.state}`);
27 * ```
28 *
29 * @binding
30 */
31export interface GetSession extends Binding.Service<
32 GetSession,
33 "AWS.EMRServerless.GetSession",
34 (
35 application: Application,
36 ) => Effect.Effect<
37 (
38 request: GetSessionInput,
39 ) => Effect.Effect<emr.GetSessionResponse, emr.GetSessionError>
40 >
41> {}
42export const GetSession = Binding.Service<GetSession>(
43 "AWS.EMRServerless.GetSession",
44);