// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Firebase App Hosting API Client for Deno * ======================================== * * Firebase App Hosting streamlines the development and deployment of dynamic Next.js and Angular applications, offering built-in framework support, GitHub integration, and integration with other Firebase products. You can use this API to intervene in the Firebase App Hosting build process and add custom functionality not supported in our default Console & CLI flows, including triggering builds from external CI/CD workflows or deploying from pre-built container images. * * Docs: https://firebase.google.com/docs/app-hosting * Source: https://googleapis.deno.dev/v1/firebaseapphosting:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Firebase App Hosting streamlines the development and deployment of dynamic * Next.js and Angular applications, offering built-in framework support, GitHub * integration, and integration with other Firebase products. You can use this * API to intervene in the Firebase App Hosting build process and add custom * functionality not supported in our default Console & CLI flows, including * triggering builds from external CI/CD workflows or deploying from pre-built * container images. */ export class FirebaseAppHosting { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://firebaseapphosting.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Creates a new build for a backend. * * @param parent Required. The parent backend in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsBuildsCreate(parent: string, req: Build, opts: ProjectsLocationsBackendsBuildsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/builds`); if (opts.buildId !== undefined) { url.searchParams.append("buildId", String(opts.buildId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a single build. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}/builds/{buildId}`. */ async projectsLocationsBackendsBuildsDelete(name: string, opts: ProjectsLocationsBackendsBuildsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets information about a build. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}/builds/{buildId}`. */ async projectsLocationsBackendsBuildsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Build; } /** * Lists builds in a given project, location, and backend. * * @param parent Required. The parent backend in the form `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsBuildsList(parent: string, opts: ProjectsLocationsBackendsBuildsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/builds`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showDeleted !== undefined) { url.searchParams.append("showDeleted", String(opts.showDeleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListBuildsResponse; } /** * Creates a new backend in a given project and location. * * @param parent Required. A parent name of the form `projects/{project}/locations/{locationId}`. */ async projectsLocationsBackendsCreate(parent: string, req: Backend, opts: ProjectsLocationsBackendsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/backends`); if (opts.backendId !== undefined) { url.searchParams.append("backendId", String(opts.backendId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a single backend. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsDelete(name: string, opts: ProjectsLocationsBackendsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Links a new domain to a backend. * * @param parent Required. The parent backend in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsDomainsCreate(parent: string, req: Domain, opts: ProjectsLocationsBackendsDomainsCreateOptions = {}): Promise { req = serializeDomain(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/domains`); if (opts.domainId !== undefined) { url.searchParams.append("domainId", String(opts.domainId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a single domain. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}/domains/{domainId}`. */ async projectsLocationsBackendsDomainsDelete(name: string, opts: ProjectsLocationsBackendsDomainsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets information about a domain. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}/domains/{domainId}`. */ async projectsLocationsBackendsDomainsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDomain(data); } /** * Lists domains of a backend. * * @param parent Required. The parent backend in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsDomainsList(parent: string, opts: ProjectsLocationsBackendsDomainsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/domains`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showDeleted !== undefined) { url.searchParams.append("showDeleted", String(opts.showDeleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListDomainsResponse; } /** * Updates the information for a single domain. * * @param name Identifier. The resource name of the domain, e.g. `/projects/p/locations/l/backends/b/domains/foo.com` */ async projectsLocationsBackendsDomainsPatch(name: string, req: Domain, opts: ProjectsLocationsBackendsDomainsPatchOptions = {}): Promise { req = serializeDomain(req); opts = serializeProjectsLocationsBackendsDomainsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Gets information about a backend. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Backend; } /** * Lists backends in a given project and location. * * @param parent Required. A parent name of the form `projects/{project}/locations/{locationId}`. */ async projectsLocationsBackendsList(parent: string, opts: ProjectsLocationsBackendsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/backends`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showDeleted !== undefined) { url.searchParams.append("showDeleted", String(opts.showDeleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListBackendsResponse; } /** * Updates the information for a single backend. * * @param name Identifier. The resource name of the backend. Format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsPatch(name: string, req: Backend, opts: ProjectsLocationsBackendsPatchOptions = {}): Promise { opts = serializeProjectsLocationsBackendsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Creates a new rollout for a backend. * * @param parent Required. The parent backend in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsRolloutsCreate(parent: string, req: Rollout, opts: ProjectsLocationsBackendsRolloutsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/rollouts`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.rolloutId !== undefined) { url.searchParams.append("rolloutId", String(opts.rolloutId)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Gets information about a rollout. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}/rollouts/{rolloutId}`. */ async projectsLocationsBackendsRolloutsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Rollout; } /** * Lists rollouts for a backend. * * @param parent Required. The parent backend in the format: `projects/{project}/locations/{locationId}/backends/{backendId}`. */ async projectsLocationsBackendsRolloutsList(parent: string, opts: ProjectsLocationsBackendsRolloutsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/rollouts`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.showDeleted !== undefined) { url.searchParams.append("showDeleted", String(opts.showDeleted)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListRolloutsResponse; } /** * Gets information about a backend's traffic. * * @param name Required. Name of the resource in the format: `projects/{project}/locations/{locationId}/backends/{backendId}/traffic`. */ async projectsLocationsBackendsTrafficGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Traffic; } /** * Updates a backend's traffic. * * @param name Identifier. The resource name of the backend's traffic. Format: `projects/{project}/locations/{locationId}/backends/{backendId}/traffic`. */ async projectsLocationsBackendsTrafficPatch(name: string, req: Traffic, opts: ProjectsLocationsBackendsTrafficPatchOptions = {}): Promise { opts = serializeProjectsLocationsBackendsTrafficPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. This * method can be called in two ways: * **List all public locations:** Use the * path `GET /v1/locations`. * **List project-visible locations:** Use the * path `GET /v1/projects/{project_id}/locations`. This may include public * locations as well as private or other locations specifically visible to the * project. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async projectsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } } /** * The URI of an storage archive or a signed URL to use as the build source. */ export interface ArchiveSource { /** * Optional. The author contained in the metadata of a version control * change. */ author?: SourceUserMetadata; /** * Optional. An optional message that describes the uploaded version of the * source code. */ description?: string; /** * Signed URL to an archive in a storage bucket. */ externalSignedUri?: string; /** * Optional. Relative path in the archive. */ rootDirectory?: string; /** * URI to an archive in Cloud Storage. The object must be a zipped (.zip) or * gzipped archive file (.tar.gz) containing source to deploy. */ userStorageUri?: string; } /** * A backend is the primary resource of App Hosting. */ export interface Backend { /** * Optional. Unstructured key value map that may be set by external tools to * store and arbitrary metadata. They are not queryable and should be * preserved when modifying objects. */ annotations?: { [key: string]: string }; /** * Optional. The [ID of a Web * App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id) * associated with the backend. */ appId?: string; /** * Optional. If specified, the connection to an external source repository to * watch for event-driven updates to the backend. */ codebase?: Codebase; /** * Output only. Time at which the backend was created. */ readonly createTime?: Date; /** * Output only. Time at which the backend was deleted. */ readonly deleteTime?: Date; /** * Optional. Human-readable name. 63 character limit. */ displayName?: string; /** * Optional. The environment name of the backend, used to load environment * variables from environment specific configuration. */ environment?: string; /** * Output only. Server-computed checksum based on other values; may be sent * on update or delete to ensure operation is done on expected resource. */ readonly etag?: string; /** * Optional. Unstructured key value map that can be used to organize and * categorize objects. */ labels?: { [key: string]: string }; /** * Output only. A list of the resources managed by this backend. */ readonly managedResources?: ManagedResource[]; /** * Optional. Deprecated: Use `environment` instead. */ mode?: string; /** * Identifier. The resource name of the backend. Format: * `projects/{project}/locations/{locationId}/backends/{backendId}`. */ name?: string; /** * Output only. A field that, if true, indicates that the system is working * to make adjustments to the backend during a LRO. */ readonly reconciling?: boolean; /** * Optional. A field that, if true, indicates that incoming request logs are * disabled for this backend. Incoming request logs are enabled by default. */ requestLogsDisabled?: boolean; /** * Required. The name of the service account used for Cloud Build and Cloud * Run. Should have the role roles/firebaseapphosting.computeRunner or * equivalent permissions. */ serviceAccount?: string; /** * Required. Immutable. Specifies how App Hosting will serve the content for * this backend. It will either be contained to a single region * (REGIONAL_STRICT) or allowed to use App Hosting's global-replicated serving * infrastructure (GLOBAL_ACCESS). */ servingLocality?: | "SERVING_LOCALITY_UNSPECIFIED" | "REGIONAL_STRICT" | "GLOBAL_ACCESS"; /** * Output only. System-assigned, unique identifier. */ readonly uid?: string; /** * Output only. Time at which the backend was last updated. */ readonly updateTime?: Date; /** * Output only. The primary URI to communicate with the backend. */ readonly uri?: string; } /** * A single build for a backend, at a specific point codebase reference tag and * point in time. Encapsulates several resources, including an Artifact Registry * container image, a Cloud Build invocation that built the image, and the Cloud * Run revision that uses that image. */ export interface Build { /** * Optional. Unstructured key value map that may be set by external tools to * store and arbitrary metadata. They are not queryable and should be * preserved when modifying objects. */ annotations?: { [key: string]: string }; /** * Output only. The location of the [Cloud Build * logs](https://cloud.google.com/build/docs/view-build-results) for the build * process. */ readonly buildLogsUri?: string; /** * Optional. Additional configuration of the service. */ config?: Config; /** * Output only. Time at which the build was created. */ readonly createTime?: Date; /** * Output only. Time at which the build was deleted. */ readonly deleteTime?: Date; /** * Optional. Human-readable name. 63 character limit. */ displayName?: string; /** * Output only. The environment name of the backend when this build was * created. */ readonly environment?: string; /** * Output only. A list of all errors that occurred during an App Hosting * build. */ readonly errors?: Error[]; /** * Output only. Server-computed checksum based on other values; may be sent * on update or delete to ensure operation is done on expected resource. */ readonly etag?: string; /** * Output only. The Artifact Registry [container * image](https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.dockerImages) * URI, used by the Cloud Run * [`revision`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services.revisions) * for this build. */ readonly image?: string; /** * Optional. Unstructured key value map that can be used to organize and * categorize objects. */ labels?: { [key: string]: string }; /** * Identifier. The resource name of the build. Format: * `projects/{project}/locations/{locationId}/backends/{backendId}/builds/{buildId}`. */ name?: string; /** * Output only. A field that, if true, indicates that the build has an * ongoing LRO. */ readonly reconciling?: boolean; /** * Required. Immutable. The source for the build. */ source?: BuildSource; /** * Output only. The state of the build. */ readonly state?: | "STATE_UNSPECIFIED" | "BUILDING" | "BUILT" | "DEPLOYING" | "READY" | "FAILED" | "SKIPPED"; /** * Output only. System-assigned, unique identifier. */ readonly uid?: string; /** * Output only. Time at which the build was last updated. */ readonly updateTime?: Date; } /** * The source for the build. */ export interface BuildSource { /** * An archive source. */ archive?: ArchiveSource; /** * A codebase source. */ codebase?: CodebaseSource; /** * An Artifact Registry container image source. */ container?: ContainerSource; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * The connection to an external source repository to watch for event-driven * updates to the backend. */ export interface Codebase { /** * Required. The resource name for the Developer Connect * [`gitRepositoryLink`](https://cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks) * connected to this backend, in the format: * `projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{repositoryLink}` * The connection for the `gitRepositoryLink` must made be using the Firebase * App Hosting GitHub App via the Firebase Console. */ repository?: string; /** * Optional. If `repository` is provided, the directory relative to the root * of the repository to use as the root for the deployed web app. */ rootDirectory?: string; } /** * A codebase source, representing the state of the codebase that the build * will be created at. */ export interface CodebaseSource { /** * Output only. The author contained in the metadata of a version control * change. */ readonly author?: UserMetadata; /** * The branch in the codebase to build from, using the latest commit. */ branch?: string; /** * The commit in the codebase to build from. */ commit?: string; /** * Output only. The message of a codebase change. */ readonly commitMessage?: string; /** * Output only. The time the change was made. */ readonly commitTime?: Date; /** * Output only. The human-friendly name to use for this Codebase when * displaying a build. We use the first eight characters of the SHA-1 hash for * GitHub.com. */ readonly displayName?: string; /** * Output only. The full SHA-1 hash of a Git commit, if available. */ readonly hash?: string; /** * Output only. A URI linking to the codebase on an hosting provider's * website. May not be valid if the commit has been rebased or force-pushed * out of existence in the linked repository. */ readonly uri?: string; } /** * Additional configuration of the backend for this build. */ export interface Config { /** * Output only. [OUTPUT_ONLY] This field represents all environment variables * employed during both the build and runtime. This list reflects the result * of merging variables from all sources (Backend.override_env, * Build.Config.env, YAML, defaults, system). Each variable includes its * `origin` */ readonly effectiveEnv?: EnvironmentVariable[]; /** * Optional. Supplied environment variables for a specific build. Provided at * Build creation time and immutable afterwards. This field is only applicable * for Builds using a build image - (e.g., ContainerSource or ArchiveSource * with locally_build_source) Attempts to set this for other build types will * result in an error */ env?: EnvironmentVariable[]; /** * Optional. Additional configuration of the Cloud Run * [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service). */ runConfig?: RunConfig; } /** * The URI of an Artifact Registry [container * image](https://cloud.google.com/artifact-registry/docs/reference/rest/v1/projects.locations.repositories.dockerImages) * to use as the build source. */ export interface ContainerSource { /** * Required. A URI representing a container for the backend to use. */ image?: string; } /** * Additional metadata for operations on custom domains. */ export interface CustomDomainOperationMetadata { /** * Output only. The custom domain's `CertState`, which must be `CERT_ACTIVE` * for the create operations to complete. */ readonly certState?: | "CERT_STATE_UNSPECIFIED" | "CERT_PREPARING" | "CERT_VALIDATING" | "CERT_PROPAGATING" | "CERT_ACTIVE" | "CERT_EXPIRING_SOON" | "CERT_EXPIRED"; /** * Output only. The custom domain's `HostState`, which must be `HOST_ACTIVE` * for Create operations of the domain name this `CustomDomain` refers toto * complete. */ readonly hostState?: | "HOST_STATE_UNSPECIFIED" | "HOST_UNHOSTED" | "HOST_UNREACHABLE" | "HOST_NON_FAH" | "HOST_CONFLICT" | "HOST_WRONG_SHARD" | "HOST_ACTIVE"; /** * Output only. A list of issues that are currently preventing the operation * from completing. These are generally DNS-related issues encountered when * querying a domain's records or attempting to mint an SSL certificate. */ readonly issues?: Status[]; /** * Output only. A list of steps that the user must complete to migrate their * domain to App Hosting without downtime. */ readonly liveMigrationSteps?: LiveMigrationStep[]; /** * Output only. The custom domain's `OwnershipState`, which must be * `OWNERSHIP_ACTIVE` for the create operations to complete. */ readonly ownershipState?: | "OWNERSHIP_STATE_UNSPECIFIED" | "OWNERSHIP_MISSING" | "OWNERSHIP_UNREACHABLE" | "OWNERSHIP_MISMATCH" | "OWNERSHIP_CONFLICT" | "OWNERSHIP_PENDING" | "OWNERSHIP_ACTIVE"; /** * Output only. A set of DNS record updates to perform, to allow App Hosting * to serve secure content on the domain. */ readonly quickSetupUpdates?: DnsUpdates[]; } /** * The status of a custom domain's linkage to a backend. */ export interface CustomDomainStatus { /** * Output only. Tracks SSL certificate status for the domain. */ readonly certState?: | "CERT_STATE_UNSPECIFIED" | "CERT_PREPARING" | "CERT_VALIDATING" | "CERT_PROPAGATING" | "CERT_ACTIVE" | "CERT_EXPIRING_SOON" | "CERT_EXPIRED"; /** * Output only. Tracks whether a custom domain is detected as appropriately * directing traffic to App Hosting. */ readonly hostState?: | "HOST_STATE_UNSPECIFIED" | "HOST_UNHOSTED" | "HOST_UNREACHABLE" | "HOST_NON_FAH" | "HOST_CONFLICT" | "HOST_WRONG_SHARD" | "HOST_ACTIVE"; /** * Output only. A list of issues with domain configuration. Allows users to * self-correct problems with DNS records. */ readonly issues?: Status[]; /** * Output only. Tracks whether the backend is permitted to serve content on * the domain, based off the domain's DNS records. */ readonly ownershipState?: | "OWNERSHIP_STATE_UNSPECIFIED" | "OWNERSHIP_MISSING" | "OWNERSHIP_UNREACHABLE" | "OWNERSHIP_MISMATCH" | "OWNERSHIP_CONFLICT" | "OWNERSHIP_PENDING" | "OWNERSHIP_ACTIVE"; /** * Output only. Lists the records that must added or removed to a custom * domain's DNS in order to finish setup and start serving content. Field is * present during onboarding. Also present after onboarding if one or more of * the above states is not *_ACTIVE, indicating the domain's DNS records are * in a bad state. */ readonly requiredDnsUpdates?: DnsUpdates[]; } /** * A representation of a DNS records for a domain. DNS records are resource * records that define how systems and services should behave when handling * requests for a domain. For example, when you add `A` records to your domain's * DNS records, you're informing other systems (such as your users' web * browsers) to contact those IPv4 addresses to retrieve resources relevant to * your domain (such as your App Hosting files). */ export interface DnsRecord { /** * Output only. The domain the record pertains to, e.g. `foo.bar.com.`. */ readonly domainName?: string; /** * Output only. The data of the record. The meaning of the value depends on * record type: - A and AAAA: IP addresses for the domain. - CNAME: Another * domain to check for records. - TXT: Arbitrary text strings associated with * the domain. App Hosting uses TXT records to determine which Firebase * projects have permission to act on the domain's behalf. - CAA: The record's * flags, tag, and value, e.g. `0 issue "pki.goog"`. */ readonly rdata?: string; /** * Output only. An enum that indicates which state(s) this DNS record applies * to. Populated for all records with an `ADD` or `REMOVE` required action. */ readonly relevantState?: | "CUSTOM_DOMAIN_STATE_UNSPECIFIED" | "HOST_STATE" | "OWNERSHIP_STATE" | "CERT_STATE"[]; /** * Output only. An enum that indicates the a required action for this record. * Populated when the record is part of a required change in a `DnsUpdates` * `discovered` or `desired` record set. */ readonly requiredAction?: | "NONE" | "ADD" | "REMOVE"; /** * Output only. The record's type, which determines what data the record * contains. */ readonly type?: | "TYPE_UNSPECIFIED" | "A" | "CNAME" | "TXT" | "AAAA" | "CAA"; } /** * A set of DNS records relevant to the setup and maintenance of a custom * domain in App Hosting. */ export interface DnsRecordSet { /** * Output only. An error App Hosting services encountered when querying your * domain's DNS records. Note: App Hosting ignores `NXDOMAIN` errors, as those * generally just mean that a domain name hasn't been set up yet. */ readonly checkError?: Status; /** * Output only. The domain name the record set pertains to. */ readonly domainName?: string; /** * Output only. Records on the domain. */ readonly records?: DnsRecord[]; } /** * A set of DNS record updates that you should make to allow App Hosting to * serve secure content in response to requests against your domain. These * updates present the current state of your domain's and related subdomains' * DNS records when App Hosting last queried them, and the desired set of * records that App Hosting needs to see before your custom domain can be fully * active. */ export interface DnsUpdates { /** * Output only. The last time App Hosting checked your custom domain's DNS * records. */ readonly checkTime?: Date; /** * Output only. The set of DNS records App Hosting needs in order to be able * to serve secure content on the domain. */ readonly desired?: DnsRecordSet[]; /** * Output only. The set of DNS records App Hosting discovered when inspecting * a domain. */ readonly discovered?: DnsRecordSet[]; /** * Output only. The domain name the DNS updates pertain to. */ readonly domainName?: string; } /** * A domain name that is associated with a backend. */ export interface Domain { /** * Optional. Annotations as key value pairs. */ annotations?: { [key: string]: string }; /** * Output only. Time at which the domain was created. */ readonly createTime?: Date; /** * Output only. Represents the state and configuration of a `CUSTOM` type * domain. It is only present on Domains of that type. */ readonly customDomainStatus?: CustomDomainStatus; /** * Output only. Time at which the domain was deleted. */ readonly deleteTime?: Date; /** * Optional. Whether the domain is disabled. Defaults to false. */ disabled?: boolean; /** * Optional. Mutable human-readable name for the domain. 63 character limit. * e.g. `prod domain`. */ displayName?: string; /** * Output only. Server-computed checksum based on other values; may be sent * on update or delete to ensure operation is done on expected resource. */ readonly etag?: string; /** * Optional. Labels as key value pairs. */ labels?: { [key: string]: string }; /** * Identifier. The resource name of the domain, e.g. * `/projects/p/locations/l/backends/b/domains/foo.com` */ name?: string; /** * Output only. A field that, if true, indicates that the build has an * ongoing LRO. */ readonly reconciling?: boolean; /** * Optional. The serving behavior of the domain. If specified, the domain * will serve content other than its backend's live content. */ serve?: ServingBehavior; /** * Output only. The type of the domain. */ readonly type?: | "TYPE_UNSPECIFIED" | "DEFAULT" | "CUSTOM"; /** * Output only. System-assigned, unique identifier. */ readonly uid?: string; /** * Output only. Time at which the domain was last updated. */ readonly updateTime?: Date; } function serializeDomain(data: any): Domain { return { ...data, serve: data["serve"] !== undefined ? serializeServingBehavior(data["serve"]) : undefined, }; } function deserializeDomain(data: any): Domain { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, deleteTime: data["deleteTime"] !== undefined ? new Date(data["deleteTime"]) : undefined, serve: data["serve"] !== undefined ? deserializeServingBehavior(data["serve"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Represents the metadata of a long-running operation on domains. */ export interface DomainOperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. Additional metadata for operations on custom domains. */ readonly customDomainOperationMetadata?: CustomDomainOperationMetadata; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Environment variables for this build. */ export interface EnvironmentVariable { /** * Optional. Where this variable should be made available. If left * unspecified, will be available in both BUILD and BACKEND. */ availability?: | "AVAILABILITY_UNSPECIFIED" | "BUILD" | "RUNTIME"[]; /** * Output only. The high-level origin category of the environment variable. */ readonly origin?: | "ORIGIN_UNSPECIFIED" | "BACKEND_OVERRIDES" | "BUILD_CONFIG" | "APPHOSTING_YAML" | "FIREBASE_SYSTEM"; /** * Output only. Specific detail about the source. For APPHOSTING_YAML * origins, this will contain the exact filename, such as "apphosting.yaml" or * "apphosting.staging.yaml". */ readonly originFileName?: string; /** * A fully qualified secret version. The value of the secret will be accessed * once while building the application and once per cold start of the * container at runtime. The service account used by Cloud Build and by Cloud * Run must each have the `secretmanager.versions.access` permission on the * secret. */ secret?: string; /** * A plaintext value. This value is encrypted at rest, but all project * readers can view the value when reading your backend configuration. */ value?: string; /** * Required. The name of the environment variable. - Must be a valid * environment variable name (e.g. A-Z or underscores). - May not start with * "FIREBASE" or "GOOGLE". - May not be a reserved environment variable for * KNative/Cloud Run */ variable?: string; } /** * The container for the rpc status and source for any errors found during the * build process. */ export interface Error { /** * Output only. Resource link */ readonly cloudResource?: string; /** * Output only. A status and (human readable) error message for the build, if * in a `FAILED` state. */ readonly error?: Status; /** * Output only. The source of the error for the build, if in a `FAILED` * state. */ readonly errorSource?: | "ERROR_SOURCE_UNSPECIFIED" | "CLOUD_BUILD" | "CLOUD_RUN"; } /** * Message for response to list backends */ export interface ListBackendsResponse { /** * The list of backends */ backends?: Backend[]; /** * A token identifying the next page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Message for response to list builds. */ export interface ListBuildsResponse { /** * The list of builds. */ builds?: Build[]; /** * A token identifying the next page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Message for response to list domains. */ export interface ListDomainsResponse { /** * Output only. The list of domains. */ readonly domains?: Domain[]; /** * Output only. A token identifying the next page of results the server * should return. */ readonly nextPageToken?: string; /** * Output only. Locations that could not be reached. */ readonly unreachable?: string[]; } /** * The response message for Locations.ListLocations. */ export interface ListLocationsResponse { /** * A list of locations that matches the specified filter in the request. */ locations?: Location[]; /** * The standard List next-page token. */ nextPageToken?: string; } /** * The response message for Operations.ListOperations. */ export interface ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: Operation[]; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections. For example, when attempting to list all resources across all * supported locations. */ unreachable?: string[]; } /** * Message for response to list rollouts. */ export interface ListRolloutsResponse { /** * A token identifying the next page of results the server should return. */ nextPageToken?: string; /** * The list of rollouts. */ rollouts?: Rollout[]; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * A set of updates including ACME challenges and DNS records that allow App * Hosting to create an SSL certificate and establish project ownership for your * domain name before you direct traffic to App Hosting servers. Use these * updates to facilitate zero downtime migrations to App Hosting from other * services. After you've made the recommended updates, check your custom * domain's `ownershipState` and `certState`. To avoid downtime, they should be * `OWNERSHIP_ACTIVE` and `CERT_ACTIVE`, respectively, before you update your * `A` and `AAAA` records. */ export interface LiveMigrationStep { /** * Output only. DNS updates to facilitate your domain's zero-downtime * migration to App Hosting. */ readonly dnsUpdates?: DnsUpdates[]; /** * Output only. Issues that prevent the current step from completing. */ readonly issues?: Status[]; /** * Output only. One or more states from the `CustomDomainStatus` of the * migrating domain that this step is attempting to make ACTIVE. For example, * if the step is attempting to mint an SSL certificate, this field will * include `CERT_STATE`. */ readonly relevantDomainStates?: | "CUSTOM_DOMAIN_STATE_UNSPECIFIED" | "HOST_STATE" | "OWNERSHIP_STATE" | "CERT_STATE"[]; /** * Output only. The state of the live migration step, indicates whether you * should work to complete the step now, in the future, or have already * completed it. */ readonly stepState?: | "STEP_STATE_UNSPECIFIED" | "PREPARING" | "PENDING" | "INCOMPLETE" | "PROCESSING" | "COMPLETE"; } /** * A resource that represents a Google Cloud location. */ export interface Location { /** * The friendly name for this location, typically a nearby city name. For * example, "Tokyo". */ displayName?: string; /** * Cross-service attributes for the location. For example * {"cloud.googleapis.com/region": "us-east1"} */ labels?: { [key: string]: string }; /** * The canonical id for this location. For example: `"us-east1"`. */ locationId?: string; /** * Service-specific metadata. For example the available capacity at the given * location. */ metadata?: { [key: string]: any }; /** * Resource name for the location, which may vary between implementations. * For example: `"projects/example-project/locations/us-east1"` */ name?: string; } /** * An external resource managed by App Hosting on the project. */ export interface ManagedResource { /** * A Cloud Run * [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service), * managed by App Hosting. */ runService?: RunService; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Represents the metadata of a long-running operation. */ export interface OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * A file path pattern to match against. */ export interface Path { /** * Optional. The pattern to match against. */ pattern?: string; /** * Optional. The type of pattern to match against. */ type?: | "PATTERN_TYPE_UNSPECIFIED" | "RE2" | "GLOB" | "PREFIX"; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsBuildsCreate. */ export interface ProjectsLocationsBackendsBuildsCreateOptions { /** * Required. Desired ID of the build being created. */ buildId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or creating any resources. */ validateOnly?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsBuildsDelete. */ export interface ProjectsLocationsBackendsBuildsDeleteOptions { /** * Optional. If the client provided etag is out of date, delete will be * returned FAILED_PRECONDITION error. */ etag?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or deleting any resources. */ validateOnly?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsBuildsList. */ export interface ProjectsLocationsBackendsBuildsListOptions { /** * Optional. A filter to narrow down results to a preferred subset. Learn * more about filtering in Google's [AIP 160 * standard](https://google.aip.dev/160). */ filter?: string; /** * Optional. Hint for how to order the results. Supported fields are `name` * and `createTime`. To specify descending order, append a `desc` suffix. */ orderBy?: string; /** * Optional. The maximum number of results to return. If not set, the service * selects a default. */ pageSize?: number; /** * Optional. A page token received from the nextPageToken field in the * response. Send that page token to receive the subsequent page. */ pageToken?: string; /** * Optional. If true, the request returns soft-deleted resources that haven't * been fully-deleted yet. */ showDeleted?: boolean; } /** * Additional options for FirebaseAppHosting#projectsLocationsBackendsCreate. */ export interface ProjectsLocationsBackendsCreateOptions { /** * Required. Id of the backend. Also used as the service ID for Cloud Run, * and as part of the default domain name. */ backendId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and t he * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or creating any resources. */ validateOnly?: boolean; } /** * Additional options for FirebaseAppHosting#projectsLocationsBackendsDelete. */ export interface ProjectsLocationsBackendsDeleteOptions { /** * Optional. If the client provided etag is out of date, delete will be * returned FAILED_PRECONDITION error. */ etag?: string; /** * Optional. If set to true, any resources for this backend will also be * deleted. Otherwise, any children resources will block deletion. */ force?: boolean; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and t he * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Indicates that the request should be validated, without * persisting the request or updating any resources. */ validateOnly?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsDomainsCreate. */ export interface ProjectsLocationsBackendsDomainsCreateOptions { /** * Required. Id of the domain to create. Must be a valid domain name. */ domainId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or creating any resources. */ validateOnly?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsDomainsDelete. */ export interface ProjectsLocationsBackendsDomainsDeleteOptions { /** * Optional. If the client provided etag is out of date, delete will be * returned FAILED_PRECONDITION error. */ etag?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or deleting any resources. */ validateOnly?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsDomainsList. */ export interface ProjectsLocationsBackendsDomainsListOptions { /** * Optional. A filter to narrow down results to a preferred subset. Learn * more about filtering in Google's [AIP 160 * standard](https://google.aip.dev/160). */ filter?: string; /** * Optional. Hint for how to order the results. Supported fields are `name` * and `createTime`. To specify descending order, append a `desc` suffix. */ orderBy?: string; /** * Optional. The maximum number of results to return. If not set, the service * selects a default. */ pageSize?: number; /** * Optional. A page token received from the nextPageToken field in the * response. Send that page token to receive the subsequent page. */ pageToken?: string; /** * Optional. If true, the request returns soft-deleted resources that haven't * been fully-deleted yet. */ showDeleted?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsDomainsPatch. */ export interface ProjectsLocationsBackendsDomainsPatchOptions { /** * Optional. If set to true, and the domain is not found, a new domain will * be created. */ allowMissing?: boolean; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Field mask is used to specify the fields to be overwritten in * the Domain resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. If the user does not provide a mask then * all fields will be overwritten. */ updateMask?: string /* FieldMask */; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or modifying any * resources. */ validateOnly?: boolean; } function serializeProjectsLocationsBackendsDomainsPatchOptions(data: any): ProjectsLocationsBackendsDomainsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsBackendsDomainsPatchOptions(data: any): ProjectsLocationsBackendsDomainsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for FirebaseAppHosting#projectsLocationsBackendsList. */ export interface ProjectsLocationsBackendsListOptions { /** * Optional. A filter to narrow down results to a preferred subset. Learn * more about filtering in Google's [AIP 160 * standard](https://google.aip.dev/160). */ filter?: string; /** * Optional. Hint for how to order the results. Supported fields are `name` * and `createTime`. To specify descending order, append a `desc` suffix. */ orderBy?: string; /** * Optional. The maximum number of results to return. If not set, the service * selects a default. */ pageSize?: number; /** * Optional. A page token received from the nextPageToken field in the * response. Send that page token to receive the subsequent page. */ pageToken?: string; /** * Optional. If true, the request returns soft-deleted resources that haven't * been fully-deleted yet. */ showDeleted?: boolean; } /** * Additional options for FirebaseAppHosting#projectsLocationsBackendsPatch. */ export interface ProjectsLocationsBackendsPatchOptions { /** * Optional. If set to true, and the backend is not found, a new backend will * be created. */ allowMissing?: boolean; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and t he * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Field mask is used to specify the fields to be overwritten in * the backend resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. If the user does not provide a mask then * all fields will be overwritten. */ updateMask?: string /* FieldMask */; /** * Optional. Indicates that the request should be validated, without * persisting the request or updating any resources. */ validateOnly?: boolean; } function serializeProjectsLocationsBackendsPatchOptions(data: any): ProjectsLocationsBackendsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsBackendsPatchOptions(data: any): ProjectsLocationsBackendsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsRolloutsCreate. */ export interface ProjectsLocationsBackendsRolloutsCreateOptions { /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Desired ID of the rollout being created. */ rolloutId?: string; /** * Optional. Indicates that the request should be validated and default * values populated, without persisting the request or creating any resources. */ validateOnly?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsRolloutsList. */ export interface ProjectsLocationsBackendsRolloutsListOptions { /** * Optional. A filter to narrow down results to a preferred subset. Learn * more about filtering in Google's [AIP 160 * standard](https://google.aip.dev/160). */ filter?: string; /** * Optional. Hint for how to order the results. Supported fields are `name` * and `createTime`. To specify descending order, append a `desc` suffix. */ orderBy?: string; /** * Optional. The maximum number of results to return. If not set, the service * selects a default. */ pageSize?: number; /** * Optional. A page token received from the nextPageToken field in the * response. Send that page token to receive the subsequent page. */ pageToken?: string; /** * Optional. If true, the request returns soft-deleted resources that haven't * been fully-deleted yet. */ showDeleted?: boolean; } /** * Additional options for * FirebaseAppHosting#projectsLocationsBackendsTrafficPatch. */ export interface ProjectsLocationsBackendsTrafficPatchOptions { /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and t he * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; /** * Optional. Field mask is used to specify the fields to be overwritten in * the traffic resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. If the user does not provide a mask then * all fields will be overwritten. */ updateMask?: string /* FieldMask */; /** * Optional. Indicates that the request should be validated, without * persisting the request or updating any resources. */ validateOnly?: boolean; } function serializeProjectsLocationsBackendsTrafficPatchOptions(data: any): ProjectsLocationsBackendsTrafficPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsBackendsTrafficPatchOptions(data: any): ProjectsLocationsBackendsTrafficPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for FirebaseAppHosting#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * Optional. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for FirebaseAppHosting#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Specifies redirect behavior for a domain. */ export interface Redirect { /** * Optional. The status code to use in a redirect response. Must be a valid * HTTP 3XX status code. Defaults to 302 if not present. */ status?: bigint; /** * Required. The URI of the redirect's intended destination. This URI will be * prepended to the original request path. URI without a scheme are assumed to * be HTTPS. */ uri?: string; } function serializeRedirect(data: any): Redirect { return { ...data, status: data["status"] !== undefined ? String(data["status"]) : undefined, }; } function deserializeRedirect(data: any): Redirect { return { ...data, status: data["status"] !== undefined ? BigInt(data["status"]) : undefined, }; } /** * A single rollout of a build for a backend. */ export interface Rollout { /** * Optional. Unstructured key value map that may be set by external tools to * store and arbitrary metadata. They are not queryable and should be * preserved when modifying objects. */ annotations?: { [key: string]: string }; /** * Required. Immutable. The name of a build that already exists. It doesn't * have to be built; a rollout will wait for a build to be ready before * updating traffic. */ build?: string; /** * Output only. Time at which the rollout was created. */ readonly createTime?: Date; /** * Output only. Time at which the rollout was deleted. */ readonly deleteTime?: Date; /** * Optional. Human-readable name. 63 character limit. */ displayName?: string; /** * Output only. A status and (human readable) error message for the rollout, * if in a `FAILED` state. */ readonly error?: Status; /** * Output only. Server-computed checksum based on other values; may be sent * on update or delete to ensure operation is done on expected resource. */ readonly etag?: string; /** * Optional. Unstructured key value map that can be used to organize and * categorize objects. */ labels?: { [key: string]: string }; /** * Identifier. The resource name of the rollout. Format: * `projects/{project}/locations/{locationId}/backends/{backendId}/rollouts/{rolloutId}`. */ name?: string; /** * Output only. A field that, if true, indicates that the Rollout currently * has an LRO. */ readonly reconciling?: boolean; /** * Output only. The state of the rollout. */ readonly state?: | "STATE_UNSPECIFIED" | "QUEUED" | "PENDING_BUILD" | "PROGRESSING" | "PAUSED" | "SUCCEEDED" | "FAILED" | "CANCELLED" | "SKIPPED"; /** * Output only. System-assigned, unique identifier. */ readonly uid?: string; /** * Output only. Time at which the rollout was last updated. */ readonly updateTime?: Date; } /** * The policy for how automatic builds and rollouts are triggered and rolled * out. */ export interface RolloutPolicy { /** * If set, specifies a branch that triggers a new build to be started with * this policy. Otherwise, no automatic rollouts will happen. */ codebaseBranch?: string; /** * Optional. A flag that, if true, prevents automatic rollouts from being * created via this RolloutPolicy. */ disabled?: boolean; /** * Output only. If `disabled` is set, the time at which the automatic * rollouts were disabled. */ readonly disabledTime?: Date; /** * Optional. A list of file paths patterns to exclude from triggering a * rollout. Patterns in this list take precedence over required_paths. * **Note**: All paths must be in the ignored_paths in order for the rollout * to be skipped. Limited to 100 paths. Example: ignored_paths: { pattern: * "foo/bar/excluded/*” type: GLOB } */ ignoredPaths?: Path[]; /** * Optional. A list of file paths patterns that trigger a build and rollout * if at least one of the changed files in the commit are present in this * list. This field is optional; the rollout policy will default to triggering * on all paths if not populated. Limited to 100 paths. Example: * “required_paths: { pattern: "foo/bar/*” type: GLOB } */ requiredPaths?: Path[]; } /** * Additional configuration to apply to the Cloud Run * [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service). */ export interface RunConfig { /** * Optional. Maximum number of requests that each Cloud Run instance can * receive. By default, each instance can receive Cloud Run's default of up to * 80 requests at the same time. Concurrency can be set to any integer value * up to 1000. */ concurrency?: number; /** * Optional. Number of CPUs used for each serving instance. By default, cpu * defaults to the Cloud Run's default of 1.0. CPU can be set to value 1, 2, * 4, 6, or 8 CPUs, and for less than 1 CPU, a value from 0.08 to less than * 1.00, in increments of 0.01. If you set a value of less than 1 CPU, you * must set concurrency to 1, and CPU will only be allocated during request * processing. Increasing CPUs limit may require increase in memory limits: - * 4 CPUs: at least 2 GiB - 6 CPUs: at least 4 GiB - 8 CPUs: at least 4 GiB */ cpu?: number; /** * Optional. Number of Cloud Run instances to maintain at maximum for each * revision. By default, each Cloud Run * [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service) * scales out to Cloud Run's default of a maximum of 100 instances. The * maximum max_instances limit is based on your quota. See * https://cloud.google.com/run/docs/configuring/max-instances#limits. */ maxInstances?: number; /** * Optional. Amount of memory allocated for each serving instance in MiB. By * default, memory defaults to the Cloud Run's default where each instance is * allocated 512 MiB of memory. Memory can be set to any integer value between * 128 to 32768. Increasing memory limit may require increase in CPUs limits: * - Over 4 GiB: at least 2 CPUs - Over 8 GiB: at least 4 CPUs - Over 16 GiB: * at least 6 CPUs - Over 24 GiB: at least 8 CPUs */ memoryMib?: number; /** * Optional. Number of Cloud Run instances to maintain at minimum for each * Cloud Run Service. By default, there are no minimum. Even if the service * splits traffic across multiple revisions, the total number of instances for * a service will be capped at this value. */ minInstances?: number; } /** * A managed Cloud Run * [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service). */ export interface RunService { /** * Optional. The name of the Cloud Run * [`service`](https://cloud.google.com/run/docs/reference/rest/v2/projects.locations.services#resource:-service), * in the format: * `projects/{project}/locations/{location}/services/{serviceId}` */ service?: string; } /** * Indicates whether App Hosting will serve content on the domain. */ export interface ServingBehavior { /** * Optional. Redirect behavior for a domain, if provided. */ redirect?: Redirect; } function serializeServingBehavior(data: any): ServingBehavior { return { ...data, redirect: data["redirect"] !== undefined ? serializeRedirect(data["redirect"]) : undefined, }; } function deserializeServingBehavior(data: any): ServingBehavior { return { ...data, redirect: data["redirect"] !== undefined ? deserializeRedirect(data["redirect"]) : undefined, }; } /** * Metadata for the user who started the build. */ export interface SourceUserMetadata { /** * Output only. The user-chosen displayname. May be empty. */ readonly displayName?: string; /** * Output only. The account email linked to the EUC that created the build. * May be a service account or other robot account. */ readonly email?: string; /** * Output only. The URI of a profile photo associated with the user who * created the build. */ readonly imageUri?: string; } /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains three * pieces of data: error code, error message, and error details. You can find * out more about this error model and how to work with it in the [API Design * Guide](https://cloud.google.com/apis/design/errors). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * Controls traffic configuration for the backend. */ export interface Traffic { /** * Optional. Unstructured key value map that may be set by external tools to * store and arbitrary metadata. They are not queryable and should be * preserved when modifying objects. */ annotations?: { [key: string]: string }; /** * Output only. Time at which the backend was created. */ readonly createTime?: Date; /** * Output only. Current state of traffic allocation for the backend. When * setting `target`, this field may differ for some time until the desired * state is reached. */ readonly current?: TrafficSet; /** * Output only. Server-computed checksum based on other values; may be sent * on update or delete to ensure operation is done on expected resource. */ readonly etag?: string; /** * Optional. Unstructured key value map that can be used to organize and * categorize objects. */ labels?: { [key: string]: string }; /** * Identifier. The resource name of the backend's traffic. Format: * `projects/{project}/locations/{locationId}/backends/{backendId}/traffic`. */ name?: string; /** * Output only. A field that, if true, indicates that the system is working * to make the backend's `current` match the requested `target` list. */ readonly reconciling?: boolean; /** * A rollout policy specifies how new builds and automatic deployments are * created. */ rolloutPolicy?: RolloutPolicy; /** * Set to manually control the desired traffic for the backend. This will * cause `current` to eventually match this value. The percentages must add up * to 100%. */ target?: TrafficSet; /** * Output only. System-assigned, unique identifier. */ readonly uid?: string; /** * Output only. Time at which the backend was last updated. */ readonly updateTime?: Date; } /** * A list of traffic splits that together represent where traffic is being * routed. */ export interface TrafficSet { /** * Required. The list of traffic splits. */ splits?: TrafficSplit[]; } /** * The traffic allocation for the backend. */ export interface TrafficSplit { /** * Required. The build that traffic is being routed to. */ build?: string; /** * Required. The percentage of traffic to send to the build. Currently must * be 100% or 0%. */ percent?: number; } /** * Version control metadata for a user associated with a resolved codebase. * Currently assumes a Git user. */ export interface UserMetadata { /** * Output only. The 'name' field in a Git user's git.config. Required by Git. */ readonly displayName?: string; /** * Output only. The 'email' field in a Git user's git.config, if available. */ readonly email?: string; /** * Output only. The URI of an image file associated with the user's account * in an external source control provider, if available. */ readonly imageUri?: string; }