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

main
ts 31 lines 1.08 KB
Raw
1 import * as scheduler from "@distilled.cloud/gcp/cloudscheduler_v1";
2 import { Credentials } from "@distilled.cloud/gcp/Credentials";
3 import * as HttpClient from "effect/http/HttpClient";
4 import * as Layer from "effect/Layer";
5 import { makeJobHttpBinding } from "./BindingHttp.ts";
6 import { PauseJob } from "./PauseJob.ts";
7
8 /**
9 * HTTP implementation of {@link PauseJob}.
10 *
11 * Grants `roles/cloudscheduler.admin` on the project because it is the
12 * only predefined role with `cloudscheduler.jobs.pause`, and Cloud Scheduler
13 * supports neither per-job IAM policies nor IAM Conditions on
14 * `resource.name`.
15 *
16 * @layer
17 * @provides GCP.CloudScheduler.PauseJob
18 */
19 export const PauseJobHttp: Layer.Layer<PauseJob, never, Credentials | HttpClient.HttpClient> =
20 Layer.effect(
21 PauseJob,
22 makeJobHttpBinding<
23 scheduler.PauseProjectsLocationsJobsRequest,
24 scheduler.Job,
25 scheduler.PauseProjectsLocationsJobsError
26 >({
27 tag: "GCP.CloudScheduler.PauseJob",
28 iam: { role: "roles/cloudscheduler.admin" },
29 operation: scheduler.pauseProjectsLocationsJobs,
30 }),
31 );