@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 44 lines 1.31 KB
Raw
1 import type * as scheduler from "@distilled.cloud/gcp/cloudscheduler_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 { Job } from "./Job.ts";
6
7 export 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 */
32 export 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<scheduler.Job, scheduler.PauseProjectsLocationsJobsError, RuntimeContext>
41 >
42 > {}
43
44 export const PauseJob = Binding.Service<PauseJob>("GCP.CloudScheduler.PauseJob");