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

main
ts 53 lines 1.5 KB
Raw
1 import type * as dataproc from "@distilled.cloud/gcp/dataproc_v1";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { Cluster } from "./Cluster.ts";
6
7 export interface SubmitJobRequest extends Omit<
8 dataproc.SubmitProjectsRegionsJobsRequest,
9 "projectId" | "region"
10 > {}
11
12 /**
13 * Runtime binding for Dataproc `jobs.submit`.
14 *
15 * Bind this operation to a {@link Cluster} in a Function/Action init
16 * phase. Provide {@link SubmitJobHttp}. The bound cluster is injected as
17 * `job.placement.clusterName` unless the request already sets one.
18 *
19 * ### Submitting Jobs
20 * **Example:** Run SparkPi on the bound cluster
21 * ```typescript
22 * const submitJob = yield* GCP.Dataproc.SubmitJob(cluster);
23 * const job = yield* submitJob({
24 * body: {
25 * job: {
26 * sparkJob: {
27 * mainClass: "org.apache.spark.examples.SparkPi",
28 * jarFileUris: [
29 * "file:///usr/lib/spark/examples/jars/spark-examples.jar",
30 * ],
31 * args: ["10"],
32 * },
33 * },
34 * },
35 * });
36 * ```
37 *
38 * @binding
39 * @category Dataproc
40 */
41 export interface SubmitJob extends Binding.Service<
42 SubmitJob,
43 "GCP.Dataproc.SubmitJob",
44 (
45 cluster: Cluster,
46 ) => Effect.Effect<
47 (
48 request: SubmitJobRequest,
49 ) => Effect.Effect<dataproc.Job, dataproc.SubmitProjectsRegionsJobsError, RuntimeContext>
50 >
51 > {}
52
53 export const SubmitJob = Binding.Service<SubmitJob>("GCP.Dataproc.SubmitJob");