The best way to control Claude Code, Codex and more from any computer or phone
| 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 { ResumeJob } from "./ResumeJob.ts"; |
| 7 | |
| 8 | /** |
| 9 | * HTTP implementation of {@link ResumeJob}. |
| 10 | * |
| 11 | * Grants `roles/cloudscheduler.admin` on the project because it is the |
| 12 | * only predefined role with `cloudscheduler.jobs.enable`, and Cloud Scheduler |
| 13 | * supports neither per-job IAM policies nor IAM Conditions on |
| 14 | * `resource.name`. |
| 15 | * |
| 16 | * @layer |
| 17 | * @provides GCP.CloudScheduler.ResumeJob |
| 18 | */ |
| 19 | export const ResumeJobHttp: Layer.Layer<ResumeJob, never, Credentials | HttpClient.HttpClient> = |
| 20 | Layer.effect( |
| 21 | ResumeJob, |
| 22 | makeJobHttpBinding< |
| 23 | scheduler.ResumeProjectsLocationsJobsRequest, |
| 24 | scheduler.Job, |
| 25 | scheduler.ResumeProjectsLocationsJobsError |
| 26 | >({ |
| 27 | tag: "GCP.CloudScheduler.ResumeJob", |
| 28 | iam: { role: "roles/cloudscheduler.admin" }, |
| 29 | operation: scheduler.resumeProjectsLocationsJobs, |
| 30 | }), |
| 31 | ); |