1import type * as comprehend from "@distilled.cloud/aws/comprehend";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Role } from "../IAM/Role.ts";
5
6/**
7 * `StartKeyPhrasesDetectionJob` request with `DataAccessRoleArn` defaulting to the role the
8 * binding was constructed with.
9 */
10export interface StartKeyPhrasesDetectionJobRequest extends Omit<
11 comprehend.StartKeyPhrasesDetectionJobRequest,
12 "DataAccessRoleArn"
13> {
14 /**
15 * IAM role Amazon Comprehend assumes to read the input documents and write
16 * the results.
17 * @default the data-access role bound via `StartKeyPhrasesDetectionJob(role)`
18 */
19 DataAccessRoleArn?: string;
20}
21
22/**
23 * Runtime binding for `comprehend:StartKeyPhrasesDetectionJob` — start an asynchronous
24 * key-phrase detection job over a collection of documents in S3.
25 *
26 * The binding is constructed with the **data-access role** (the IAM role
27 * Amazon Comprehend assumes to read the input documents and write results;
28 * its trust policy must allow `comprehend.amazonaws.com`). The role's ARN is
29 * injected as `DataAccessRoleArn` on every runtime request and the host is
30 * granted `iam:PassRole` on it alongside the `comprehend:StartKeyPhrasesDetectionJob`
31 * action (which has no resource-level IAM). Track the job with
32 * {@link DescribeKeyPhrasesDetectionJob} and stop it with
33 * {@link StopKeyPhrasesDetectionJob}.
34 *
35 * ### Starting Analysis Jobs
36 * **Example:** Start an Asynchronous KeyPhrases Detection Job
37 * ```typescript
38 * // deploy time — bind the Comprehend data-access role
39 * const startKeyPhrasesDetectionJob = yield* AWS.Comprehend.StartKeyPhrasesDetectionJob(dataAccessRole);
40 *
41 * // runtime
42 * const job = yield* startKeyPhrasesDetectionJob({
43 * InputDataConfig: { S3Uri: "s3://my-bucket/input/", InputFormat: "ONE_DOC_PER_LINE" },
44 * OutputDataConfig: { S3Uri: "s3://my-bucket/output/" },
45 * LanguageCode: "en",
46 * });
47 * // job.JobId, job.JobStatus === "SUBMITTED"
48 * ```
49 *
50 * @binding
51 */
52export interface StartKeyPhrasesDetectionJob extends Binding.Service<
53 StartKeyPhrasesDetectionJob,
54 "AWS.Comprehend.StartKeyPhrasesDetectionJob",
55 <R extends Role>(
56 dataAccessRole: R,
57 ) => Effect.Effect<
58 (
59 request: StartKeyPhrasesDetectionJobRequest,
60 ) => Effect.Effect<
61 comprehend.StartKeyPhrasesDetectionJobResponse,
62 comprehend.StartKeyPhrasesDetectionJobError
63 >
64 >
65> {}
66export const StartKeyPhrasesDetectionJob =
67 Binding.Service<StartKeyPhrasesDetectionJob>(
68 "AWS.Comprehend.StartKeyPhrasesDetectionJob",
69 );