// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Developer Connect API Client for Deno * ===================================== * * Connect third-party source code management to Google * * Docs: http://cloud.google.com/developer-connect/docs/overview * Source: https://googleapis.deno.dev/v1/developerconnect:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Connect third-party source code management to Google */ export class DeveloperConnect { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://developerconnect.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Creates a new AccountConnector in a given project and location. * * @param parent Required. Location resource name as the account_connector’s parent. */ async projectsLocationsAccountConnectorsCreate(parent: string, req: AccountConnector, opts: ProjectsLocationsAccountConnectorsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/accountConnectors`); if (opts.accountConnectorId !== undefined) { url.searchParams.append("accountConnectorId", String(opts.accountConnectorId)); } 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 AccountConnector. * * @param name Required. Name of the resource */ async projectsLocationsAccountConnectorsDelete(name: string, opts: ProjectsLocationsAccountConnectorsDeleteOptions = {}): 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; } /** * Gets details of a single AccountConnector. * * @param name Required. Name of the resource */ async projectsLocationsAccountConnectorsGet(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 AccountConnector; } /** * Lists AccountConnectors in a given project and location. * * @param parent Required. Parent value for ListAccountConnectorsRequest */ async projectsLocationsAccountConnectorsList(parent: string, opts: ProjectsLocationsAccountConnectorsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/accountConnectors`); 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListAccountConnectorsResponse; } /** * Updates the parameters of a single AccountConnector. * * @param name Identifier. The resource name of the accountConnector, in the format `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`. */ async projectsLocationsAccountConnectorsPatch(name: string, req: AccountConnector, opts: ProjectsLocationsAccountConnectorsPatchOptions = {}): Promise { opts = serializeProjectsLocationsAccountConnectorsPatchOptions(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; } /** * Deletes a single User. * * @param name Required. Name of the resource */ async projectsLocationsAccountConnectorsUsersDelete(name: string, opts: ProjectsLocationsAccountConnectorsUsersDeleteOptions = {}): 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; } /** * Delete the User based on the user credentials. * * @param name Required. Name of the AccountConnector resource */ async projectsLocationsAccountConnectorsUsersDeleteSelf(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/users:deleteSelf`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Fetches OAuth access token based on end user credentials. * * @param accountConnector Required. The resource name of the AccountConnector in the format `projects/*/locations/*/accountConnectors/*`. */ async projectsLocationsAccountConnectorsUsersFetchAccessToken(accountConnector: string, req: FetchAccessTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ accountConnector }/users:fetchAccessToken`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFetchAccessTokenResponse(data); } /** * Fetch the User based on the user credentials. * * @param name Required. Name of the AccountConnector resource */ async projectsLocationsAccountConnectorsUsersFetchSelf(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/users:fetchSelf`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as User; } /** * Finishes OAuth flow for an account connector. * * @param accountConnector Required. The resource name of the AccountConnector in the format `projects/*/locations/*/accountConnectors/*`. */ async projectsLocationsAccountConnectorsUsersFinishOAuthFlow(accountConnector: string, opts: ProjectsLocationsAccountConnectorsUsersFinishOAuthFlowOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ accountConnector }/users:finishOAuthFlow`); if (opts["googleOauthParams.scopes"] !== undefined) { url.searchParams.append("googleOauthParams.scopes", String(opts["googleOauthParams.scopes"])); } if (opts["googleOauthParams.ticket"] !== undefined) { url.searchParams.append("googleOauthParams.ticket", String(opts["googleOauthParams.ticket"])); } if (opts["googleOauthParams.versionInfo"] !== undefined) { url.searchParams.append("googleOauthParams.versionInfo", String(opts["googleOauthParams.versionInfo"])); } if (opts["oauthParams.code"] !== undefined) { url.searchParams.append("oauthParams.code", String(opts["oauthParams.code"])); } if (opts["oauthParams.ticket"] !== undefined) { url.searchParams.append("oauthParams.ticket", String(opts["oauthParams.ticket"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FinishOAuthResponse; } /** * Lists Users in a given project, location, and account_connector. * * @param parent Required. Parent value for ListUsersRequest */ async projectsLocationsAccountConnectorsUsersList(parent: string, opts: ProjectsLocationsAccountConnectorsUsersListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/users`); 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListUsersResponse; } /** * Starts OAuth flow for an account connector. * * @param accountConnector Required. The resource name of the AccountConnector in the format `projects/*/locations/*/accountConnectors/*`. */ async projectsLocationsAccountConnectorsUsersStartOAuthFlow(accountConnector: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ accountConnector }/users:startOAuthFlow`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as StartOAuthResponse; } /** * Creates a new Connection in a given project and location. * * @param parent Required. Value for parent. */ async projectsLocationsConnectionsCreate(parent: string, req: Connection, opts: ProjectsLocationsConnectionsCreateOptions = {}): Promise { req = serializeConnection(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/connections`); if (opts.connectionId !== undefined) { url.searchParams.append("connectionId", String(opts.connectionId)); } 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 Connection. * * @param name Required. Name of the resource */ async projectsLocationsConnectionsDelete(name: string, opts: ProjectsLocationsConnectionsDeleteOptions = {}): 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; } /** * FetchGitHubInstallations returns the list of GitHub Installations that are * available to be added to a Connection. For github.com, only installations * accessible to the authorizer token are returned. For GitHub Enterprise, all * installations are returned. * * @param connection Required. The resource name of the connection in the format `projects/*/locations/*/connections/*`. */ async projectsLocationsConnectionsFetchGitHubInstallations(connection: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ connection }:fetchGitHubInstallations`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeFetchGitHubInstallationsResponse(data); } /** * FetchLinkableGitRepositories returns a list of git repositories from an * SCM that are available to be added to a Connection. * * @param connection Required. The name of the Connection. Format: `projects/*/locations/*/connections/*`. */ async projectsLocationsConnectionsFetchLinkableGitRepositories(connection: string, opts: ProjectsLocationsConnectionsFetchLinkableGitRepositoriesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ connection }:fetchLinkableGitRepositories`); 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 FetchLinkableGitRepositoriesResponse; } /** * Gets details of a single Connection. * * @param name Required. Name of the resource */ async projectsLocationsConnectionsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeConnection(data); } /** * Creates a GitRepositoryLink. Upon linking a Git Repository, Developer * Connect will configure the Git Repository to send webhook events to * Developer Connect. Connections that use Firebase GitHub Application will * have events forwarded to the Firebase service. Connections that use Gemini * Code Assist will have events forwarded to Gemini Code Assist service. All * other Connections will have events forwarded to Cloud Build. * * @param parent Required. Value for parent. */ async projectsLocationsConnectionsGitRepositoryLinksCreate(parent: string, req: GitRepositoryLink, opts: ProjectsLocationsConnectionsGitRepositoryLinksCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/gitRepositoryLinks`); if (opts.gitRepositoryLinkId !== undefined) { url.searchParams.append("gitRepositoryLinkId", String(opts.gitRepositoryLinkId)); } 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 GitRepositoryLink. * * @param name Required. Name of the resource */ async projectsLocationsConnectionsGitRepositoryLinksDelete(name: string, opts: ProjectsLocationsConnectionsGitRepositoryLinksDeleteOptions = {}): 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; } /** * Fetch the list of branches or tags for a given repository. * * @param gitRepositoryLink Required. The resource name of GitRepositoryLink in the format `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksFetchGitRefs(gitRepositoryLink: string, opts: ProjectsLocationsConnectionsGitRepositoryLinksFetchGitRefsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ gitRepositoryLink }:fetchGitRefs`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.refType !== undefined) { url.searchParams.append("refType", String(opts.refType)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchGitRefsResponse; } /** * Fetches read token of a given gitRepositoryLink. * * @param gitRepositoryLink Required. The resource name of the gitRepositoryLink in the format `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksFetchReadToken(gitRepositoryLink: string, req: FetchReadTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ gitRepositoryLink }:fetchReadToken`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFetchReadTokenResponse(data); } /** * Fetches read/write token of a given gitRepositoryLink. * * @param gitRepositoryLink Required. The resource name of the gitRepositoryLink in the format `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksFetchReadWriteToken(gitRepositoryLink: string, req: FetchReadWriteTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ gitRepositoryLink }:fetchReadWriteToken`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFetchReadWriteTokenResponse(data); } /** * Gets details of a single GitRepositoryLink. * * @param name Required. Name of the resource */ async projectsLocationsConnectionsGitRepositoryLinksGet(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 GitRepositoryLink; } /** * Lists GitRepositoryLinks in a given project, location, and connection. * * @param parent Required. Parent value for ListGitRepositoryLinksRequest */ async projectsLocationsConnectionsGitRepositoryLinksList(parent: string, opts: ProjectsLocationsConnectionsGitRepositoryLinksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/gitRepositoryLinks`); 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListGitRepositoryLinksResponse; } /** * ProcessBitbucketCloudWebhook is called by the external Bitbucket Cloud * instances for notifying events. * * @param name Required. The GitRepositoryLink where the webhook will be received. Format: `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksProcessBitbucketCloudWebhook(name: string, req: ProcessBitbucketCloudWebhookRequest): Promise { req = serializeProcessBitbucketCloudWebhookRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:processBitbucketCloudWebhook`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * ProcessBitbucketDataCenterWebhook is called by the external Bitbucket Data * Center instances for notifying events. * * @param name Required. The GitRepositoryLink where the webhook will be received. Format: `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksProcessBitbucketDataCenterWebhook(name: string, req: ProcessBitbucketDataCenterWebhookRequest): Promise { req = serializeProcessBitbucketDataCenterWebhookRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:processBitbucketDataCenterWebhook`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * ProcessGitLabEnterpriseWebhook is called by the external GitLab Enterprise * instances for notifying events. * * @param name Required. The GitRepositoryLink resource where the webhook will be received. Format: `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksProcessGitLabEnterpriseWebhook(name: string, req: ProcessGitLabEnterpriseWebhookRequest): Promise { req = serializeProcessGitLabEnterpriseWebhookRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:processGitLabEnterpriseWebhook`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * ProcessGitLabWebhook is called by the GitLab.com for notifying events. * * @param name Required. The GitRepositoryLink resource where the webhook will be received. Format: `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. */ async projectsLocationsConnectionsGitRepositoryLinksProcessGitLabWebhook(name: string, req: ProcessGitLabWebhookRequest): Promise { req = serializeProcessGitLabWebhookRequest(req); const url = new URL(`${this.#baseUrl}v1/${ name }:processGitLabWebhook`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Lists Connections in a given project and location. * * @param parent Required. Parent value for ListConnectionsRequest */ async projectsLocationsConnectionsList(parent: string, opts: ProjectsLocationsConnectionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/connections`); 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListConnectionsResponse(data); } /** * Updates the parameters of a single Connection. * * @param name Identifier. The resource name of the connection, in the format `projects/{project}/locations/{location}/connections/{connection_id}`. */ async projectsLocationsConnectionsPatch(name: string, req: Connection, opts: ProjectsLocationsConnectionsPatchOptions = {}): Promise { req = serializeConnection(req); opts = serializeProjectsLocationsConnectionsPatchOptions(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; } /** * ProcessGitHubEnterpriseWebhook is called by the external GitHub Enterprise * instances for notifying events. * * @param parent Required. Project and location where the webhook will be received. Format: `projects/*/locations/*`. */ async projectsLocationsConnectionsProcessGitHubEnterpriseWebhook(parent: string, req: ProcessGitHubEnterpriseWebhookRequest): Promise { req = serializeProcessGitHubEnterpriseWebhookRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/connections:processGitHubEnterpriseWebhook`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * 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; } /** * Creates a new InsightsConfig in a given project and location. * * @param parent Required. Value for parent. */ async projectsLocationsInsightsConfigsCreate(parent: string, req: InsightsConfig, opts: ProjectsLocationsInsightsConfigsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/insightsConfigs`); if (opts.insightsConfigId !== undefined) { url.searchParams.append("insightsConfigId", String(opts.insightsConfigId)); } 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 Insight. * * @param name Required. Value for parent. */ async projectsLocationsInsightsConfigsDelete(name: string, opts: ProjectsLocationsInsightsConfigsDeleteOptions = {}): 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 a single Deployment Event. * * @param name Required. The name of the deployment event to retrieve. Format: projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid} */ async projectsLocationsInsightsConfigsDeploymentEventsGet(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 DeploymentEvent; } /** * Lists Deployment Events in a given insights config. * * @param parent Required. The parent insights config that owns this collection of deployment events. Format: projects/{project}/locations/{location}/insightsConfigs/{insights_config} */ async projectsLocationsInsightsConfigsDeploymentEventsList(parent: string, opts: ProjectsLocationsInsightsConfigsDeploymentEventsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/deploymentEvents`); 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 ListDeploymentEventsResponse; } /** * Gets details of a single Insight. * * @param name Required. Name of the resource. */ async projectsLocationsInsightsConfigsGet(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 InsightsConfig; } /** * Lists InsightsConfigs in a given project and location. * * @param parent Required. Parent value for ListInsightsConfigsRequest. */ async projectsLocationsInsightsConfigsList(parent: string, opts: ProjectsLocationsInsightsConfigsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/insightsConfigs`); 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)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListInsightsConfigsResponse; } /** * Updates the parameters of a single InsightsConfig. * * @param name Identifier. The name of the InsightsConfig. Format: projects/{project}/locations/{location}/insightsConfigs/{insightsConfig} */ async projectsLocationsInsightsConfigsPatch(name: string, req: InsightsConfig, opts: ProjectsLocationsInsightsConfigsPatchOptions = {}): Promise { 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.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; } /** * Lists information about the supported locations for this service. * * @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; } } /** * AccountConnector encapsulates what a platform administrator needs to * configure for users to connect to the service providers, which includes, * among other fields, the OAuth client ID, client secret, and authorization and * token endpoints. */ export interface AccountConnector { /** * Optional. Allows users to store small amounts of arbitrary data. */ annotations?: { [key: string]: string }; /** * Output only. The timestamp when the accountConnector was created. */ readonly createTime?: Date; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ etag?: string; /** * Optional. Labels as key value pairs */ labels?: { [key: string]: string }; /** * Identifier. The resource name of the accountConnector, in the format * `projects/{project}/locations/{location}/accountConnectors/{account_connector_id}`. */ name?: string; /** * Output only. Start OAuth flow by clicking on this URL. */ readonly oauthStartUri?: string; /** * Provider OAuth config. */ providerOauthConfig?: ProviderOAuthConfig; /** * Output only. The timestamp when the accountConnector was updated. */ readonly updateTime?: Date; } /** * AppHubService represents the App Hub Service. */ export interface AppHubService { /** * Required. Output only. Immutable. The name of the App Hub Service. Format: * `projects/{project}/locations/{location}/applications/{application}/services/{service}`. */ readonly apphubService?: string; /** * Output only. The criticality of the App Hub Service. */ readonly criticality?: string; /** * Output only. The environment of the App Hub Service. */ readonly environment?: string; } /** * AppHubWorkload represents the App Hub Workload. */ export interface AppHubWorkload { /** * Output only. The criticality of the App Hub Workload. */ readonly criticality?: string; /** * Output only. The environment of the App Hub Workload. */ readonly environment?: string; /** * Required. Output only. Immutable. The name of the App Hub Workload. * Format: * `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`. */ readonly workload?: string; } /** * The artifact config of the artifact that is deployed. */ export interface ArtifactConfig { /** * Optional. Set if the artifact metadata is stored in Artifact analysis. */ googleArtifactAnalysis?: GoogleArtifactAnalysis; /** * Optional. Set if the artifact is stored in Artifact registry. */ googleArtifactRegistry?: GoogleArtifactRegistry; /** * Required. Immutable. The URI of the artifact that is deployed. e.g. * `us-docker.pkg.dev/my-project/my-repo/image`. The URI does not include the * tag / digest because it captures a lineage of artifacts. */ uri?: string; } /** * The ArtifactDeployment resource represents the deployment of the artifact * within the InsightsConfig resource. */ export interface ArtifactDeployment { /** * Output only. The artifact alias in the deployment spec, with Tag/SHA. e.g. * us-docker.pkg.dev/my-project/my-repo/image:1.0.0 */ readonly artifactAlias?: string; /** * Output only. The artifact that is deployed. */ readonly artifactReference?: string; /** * Output only. The summary of container status of the artifact deployment. * Format as `ContainerStatusState-Reason : restartCount` e.g. * "Waiting-ImagePullBackOff : 3" */ readonly containerStatusSummary?: string; /** * Output only. The time at which the deployment was deployed. */ readonly deployTime?: Date; /** * Output only. Unique identifier of `ArtifactDeployment`. */ readonly id?: string; /** * Output only. The source commits at which this artifact was built. * Extracted from provenance. */ readonly sourceCommitUris?: string[]; /** * Output only. The time at which the deployment was undeployed, all * artifacts are considered undeployed once this time is set. */ readonly undeployTime?: Date; } /** * Configuration for connections to an instance of Bitbucket Cloud. */ export interface BitbucketCloudConfig { /** * Required. An access token with the minimum `repository`, `pullrequest` and * `webhook` scope access. It can either be a workspace, project or repository * access token. This is needed to create webhooks. It's recommended to use a * system account to generate these credentials. */ authorizerCredential?: UserCredential; /** * Required. An access token with the minimum `repository` access. It can * either be a workspace, project or repository access token. It's recommended * to use a system account to generate the credentials. */ readAuthorizerCredential?: UserCredential; /** * Required. Immutable. SecretManager resource containing the webhook secret * used to verify webhook events, formatted as * `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). This is used to validate and create webhooks. */ webhookSecretSecretVersion?: string; /** * Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud * Platform. */ workspace?: string; } /** * Configuration for connections to an instance of Bitbucket Data Center. */ export interface BitbucketDataCenterConfig { /** * Required. An http access token with the minimum `Repository admin` scope * access. This is needed to create webhooks. It's recommended to use a system * account to generate these credentials. */ authorizerCredential?: UserCredential; /** * Required. The URI of the Bitbucket Data Center host this connection is * for. */ hostUri?: string; /** * Required. An http access token with the minimum `Repository read` access. * It's recommended to use a system account to generate the credentials. */ readAuthorizerCredential?: UserCredential; /** * Output only. Version of the Bitbucket Data Center server running on the * `host_uri`. */ readonly serverVersion?: string; /** * Optional. Configuration for using Service Directory to privately connect * to a Bitbucket Data Center instance. This should only be set if the * Bitbucket Data Center is hosted on-premises and not reachable by public * internet. If this field is left empty, calls to the Bitbucket Data Center * will be made over the public internet. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. SSL certificate authority to trust when making requests to * Bitbucket Data Center. */ sslCaCertificate?: string; /** * Required. Immutable. SecretManager resource containing the webhook secret * used to verify webhook events, formatted as * `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). This is used to validate webhooks. */ webhookSecretSecretVersion?: string; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * Message describing Connection object */ export interface Connection { /** * Optional. Allows clients to store small amounts of arbitrary data. */ annotations?: { [key: string]: string }; /** * Configuration for connections to an instance of Bitbucket Clouds. */ bitbucketCloudConfig?: BitbucketCloudConfig; /** * Configuration for connections to an instance of Bitbucket Data Center. */ bitbucketDataCenterConfig?: BitbucketDataCenterConfig; /** * Output only. [Output only] Create timestamp */ readonly createTime?: Date; /** * Optional. The crypto key configuration. This field is used by the * Customer-Managed Encryption Keys (CMEK) feature. */ cryptoKeyConfig?: CryptoKeyConfig; /** * Output only. [Output only] Delete timestamp */ readonly deleteTime?: Date; /** * Optional. If disabled is set to true, functionality is disabled for this * connection. Repository based API methods and webhooks processing for * repositories in this connection will be disabled. */ disabled?: boolean; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ etag?: string; /** * Configuration for connections to github.com. */ githubConfig?: GitHubConfig; /** * Configuration for connections to an instance of GitHub Enterprise. */ githubEnterpriseConfig?: GitHubEnterpriseConfig; /** * Configuration for connections to gitlab.com. */ gitlabConfig?: GitLabConfig; /** * Configuration for connections to an instance of GitLab Enterprise. */ gitlabEnterpriseConfig?: GitLabEnterpriseConfig; /** * Optional. Configuration for the git proxy feature. Enabling the git proxy * allows clients to perform git operations on the repositories linked in the * connection. */ gitProxyConfig?: GitProxyConfig; /** * Output only. Installation state of the Connection. */ readonly installationState?: InstallationState; /** * Optional. Labels as key value pairs */ labels?: { [key: string]: string }; /** * Identifier. The resource name of the connection, in the format * `projects/{project}/locations/{location}/connections/{connection_id}`. */ name?: string; /** * Output only. Set to true when the connection is being set up or updated in * the background. */ readonly reconciling?: boolean; /** * Output only. A system-assigned unique identifier for the Connection. */ readonly uid?: string; /** * Output only. [Output only] Update timestamp */ readonly updateTime?: Date; } function serializeConnection(data: any): Connection { return { ...data, githubConfig: data["githubConfig"] !== undefined ? serializeGitHubConfig(data["githubConfig"]) : undefined, githubEnterpriseConfig: data["githubEnterpriseConfig"] !== undefined ? serializeGitHubEnterpriseConfig(data["githubEnterpriseConfig"]) : undefined, }; } function deserializeConnection(data: any): Connection { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, deleteTime: data["deleteTime"] !== undefined ? new Date(data["deleteTime"]) : undefined, githubConfig: data["githubConfig"] !== undefined ? deserializeGitHubConfig(data["githubConfig"]) : undefined, githubEnterpriseConfig: data["githubEnterpriseConfig"] !== undefined ? deserializeGitHubEnterpriseConfig(data["githubEnterpriseConfig"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * The crypto key configuration. This field is used by the Customer-managed * encryption keys (CMEK) feature. */ export interface CryptoKeyConfig { /** * Required. The name of the key which is used to encrypt/decrypt customer * data. For key in Cloud KMS, the key should be in the format of * `projects/*\/locations/*\/keyRings/*\/cryptoKeys/*`. */ keyReference?: string; } /** * The DeploymentEvent resource represents the deployment of the artifact * within the InsightsConfig resource. */ export interface DeploymentEvent { /** * Output only. The artifact deployments of the DeploymentEvent. Each * artifact deployment contains the artifact uri and the runtime configuration * uri. For GKE, this would be all the containers images that are deployed in * the pod. */ readonly artifactDeployments?: ArtifactDeployment[]; /** * Output only. The create time of the DeploymentEvent. */ readonly createTime?: Date; /** * Output only. The time at which the DeploymentEvent was deployed. This * would be the min of all ArtifactDeployment deploy_times. */ readonly deployTime?: Date; /** * Identifier. The name of the DeploymentEvent. This name is provided by DCI. * Format: * projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid} */ name?: string; /** * Output only. The runtime configurations where the DeploymentEvent * happened. */ readonly runtimeConfig?: RuntimeConfig; /** * Output only. The runtime assigned URI of the DeploymentEvent. For GKE, * this is the fully qualified replica set uri. e.g. * container.googleapis.com/projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/apps/replicasets/{replica-set-id} * For Cloud Run, this is the revision name. */ readonly runtimeDeploymentUri?: string; /** * Output only. The state of the DeploymentEvent. */ readonly state?: | "STATE_UNSPECIFIED" | "STATE_ACTIVE" | "STATE_INACTIVE"; /** * Output only. The time at which the DeploymentEvent was undeployed, all * artifacts are considered undeployed once this time is set. This would be * the max of all ArtifactDeployment undeploy_times. If any ArtifactDeployment * is still active (i.e. does not have an undeploy_time), this field will be * empty. */ readonly undeployTime?: Date; /** * Output only. The update time of the DeploymentEvent. */ readonly updateTime?: Date; } /** * 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 { } /** * Message for representing an error from exchanging OAuth tokens. */ export interface ExchangeError { /** * https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 - error */ code?: string; /** * https://datatracker.ietf.org/doc/html/rfc6749#section-5.2 - * error_description */ description?: string; } /** * Message for fetching an OAuth access token. */ export interface FetchAccessTokenRequest { } /** * Message for responding to getting an OAuth access token. */ export interface FetchAccessTokenResponse { /** * The error resulted from exchanging OAuth tokens from the service provider. */ exchangeError?: ExchangeError; /** * Expiration timestamp. Can be empty if unknown or non-expiring. */ expirationTime?: Date; /** * The scopes of the access token. */ scopes?: string[]; /** * The token content. */ token?: string; } function serializeFetchAccessTokenResponse(data: any): FetchAccessTokenResponse { return { ...data, expirationTime: data["expirationTime"] !== undefined ? data["expirationTime"].toISOString() : undefined, }; } function deserializeFetchAccessTokenResponse(data: any): FetchAccessTokenResponse { return { ...data, expirationTime: data["expirationTime"] !== undefined ? new Date(data["expirationTime"]) : undefined, }; } /** * Response of fetching github installations. */ export interface FetchGitHubInstallationsResponse { /** * List of installations available to the OAuth user (for github.com) or all * the installations (for GitHub enterprise). */ installations?: Installation[]; } function serializeFetchGitHubInstallationsResponse(data: any): FetchGitHubInstallationsResponse { return { ...data, installations: data["installations"] !== undefined ? data["installations"].map((item: any) => (serializeInstallation(item))) : undefined, }; } function deserializeFetchGitHubInstallationsResponse(data: any): FetchGitHubInstallationsResponse { return { ...data, installations: data["installations"] !== undefined ? data["installations"].map((item: any) => (deserializeInstallation(item))) : undefined, }; } /** * Response for fetching git refs. */ export interface FetchGitRefsResponse { /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Name of the refs fetched. */ refNames?: string[]; } /** * Response message for FetchLinkableGitRepositories. */ export interface FetchLinkableGitRepositoriesResponse { /** * The git repositories that can be linked to the connection. */ linkableGitRepositories?: LinkableGitRepository[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; } /** * Message for fetching SCM read token. */ export interface FetchReadTokenRequest { } /** * Message for responding to get read token. */ export interface FetchReadTokenResponse { /** * Expiration timestamp. Can be empty if unknown or non-expiring. */ expirationTime?: Date; /** * The git_username to specify when making a git clone with the token. For * example, for GitHub GitRepositoryLinks, this would be "x-access-token" */ gitUsername?: string; /** * The token content. */ token?: string; } function serializeFetchReadTokenResponse(data: any): FetchReadTokenResponse { return { ...data, expirationTime: data["expirationTime"] !== undefined ? data["expirationTime"].toISOString() : undefined, }; } function deserializeFetchReadTokenResponse(data: any): FetchReadTokenResponse { return { ...data, expirationTime: data["expirationTime"] !== undefined ? new Date(data["expirationTime"]) : undefined, }; } /** * Message for fetching SCM read/write token. */ export interface FetchReadWriteTokenRequest { } /** * Message for responding to get read/write token. */ export interface FetchReadWriteTokenResponse { /** * Expiration timestamp. Can be empty if unknown or non-expiring. */ expirationTime?: Date; /** * The git_username to specify when making a git clone with the token. For * example, for GitHub GitRepositoryLinks, this would be "x-access-token" */ gitUsername?: string; /** * The token content. */ token?: string; } function serializeFetchReadWriteTokenResponse(data: any): FetchReadWriteTokenResponse { return { ...data, expirationTime: data["expirationTime"] !== undefined ? data["expirationTime"].toISOString() : undefined, }; } function deserializeFetchReadWriteTokenResponse(data: any): FetchReadWriteTokenResponse { return { ...data, expirationTime: data["expirationTime"] !== undefined ? new Date(data["expirationTime"]) : undefined, }; } /** * Message for responding to finishing an OAuth flow. */ export interface FinishOAuthResponse { /** * The error resulted from exchanging OAuth tokens from the service provider. */ exchangeError?: ExchangeError; } /** * Configuration for connections to github.com. */ export interface GitHubConfig { /** * Optional. GitHub App installation id. */ appInstallationId?: bigint; /** * Optional. OAuth credential of the account that authorized the GitHub App. * It is recommended to use a robot account instead of a human user account. * The OAuth token must be tied to the GitHub App of this config. */ authorizerCredential?: OAuthCredential; /** * Required. Immutable. The GitHub Application that was installed to the * GitHub user or organization. */ githubApp?: | "GIT_HUB_APP_UNSPECIFIED" | "DEVELOPER_CONNECT" | "FIREBASE" | "GEMINI_CODE_ASSIST"; /** * Output only. The URI to navigate to in order to manage the installation * associated with this GitHubConfig. */ readonly installationUri?: string; } function serializeGitHubConfig(data: any): GitHubConfig { return { ...data, appInstallationId: data["appInstallationId"] !== undefined ? String(data["appInstallationId"]) : undefined, }; } function deserializeGitHubConfig(data: any): GitHubConfig { return { ...data, appInstallationId: data["appInstallationId"] !== undefined ? BigInt(data["appInstallationId"]) : undefined, }; } /** * Configuration for connections to an instance of GitHub Enterprise. */ export interface GitHubEnterpriseConfig { /** * Optional. ID of the GitHub App created from the manifest. */ appId?: bigint; /** * Optional. ID of the installation of the GitHub App. */ appInstallationId?: bigint; /** * Output only. The URL-friendly name of the GitHub App. */ readonly appSlug?: string; /** * Required. The URI of the GitHub Enterprise host this connection is for. */ hostUri?: string; /** * Output only. The URI to navigate to in order to manage the installation * associated with this GitHubEnterpriseConfig. */ readonly installationUri?: string; /** * Optional. SecretManager resource containing the private key of the GitHub * App, formatted as `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). */ privateKeySecretVersion?: string; /** * Output only. GitHub Enterprise version installed at the host_uri. */ readonly serverVersion?: string; /** * Optional. Configuration for using Service Directory to privately connect * to a GitHub Enterprise server. This should only be set if the GitHub * Enterprise server is hosted on-premises and not reachable by public * internet. If this field is left empty, calls to the GitHub Enterprise * server will be made over the public internet. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. SSL certificate to use for requests to GitHub Enterprise. */ sslCaCertificate?: string; /** * Optional. SecretManager resource containing the webhook secret of the * GitHub App, formatted as `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). */ webhookSecretSecretVersion?: string; } function serializeGitHubEnterpriseConfig(data: any): GitHubEnterpriseConfig { return { ...data, appId: data["appId"] !== undefined ? String(data["appId"]) : undefined, appInstallationId: data["appInstallationId"] !== undefined ? String(data["appInstallationId"]) : undefined, }; } function deserializeGitHubEnterpriseConfig(data: any): GitHubEnterpriseConfig { return { ...data, appId: data["appId"] !== undefined ? BigInt(data["appId"]) : undefined, appInstallationId: data["appInstallationId"] !== undefined ? BigInt(data["appInstallationId"]) : undefined, }; } /** * Configuration for connections to gitlab.com. */ export interface GitLabConfig { /** * Required. A GitLab personal access token with the minimum `api` scope * access and a minimum role of `maintainer`. The GitLab Projects visible to * this Personal Access Token will control which Projects Developer Connect * has access to. */ authorizerCredential?: UserCredential; /** * Required. A GitLab personal access token with the minimum `read_api` scope * access and a minimum role of `reporter`. The GitLab Projects visible to * this Personal Access Token will control which Projects Developer Connect * has access to. */ readAuthorizerCredential?: UserCredential; /** * Required. Immutable. SecretManager resource containing the webhook secret * of a GitLab project, formatted as `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). This is used to validate webhooks. */ webhookSecretSecretVersion?: string; } /** * Configuration for connections to an instance of GitLab Enterprise. */ export interface GitLabEnterpriseConfig { /** * Required. A GitLab personal access token with the minimum `api` scope * access and a minimum role of `maintainer`. The GitLab Projects visible to * this Personal Access Token will control which Projects Developer Connect * has access to. */ authorizerCredential?: UserCredential; /** * Required. The URI of the GitLab Enterprise host this connection is for. */ hostUri?: string; /** * Required. A GitLab personal access token with the minimum `read_api` scope * access and a minimum role of `reporter`. The GitLab Projects visible to * this Personal Access Token will control which Projects Developer Connect * has access to. */ readAuthorizerCredential?: UserCredential; /** * Output only. Version of the GitLab Enterprise server running on the * `host_uri`. */ readonly serverVersion?: string; /** * Optional. Configuration for using Service Directory to privately connect * to a GitLab Enterprise instance. This should only be set if the GitLab * Enterprise server is hosted on-premises and not reachable by public * internet. If this field is left empty, calls to the GitLab Enterprise * server will be made over the public internet. */ serviceDirectoryConfig?: ServiceDirectoryConfig; /** * Optional. SSL Certificate Authority certificate to use for requests to * GitLab Enterprise instance. */ sslCaCertificate?: string; /** * Required. Immutable. SecretManager resource containing the webhook secret * of a GitLab project, formatted as `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). This is used to validate webhooks. */ webhookSecretSecretVersion?: string; } /** * The git proxy configuration. */ export interface GitProxyConfig { /** * Optional. Setting this to true allows the git proxy to be used for * performing git operations on the repositories linked in the connection. */ enabled?: boolean; } /** * Message describing the GitRepositoryLink object */ export interface GitRepositoryLink { /** * Optional. Allows clients to store small amounts of arbitrary data. */ annotations?: { [key: string]: string }; /** * Required. Git Clone URI. */ cloneUri?: string; /** * Output only. [Output only] Create timestamp */ readonly createTime?: Date; /** * Output only. [Output only] Delete timestamp */ readonly deleteTime?: Date; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ etag?: string; /** * Output only. URI to access the linked repository through the Git Proxy. * This field is only populated if the git proxy is enabled for the * connection. */ readonly gitProxyUri?: string; /** * Optional. Labels as key value pairs */ labels?: { [key: string]: string }; /** * Identifier. Resource name of the repository, in the format * `projects/*\/locations/*\/connections/*\/gitRepositoryLinks/*`. */ name?: string; /** * Output only. Set to true when the connection is being set up or updated in * the background. */ readonly reconciling?: boolean; /** * Output only. A system-assigned unique identifier for the * GitRepositoryLink. */ readonly uid?: string; /** * Output only. [Output only] Update timestamp */ readonly updateTime?: Date; /** * Output only. External ID of the webhook created for the repository. */ readonly webhookId?: string; } /** * GKEWorkload represents the Google Kubernetes Engine runtime. */ export interface GKEWorkload { /** * Required. Immutable. The name of the GKE cluster. Format: * `projects/{project}/locations/{location}/clusters/{cluster}`. */ cluster?: string; /** * Output only. The name of the GKE deployment. Format: * `projects/{project}/locations/{location}/clusters/{cluster}/namespaces/{namespace}/deployments/{deployment}`. */ readonly deployment?: string; } /** * Google Artifact Analysis configurations. */ export interface GoogleArtifactAnalysis { /** * Required. The project id of the project where the provenance is stored. */ projectId?: string; } /** * Google Artifact Registry configurations. */ export interface GoogleArtifactRegistry { /** * Required. Immutable. The name of the artifact registry package. */ artifactRegistryPackage?: string; /** * Required. The host project of Artifact Registry. */ projectId?: string; } /** * GoogleCloudRun represents the Cloud Run runtime. */ export interface GoogleCloudRun { /** * Required. Immutable. The name of the Cloud Run service. Format: * `projects/{project}/locations/{location}/services/{service}`. */ serviceUri?: string; } /** * Message that represents an arbitrary HTTP body. It should only be used for * payload formats that can't be represented as JSON, such as raw binary or an * HTML page. This message can be used both in streaming and non-streaming API * methods in the request as well as the response. It can be used as a top-level * request field, which is convenient if one wants to extract parameters from * either the URL or HTTP template into the request fields and also want access * to the raw HTTP body. Example: message GetResourceRequest { // A unique * request id. string request_id = 1; // The raw HTTP body is bound to this * field. google.api.HttpBody http_body = 2; } service ResourceService { rpc * GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc * UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } * Example with streaming methods: service CaldavService { rpc * GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); * rpc UpdateCalendar(stream google.api.HttpBody) returns (stream * google.api.HttpBody); } Use of this type only changes how the request and * response bodies are handled, all other features will continue to work * unchanged. */ export interface HttpBody { /** * The HTTP Content-Type header value specifying the content type of the * body. */ contentType?: string; /** * The HTTP request/response body as raw binary. */ data?: Uint8Array; /** * Application specific response metadata. Must be set in the first response * for streaming APIs. */ extensions?: { [key: string]: any }[]; } function serializeHttpBody(data: any): HttpBody { return { ...data, data: data["data"] !== undefined ? encodeBase64(data["data"]) : undefined, }; } function deserializeHttpBody(data: any): HttpBody { return { ...data, data: data["data"] !== undefined ? decodeBase64(data["data"] as string) : undefined, }; } /** * The InsightsConfig resource is the core configuration object to capture * events from your Software Development Lifecycle. It acts as the central hub * for managing how Developer connect understands your application, its runtime * environments, and the artifacts deployed within them. */ export interface InsightsConfig { /** * Optional. User specified annotations. See * https://google.aip.dev/148#annotations for more details such as format and * size limitations. */ annotations?: { [key: string]: string }; /** * Optional. The name of the App Hub Application. Format: * projects/{project}/locations/{location}/applications/{application} */ appHubApplication?: string; /** * Optional. The artifact configurations of the artifacts that are deployed. */ artifactConfigs?: ArtifactConfig[]; /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Output only. Any errors that occurred while setting up the InsightsConfig. * Each error will be in the format: `field_name: error_message`, e.g. * GetAppHubApplication: Permission denied while getting App Hub application. * Please grant permissions to the P4SA. */ readonly errors?: Status[]; /** * Optional. Set of labels associated with an InsightsConfig. */ labels?: { [key: string]: string }; /** * Identifier. The name of the InsightsConfig. Format: * projects/{project}/locations/{location}/insightsConfigs/{insightsConfig} */ name?: string; /** * Optional. The GCP projects to track with the InsightsConfig. */ projects?: Projects; /** * Output only. Reconciling (https://google.aip.dev/128#reconciliation). Set * to true if the current state of InsightsConfig does not match the user's * intended state, and the service is actively updating the resource to * reconcile them. This can happen due to user-triggered updates or system * actions like failover or maintenance. */ readonly reconciling?: boolean; /** * Output only. The runtime configurations where the application is deployed. */ readonly runtimeConfigs?: RuntimeConfig[]; /** * Optional. Output only. The state of the InsightsConfig. */ state?: | "STATE_UNSPECIFIED" | "PENDING" | "COMPLETE" | "ERROR"; /** * Output only. Update timestamp. */ readonly updateTime?: Date; } /** * Represents an installation of the GitHub App. */ export interface Installation { /** * ID of the installation in GitHub. */ id?: bigint; /** * Name of the GitHub user or organization that owns this installation. */ name?: string; /** * Either "user" or "organization". */ type?: string; } function serializeInstallation(data: any): Installation { return { ...data, id: data["id"] !== undefined ? String(data["id"]) : undefined, }; } function deserializeInstallation(data: any): Installation { return { ...data, id: data["id"] !== undefined ? BigInt(data["id"]) : undefined, }; } /** * Describes stage and necessary actions to be taken by the user to complete * the installation. Used for GitHub and GitHub Enterprise based connections. */ export interface InstallationState { /** * Output only. Link to follow for next action. Empty string if the * installation is already complete. */ readonly actionUri?: string; /** * Output only. Message of what the user should do next to continue the * installation. Empty string if the installation is already complete. */ readonly message?: string; /** * Output only. Current step of the installation process. */ readonly stage?: | "STAGE_UNSPECIFIED" | "PENDING_CREATE_APP" | "PENDING_USER_OAUTH" | "PENDING_INSTALL_APP" | "COMPLETE"; } /** * LinkableGitRepository represents a git repository that can be linked to a * connection. */ export interface LinkableGitRepository { /** * The clone uri of the repository. */ cloneUri?: string; } /** * Message for response to listing AccountConnectors */ export interface ListAccountConnectorsResponse { /** * The list of AccountConnectors */ accountConnectors?: AccountConnector[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Message for response to listing Connections */ export interface ListConnectionsResponse { /** * The list of Connection */ connections?: Connection[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } function serializeListConnectionsResponse(data: any): ListConnectionsResponse { return { ...data, connections: data["connections"] !== undefined ? data["connections"].map((item: any) => (serializeConnection(item))) : undefined, }; } function deserializeListConnectionsResponse(data: any): ListConnectionsResponse { return { ...data, connections: data["connections"] !== undefined ? data["connections"].map((item: any) => (deserializeConnection(item))) : undefined, }; } /** * Response to listing DeploymentEvents. */ export interface ListDeploymentEventsResponse { /** * The list of DeploymentEvents. */ deploymentEvents?: DeploymentEvent[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * Message for response to listing GitRepositoryLinks */ export interface ListGitRepositoryLinksResponse { /** * The list of GitRepositoryLinks */ gitRepositoryLinks?: GitRepositoryLink[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * Request for response to listing InsightsConfigs. */ export interface ListInsightsConfigsResponse { /** * The list of InsightsConfigs. */ insightsConfigs?: InsightsConfig[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ 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 listing Users */ export interface ListUsersResponse { /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; /** * The list of Users */ users?: User[]; } /** * 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; } /** * Represents an OAuth token of the account that authorized the Connection, and * associated metadata. */ export interface OAuthCredential { /** * Required. A SecretManager resource containing the OAuth token that * authorizes the connection. Format: `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). */ oauthTokenSecretVersion?: string; /** * Output only. The username associated with this token. */ readonly username?: string; } /** * 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 the 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 * google.longrunning.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; } /** * RPC request object accepted by the ProcessBitbucketCloudWebhook RPC method. */ export interface ProcessBitbucketCloudWebhookRequest { /** * Required. HTTP request body. */ body?: HttpBody; } function serializeProcessBitbucketCloudWebhookRequest(data: any): ProcessBitbucketCloudWebhookRequest { return { ...data, body: data["body"] !== undefined ? serializeHttpBody(data["body"]) : undefined, }; } function deserializeProcessBitbucketCloudWebhookRequest(data: any): ProcessBitbucketCloudWebhookRequest { return { ...data, body: data["body"] !== undefined ? deserializeHttpBody(data["body"]) : undefined, }; } /** * RPC request object accepted by the ProcessBitbucketDataCenterWebhook RPC * method. */ export interface ProcessBitbucketDataCenterWebhookRequest { /** * Required. HTTP request body. */ body?: HttpBody; } function serializeProcessBitbucketDataCenterWebhookRequest(data: any): ProcessBitbucketDataCenterWebhookRequest { return { ...data, body: data["body"] !== undefined ? serializeHttpBody(data["body"]) : undefined, }; } function deserializeProcessBitbucketDataCenterWebhookRequest(data: any): ProcessBitbucketDataCenterWebhookRequest { return { ...data, body: data["body"] !== undefined ? deserializeHttpBody(data["body"]) : undefined, }; } /** * RPC request object accepted by the ProcessGitHubEnterpriseWebhook RPC * method. */ export interface ProcessGitHubEnterpriseWebhookRequest { /** * Required. HTTP request body. */ body?: HttpBody; } function serializeProcessGitHubEnterpriseWebhookRequest(data: any): ProcessGitHubEnterpriseWebhookRequest { return { ...data, body: data["body"] !== undefined ? serializeHttpBody(data["body"]) : undefined, }; } function deserializeProcessGitHubEnterpriseWebhookRequest(data: any): ProcessGitHubEnterpriseWebhookRequest { return { ...data, body: data["body"] !== undefined ? deserializeHttpBody(data["body"]) : undefined, }; } /** * RPC request object accepted by the ProcessGitLabEnterpriseWebhook RPC * method. */ export interface ProcessGitLabEnterpriseWebhookRequest { /** * Required. HTTP request body. */ body?: HttpBody; } function serializeProcessGitLabEnterpriseWebhookRequest(data: any): ProcessGitLabEnterpriseWebhookRequest { return { ...data, body: data["body"] !== undefined ? serializeHttpBody(data["body"]) : undefined, }; } function deserializeProcessGitLabEnterpriseWebhookRequest(data: any): ProcessGitLabEnterpriseWebhookRequest { return { ...data, body: data["body"] !== undefined ? deserializeHttpBody(data["body"]) : undefined, }; } /** * RPC request object accepted by the ProcessGitLabWebhook RPC method. */ export interface ProcessGitLabWebhookRequest { /** * Required. HTTP request body. */ body?: HttpBody; } function serializeProcessGitLabWebhookRequest(data: any): ProcessGitLabWebhookRequest { return { ...data, body: data["body"] !== undefined ? serializeHttpBody(data["body"]) : undefined, }; } function deserializeProcessGitLabWebhookRequest(data: any): ProcessGitLabWebhookRequest { return { ...data, body: data["body"] !== undefined ? deserializeHttpBody(data["body"]) : undefined, }; } /** * Projects represents the projects to track with the InsightsConfig. */ export interface Projects { /** * Optional. The GCP Project IDs. Format: projects/{project} */ projectIds?: string[]; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsCreate. */ export interface ProjectsLocationsAccountConnectorsCreateOptions { /** * Required. The ID to use for the AccountConnector, which will become the * final component of the AccountConnector's resource name. Its format should * adhere to https://google.aip.dev/122#resource-id-segments Names must be * unique per-project per-location. */ accountConnectorId?: 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsDelete. */ export interface ProjectsLocationsAccountConnectorsDeleteOptions { /** * Optional. The current etag of the AccountConnectorn. If an etag is * provided and does not match the current etag of the AccountConnector, * deletion will be blocked and an ABORTED error will be returned. */ etag?: string; /** * Optional. If set to true, any Users from this AccountConnector will also * be deleted. (Otherwise, the request will only work if the AccountConnector * has no Users.) */ 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 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsList. */ export interface ProjectsLocationsAccountConnectorsListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsPatch. */ export interface ProjectsLocationsAccountConnectorsPatchOptions { /** * Optional. If set to true, and the accountConnector is not found a new * accountConnector will be created. In this situation `update_mask` is * ignored. The creation will succeed only if the input accountConnector has * all the necessary */ 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. The list of fields to be updated. */ updateMask?: string /* FieldMask */; /** * Optional. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } function serializeProjectsLocationsAccountConnectorsPatchOptions(data: any): ProjectsLocationsAccountConnectorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsAccountConnectorsPatchOptions(data: any): ProjectsLocationsAccountConnectorsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsUsersDelete. */ export interface ProjectsLocationsAccountConnectorsUsersDeleteOptions { /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsUsersFinishOAuthFlow. */ export interface ProjectsLocationsAccountConnectorsUsersFinishOAuthFlowOptions { /** * Required. The scopes returned by Google OAuth flow. */ ["googleOauthParams.scopes"]?: string; /** * Required. The ticket to be used for post processing the callback from * Google OAuth flow. */ ["googleOauthParams.ticket"]?: string; /** * Optional. The version info returned by Google OAuth flow. */ ["googleOauthParams.versionInfo"]?: string; /** * Required. The code to be used for getting the token from SCM provider. */ ["oauthParams.code"]?: string; /** * Required. The ticket to be used for post processing the callback from SCM * provider. */ ["oauthParams.ticket"]?: string; } /** * Additional options for * DeveloperConnect#projectsLocationsAccountConnectorsUsersList. */ export interface ProjectsLocationsAccountConnectorsUsersListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for DeveloperConnect#projectsLocationsConnectionsCreate. */ export interface ProjectsLocationsConnectionsCreateOptions { /** * Required. Id of the requesting object If auto-generating Id server-side, * remove this field and connection_id from the method_signature of Create RPC */ connectionId?: 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for DeveloperConnect#projectsLocationsConnectionsDelete. */ export interface ProjectsLocationsConnectionsDeleteOptions { /** * Optional. The current etag of the Connection. If an etag is provided and * does not match the current etag of the Connection, deletion will be blocked * and an ABORTED error will be returned. */ 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsConnectionsFetchLinkableGitRepositories. */ export interface ProjectsLocationsConnectionsFetchLinkableGitRepositoriesOptions { /** * Optional. Number of results to return in the list. Defaults to 20. */ pageSize?: number; /** * Optional. Page start. */ pageToken?: string; } /** * Additional options for * DeveloperConnect#projectsLocationsConnectionsGitRepositoryLinksCreate. */ export interface ProjectsLocationsConnectionsGitRepositoryLinksCreateOptions { /** * Required. The ID to use for the repository, which will become the final * component of the repository's resource name. This ID should be unique in * the connection. Allows alphanumeric characters and any of * -._~%!$&'()*+,;=@. */ gitRepositoryLinkId?: 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsConnectionsGitRepositoryLinksDelete. */ export interface ProjectsLocationsConnectionsGitRepositoryLinksDeleteOptions { /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsConnectionsGitRepositoryLinksFetchGitRefs. */ export interface ProjectsLocationsConnectionsGitRepositoryLinksFetchGitRefsOptions { /** * Optional. Number of results to return in the list. Default to 20. */ pageSize?: number; /** * Optional. Page start. */ pageToken?: string; /** * Required. Type of refs to fetch. */ refType?: | "REF_TYPE_UNSPECIFIED" | "TAG" | "BRANCH"; } /** * Additional options for * DeveloperConnect#projectsLocationsConnectionsGitRepositoryLinksList. */ export interface ProjectsLocationsConnectionsGitRepositoryLinksListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for DeveloperConnect#projectsLocationsConnectionsList. */ export interface ProjectsLocationsConnectionsListOptions { /** * Optional. Filtering results */ filter?: string; /** * Optional. Hint for how to order the results */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for DeveloperConnect#projectsLocationsConnectionsPatch. */ export interface ProjectsLocationsConnectionsPatchOptions { /** * Optional. If set to true, and the connection is not found a new connection * will be created. In this situation `update_mask` is ignored. The creation * will succeed only if the input connection has all the necessary information * (e.g a github_config with both user_oauth_token and installation_id * properties). */ 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; /** * Required. Field mask is used to specify the fields to be overwritten in * the Connection 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } function serializeProjectsLocationsConnectionsPatchOptions(data: any): ProjectsLocationsConnectionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsConnectionsPatchOptions(data: any): ProjectsLocationsConnectionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * DeveloperConnect#projectsLocationsInsightsConfigsCreate. */ export interface ProjectsLocationsInsightsConfigsCreateOptions { /** * Required. ID of the requesting InsightsConfig. */ insightsConfigId?: string; /** * Optional. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsInsightsConfigsDelete. */ export interface ProjectsLocationsInsightsConfigsDeleteOptions { /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * DeveloperConnect#projectsLocationsInsightsConfigsDeploymentEventsList. */ export interface ProjectsLocationsInsightsConfigsDeploymentEventsListOptions { /** * Optional. Filter expression that matches a subset of the DeploymentEvents. * https://google.aip.dev/160. */ filter?: string; /** * Optional. The maximum number of deployment events to return. The service * may return fewer than this value. If unspecified, at most 50 deployment * events will be returned. The maximum value is 1000; values above 1000 will * be coerced to 1000. */ pageSize?: number; /** * Optional. A page token, received from a previous `ListDeploymentEvents` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListDeploymentEvents` must match the call * that provided the page token. */ pageToken?: string; } /** * Additional options for * DeveloperConnect#projectsLocationsInsightsConfigsList. */ export interface ProjectsLocationsInsightsConfigsListOptions { /** * Optional. Filtering results. See https://google.aip.dev/160 for more * details. Filter string, adhering to the rules in * https://google.aip.dev/160. List only InsightsConfigs matching the filter. * If filter is empty, all InsightsConfigs are listed. */ filter?: string; /** * Optional. Hint for how to order the results. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * DeveloperConnect#projectsLocationsInsightsConfigsPatch. */ export interface ProjectsLocationsInsightsConfigsPatchOptions { /** * Optional. If set to true, and the insightsConfig is not found a new * insightsConfig will be created. In this situation `update_mask` is ignored. * The creation will succeed only if the input insightsConfig has all the * necessary information (e.g a github_config with both user_oauth_token and * installation_id properties). */ 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 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. If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for DeveloperConnect#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 DeveloperConnect#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; } /** * ProviderOAuthConfig is the OAuth config for a provider. */ export interface ProviderOAuthConfig { /** * Required. User selected scopes to apply to the Oauth config In the event * of changing scopes, user records under AccountConnector will be deleted and * users will re-auth again. */ scopes?: string[]; /** * Immutable. Developer Connect provided OAuth. */ systemProviderId?: | "SYSTEM_PROVIDER_UNSPECIFIED" | "GITHUB" | "GITLAB" | "GOOGLE" | "SENTRY" | "ROVO" | "NEW_RELIC" | "DATASTAX" | "DYNATRACE"; } /** * RuntimeConfig represents the runtimes where the application is deployed. */ export interface RuntimeConfig { /** * Output only. App Hub Service. */ readonly appHubService?: AppHubService; /** * Output only. App Hub Workload. */ readonly appHubWorkload?: AppHubWorkload; /** * Output only. Google Kubernetes Engine runtime. */ readonly gkeWorkload?: GKEWorkload; /** * Output only. Cloud Run runtime. */ readonly googleCloudRun?: GoogleCloudRun; /** * Output only. The state of the Runtime. */ readonly state?: | "STATE_UNSPECIFIED" | "LINKED" | "UNLINKED"; /** * Required. Immutable. The URI of the runtime configuration. For GKE, this * is the cluster name. For Cloud Run, this is the service name. */ uri?: string; } /** * ServiceDirectoryConfig represents Service Directory configuration for a * connection. */ export interface ServiceDirectoryConfig { /** * Required. The Service Directory service name. Format: * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. */ service?: string; } /** * Message for responding to starting an OAuth flow. */ export interface StartOAuthResponse { /** * The authorization server URL to the OAuth flow of the service provider. */ authUri?: string; /** * The client ID to the OAuth App of the service provider. */ clientId?: string; /** * https://datatracker.ietf.org/doc/html/rfc7636#section-4.1 Follow * http://shortn/_WFYl6U0NyC to include it in the AutoCodeURL. */ codeChallenge?: string; /** * https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 */ codeChallengeMethod?: string; /** * The list of scopes requested by the application. */ scopes?: string[]; /** * The ID of the system provider. */ systemProviderId?: | "SYSTEM_PROVIDER_UNSPECIFIED" | "GITHUB" | "GITLAB" | "GOOGLE" | "SENTRY" | "ROVO" | "NEW_RELIC" | "DATASTAX" | "DYNATRACE"; /** * The ticket to be used for post processing the callback from the service * provider. */ ticket?: 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; } /** * User represents a user connected to the service providers through a * AccountConnector. */ export interface User { /** * Output only. The timestamp when the user was created. */ readonly createTime?: Date; /** * Output only. Developer Connect automatically converts user identity to * some human readable description, e.g., email address. */ readonly displayName?: string; /** * Output only. The timestamp when the token was last requested. */ readonly lastTokenRequestTime?: Date; /** * Identifier. Resource name of the user, in the format * `projects/*\/locations/*\/accountConnectors/*\/users/*`. */ name?: string; } /** * Represents a personal access token that authorized the Connection, and * associated metadata. */ export interface UserCredential { /** * Output only. The username associated with this token. */ readonly username?: string; /** * Required. A SecretManager resource containing the user token that * authorizes the Developer Connect connection. Format: * `projects/*\/secrets/*\/versions/*` or * `projects/*\/locations/*\/secrets/*\/versions/*` (if regional secrets are * supported in that location). */ userTokenSecretVersion?: string; } function decodeBase64(b64: string): Uint8Array { const binString = atob(b64); const size = binString.length; const bytes = new Uint8Array(size); for (let i = 0; i < size; i++) { bytes[i] = binString.charCodeAt(i); } return bytes; } const base64abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]; /** * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation * @param data */ function encodeBase64(uint8: Uint8Array): string { let result = "", i; const l = uint8.length; for (i = 2; i < l; i += 3) { result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; result += base64abc[uint8[i] & 0x3f]; } if (i === l + 1) { // 1 octet yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[(uint8[i - 2] & 0x03) << 4]; result += "=="; } if (i === l) { // 2 octets yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[(uint8[i - 1] & 0x0f) << 2]; result += "="; } return result; }