@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, 04:45 UTC

main
ts 62 lines 2.18 KB
Raw
1 import type * as transcribe from "@distilled.cloud/aws/transcribe";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Role } from "../IAM/Role.ts";
5
6 /**
7 * `StartCallAnalyticsJob` request with `DataAccessRoleArn` defaulting to the role the
8 * binding was constructed with.
9 */
10 export 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 */
46 export 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 > {}
60 export const StartCallAnalyticsJob = Binding.Service<StartCallAnalyticsJob>(
61 "AWS.Transcribe.StartCallAnalyticsJob",
62 );