1import type * as scheduler from "@distilled.cloud/gcp/cloudscheduler_v1";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { Job } from "./Job.ts";
6
7export interface PauseJobRequest extends Omit<
8 scheduler.PauseProjectsLocationsJobsRequest,
9 "name"
10> {}
11
12/**
13 * Runtime binding for Cloud Scheduler `jobs.pause`.
14 *
15 * Bind this operation to a {@link Job} in a Function/Action init phase.
16 * Provide {@link PauseJobHttp}.
17 *
18 * Grants `roles/cloudscheduler.admin` on the project: it is the only
19 * predefined role with `cloudscheduler.jobs.pause`, and Cloud Scheduler has
20 * neither per-job IAM policies nor IAM Conditions on `resource.name`.
21 *
22 * ### Pausing Jobs
23 * **Example:** Pause the bound job
24 * ```typescript
25 * const pauseJob = yield* GCP.CloudScheduler.PauseJob(ping);
26 * yield* pauseJob();
27 * ```
28 *
29 * @binding
30 * @category CloudScheduler
31 */
32export interface PauseJob extends Binding.Service<
33 PauseJob,
34 "GCP.CloudScheduler.PauseJob",
35 (
36 job: Job,
37 ) => Effect.Effect<
38 (
39 request?: PauseJobRequest,
40 ) => Effect.Effect<
41 scheduler.Job,
42 scheduler.PauseProjectsLocationsJobsError,
43 RuntimeContext
44 >
45 >
46> {}
47
48export const PauseJob = Binding.Service<PauseJob>(
49 "GCP.CloudScheduler.PauseJob",
50);