The best way to control Claude Code, Codex and more from any computer or phone

main
ts 47 lines 1.65 KB
Raw
1 import type * as location from "@distilled.cloud/aws/location";
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 * `StartJob` request with `ExecutionRoleArn` injected from the bound
8 * execution role.
9 */
10 export interface StartJobRequest extends Omit<location.StartJobRequest, "ExecutionRoleArn"> {}
11
12 /**
13 * Starts a Location batch metadata job (e.g. batch address validation over
14 * an S3 input file).
15 *
16 * Runtime binding for the `StartJob` operation (IAM action `geo:StartJob`).
17 * Bind the IAM {@link Role} Location assumes to read the S3 input and write
18 * the S3 output — its ARN is injected as `ExecutionRoleArn` and the host is
19 * additionally granted `iam:PassRole` on it. Jobs are named at runtime so
20 * the `geo:StartJob` grant is on `*`. Provide the implementation with
21 * `Effect.provide(AWS.Location.StartJobHttp)`.
22 *
23 * ### Managing Batch Jobs
24 * **Example:** Start a Batch Job
25 * ```typescript
26 * const startJob = yield* Location.StartJob(jobsRole);
27 *
28 * const job = yield* startJob({
29 * Action: "ValidateAddress",
30 * InputOptions: { Format: "CSV", Location: "s3://my-bucket/addresses.csv" },
31 * OutputOptions: { Format: "CSV", Location: "s3://my-bucket/results/" },
32 * });
33 * // job.JobId → poll with Location.GetJob
34 * ```
35 *
36 * @binding
37 */
38 export interface StartJob extends Binding.Service<
39 StartJob,
40 "AWS.Location.StartJob",
41 (
42 executionRole: Role,
43 ) => Effect.Effect<
44 (request: StartJobRequest) => Effect.Effect<location.StartJobResponse, location.StartJobError>
45 >
46 > {}
47 export const StartJob = Binding.Service<StartJob>("AWS.Location.StartJob");