| 1 | import type * as developerconnect from "@distilled.cloud/gcp/developerconnect_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { ConnectionsGitRepositoryLink } from "./ConnectionsGitRepositoryLink.ts"; |
| 6 | |
| 7 | export interface FetchReadTokenRequest extends Omit< |
| 8 | developerconnect.FetchReadTokenProjectsLocationsConnectionsGitRepositoryLinksRequest, |
| 9 | "gitRepositoryLink" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Developer Connect `gitRepositoryLinks.fetchReadToken`. |
| 14 | * |
| 15 | * Bind this operation to a {@link ConnectionsGitRepositoryLink} in a |
| 16 | * Function/Action init phase. Provide {@link FetchReadTokenHttp}. |
| 17 | * Returns a short-lived token that can clone the remote Git repository. |
| 18 | * |
| 19 | * ### Fetching a Read Token |
| 20 | * **Example:** Clone with a read token |
| 21 | * ```typescript |
| 22 | * const fetchReadToken = yield* GCP.DeveloperConnect.FetchReadToken(source); |
| 23 | * const { token, expirationTime } = yield* fetchReadToken(); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | * @category DeveloperConnect |
| 28 | */ |
| 29 | export interface FetchReadToken extends Binding.Service< |
| 30 | FetchReadToken, |
| 31 | "GCP.DeveloperConnect.FetchReadToken", |
| 32 | ( |
| 33 | link: ConnectionsGitRepositoryLink, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request?: FetchReadTokenRequest, |
| 37 | ) => Effect.Effect< |
| 38 | developerconnect.FetchReadTokenResponse, |
| 39 | developerconnect.FetchReadTokenProjectsLocationsConnectionsGitRepositoryLinksError, |
| 40 | RuntimeContext |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | |
| 45 | export const FetchReadToken = Binding.Service<FetchReadToken>( |
| 46 | "GCP.DeveloperConnect.FetchReadToken", |
| 47 | ); |