1import type * as transcribe from "@distilled.cloud/aws/transcribe";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Role } from "../IAM/Role.ts";
5
6/**
7 * `StartCallAnalyticsJob` request with `DataAccessRoleArn` defaulting to the role the
8 * binding was constructed with.
9 */
10export interface StartCallAnalyticsJobRequest extends Omit<
11 transcribe.StartCallAnalyticsJobRequest,
12 "DataAccessRoleArn"
13> {
14 /**
15 * IAM role Amazon Transcribe assumes to access your Amazon S3 data.
16 * @default the data-access role bound via `StartCallAnalyticsJob(role)`
17 */
18 DataAccessRoleArn?: string;
19}
20
21/**
22 * Runtime binding for `transcribe:StartCallAnalyticsJob` — start an asynchronous Call Analytics job (transcription plus call characteristics, sentiment, and category matching) over a call recording in S3.
23 *
24 * The binding is constructed with the **data-access role** (the IAM role
25 * Amazon Transcribe assumes to read your Amazon S3 data and write results;
26 * its trust policy must allow `transcribe.amazonaws.com`). The role's ARN
27 * is injected as `DataAccessRoleArn` on every runtime request and the host
28 * is granted `iam:PassRole` on it alongside `transcribe:StartCallAnalyticsJob`
29 * (which has no resource-level IAM).
30 *
31 * ### Call Analytics Jobs
32 * **Example:** Start a Call Analytics Job
33 * ```typescript
34 * // init — bind the Transcribe data-access role
35 * const startCallAnalyticsJob = yield* AWS.Transcribe.StartCallAnalyticsJob(dataAccessRole);
36 *
37 * // runtime
38 * const { CallAnalyticsJob } = yield* startCallAnalyticsJob({
39 * CallAnalyticsJobName: "my-call",
40 * Media: { MediaFileUri: "s3://my-bucket/calls/call.wav" },
41 * });
42 * ```
43 *
44 * @binding
45 */
46export interface StartCallAnalyticsJob extends Binding.Service<
47 StartCallAnalyticsJob,
48 "AWS.Transcribe.StartCallAnalyticsJob",
49 <R extends Role>(
50 dataAccessRole: R,
51 ) => Effect.Effect<
52 (
53 request: StartCallAnalyticsJobRequest,
54 ) => Effect.Effect<
55 transcribe.StartCallAnalyticsJobResponse,
56 transcribe.StartCallAnalyticsJobError
57 >
58 >
59> {}
60export const StartCallAnalyticsJob = Binding.Service<StartCallAnalyticsJob>(
61 "AWS.Transcribe.StartCallAnalyticsJob",
62);