The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as developerconnect from "@distilled.cloud/gcp/developerconnect_v1"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Layer from "effect/Layer"; |
| 4 | import * as GCPBindings from "../GCPBindings.ts"; |
| 5 | import { makeGitRepositoryLinkHttpBinding } from "./BindingHttp.ts"; |
| 6 | import { FetchReadWriteToken } from "./FetchReadWriteToken.ts"; |
| 7 | |
| 8 | /** |
| 9 | * HTTP implementation of {@link FetchReadWriteToken}. |
| 10 | * |
| 11 | * @layer |
| 12 | * @provides GCP.DeveloperConnect.FetchReadWriteToken |
| 13 | */ |
| 14 | export const FetchReadWriteTokenHttp = Layer.effect( |
| 15 | FetchReadWriteToken, |
| 16 | makeGitRepositoryLinkHttpBinding< |
| 17 | developerconnect.FetchReadWriteTokenProjectsLocationsConnectionsGitRepositoryLinksRequest, |
| 18 | developerconnect.FetchReadWriteTokenResponse, |
| 19 | developerconnect.FetchReadWriteTokenProjectsLocationsConnectionsGitRepositoryLinksError |
| 20 | >({ |
| 21 | tag: "GCP.DeveloperConnect.FetchReadWriteToken", |
| 22 | iam: { role: "roles/developerconnect.tokenAccessor" }, |
| 23 | operation: Effect.gen(function* () { |
| 24 | const call = yield* GCPBindings.withCredentials( |
| 25 | developerconnect.fetchReadWriteTokenProjectsLocationsConnectionsGitRepositoryLinks, |
| 26 | ); |
| 27 | return ( |
| 28 | input: developerconnect.FetchReadWriteTokenProjectsLocationsConnectionsGitRepositoryLinksRequest, |
| 29 | ) => call(input); |
| 30 | }), |
| 31 | }), |
| 32 | ); |