1import type * as bqdt from "@distilled.cloud/gcp/bigquerydatatransfer_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { TransferConfig } from "./TransferConfig.ts";
6
7export interface StartManualRunsRequest extends Omit<
8 bqdt.StartManualRunsProjectsLocationsTransferConfigsRequest,
9 "parent"
10> {}
11
12/**
13 * Runtime binding for BigQuery Data Transfer `transferConfigs.startManualRuns`.
14 *
15 * Starts one or more transfer runs for a {@link TransferConfig}. Bind this
16 * operation in a Function/Action init phase. Provide
17 * {@link StartManualRunsHttp}. `requestedRunTime` and `requestedTimeRange`
18 * must be in the past.
19 *
20 * Grants `roles/bigquery.admin` on the project because
21 * `bigquery.transfers.update` (required by `startManualRuns`) is in no
22 * narrower predefined role, and transfer configs have no resource-level
23 * IAM or IAM Conditions support to scope it to the one config.
24 *
25 * ### Starting Manual Runs
26 * **Example:** Run for a specific past timestamp
27 * ```typescript
28 * const start = yield* GCP.BigQueryDataTransfer.StartManualRuns(nightly);
29 * const result = yield* start({
30 * body: { requestedRunTime: "2020-01-01T00:00:00Z" },
31 * });
32 * ```
33 *
34 * @binding
35 * @category BigQueryDataTransfer
36 */
37export interface StartManualRuns extends Binding.Service<
38 StartManualRuns,
39 "GCP.BigQueryDataTransfer.StartManualRuns",
40 (
41 config: TransferConfig,
42 ) => Effect.Effect<
43 (
44 request?: StartManualRunsRequest,
45 ) => Effect.Effect<
46 bqdt.StartManualTransferRunsResponse,
47 bqdt.StartManualRunsProjectsLocationsTransferConfigsError,
48 RuntimeContext
49 >
50 >
51> {}
52
53export const StartManualRuns = Binding.Service<StartManualRuns>(
54 "GCP.BigQueryDataTransfer.StartManualRuns",
55);