| 1 | import type * as datapipelines from "@distilled.cloud/gcp/datapipelines_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { Pipeline } from "./Pipeline.ts"; |
| 6 | |
| 7 | export interface RunPipelineRequest extends Omit< |
| 8 | datapipelines.RunProjectsLocationsPipelinesRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Data Pipelines `pipelines.run`. |
| 14 | * |
| 15 | * Creates a job for the bound pipeline immediately. Use this when the |
| 16 | * internal scheduler is not configured. Bind in a Function/Action init |
| 17 | * phase and provide {@link RunPipelineHttp}. |
| 18 | * |
| 19 | * ### Running Pipelines |
| 20 | * **Example:** Run the bound pipeline now |
| 21 | * ```typescript |
| 22 | * const runPipeline = yield* GCP.DataPipelines.RunPipeline(batch); |
| 23 | * const response = yield* runPipeline(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | * @category DataPipelines |
| 28 | */ |
| 29 | export interface RunPipeline extends Binding.Service< |
| 30 | RunPipeline, |
| 31 | "GCP.DataPipelines.RunPipeline", |
| 32 | ( |
| 33 | pipeline: Pipeline, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: RunPipelineRequest, |
| 37 | ) => Effect.Effect< |
| 38 | datapipelines.GoogleCloudDatapipelinesV1RunPipelineResponse, |
| 39 | datapipelines.RunProjectsLocationsPipelinesError, |
| 40 | RuntimeContext |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const RunPipeline = Binding.Service<RunPipeline>( |
| 46 | "GCP.DataPipelines.RunPipeline", |
| 47 | ); |