// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Cloud Build API Client for Deno * =============================== * * Creates and manages builds on Google Cloud Platform. * * Docs: https://cloud.google.com/cloud-build/docs/ * Source: https://googleapis.deno.dev/v1/cloudbuild:v2.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Creates and manages builds on Google Cloud Platform. */ export class CloudBuild { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://cloudbuild.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Creates a Connection. * * @param parent Required. Project and location where the connection will be created. Format: `projects/*/locations/*`. */ async projectsLocationsConnectionsCreate(parent: string, req: Connection, opts: ProjectsLocationsConnectionsCreateOptions = {}): Promise { req = serializeConnection(req); const url = new URL(`${this.#baseUrl}v2/${ parent }/connections`); if (opts.connectionId !== undefined) { url.searchParams.append("connectionId", String(opts.connectionId)); } 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. The name of the Connection to delete. Format: `projects/*/locations/*/connections/*`. */ async projectsLocationsConnectionsDelete(name: string, opts: ProjectsLocationsConnectionsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } 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; } /** * FetchLinkableRepositories get repositories from SCM that are accessible * and could be added to the connection. * * @param connection Required. The name of the Connection. Format: `projects/*/locations/*/connections/*`. */ async projectsLocationsConnectionsFetchLinkableRepositories(connection: string, opts: ProjectsLocationsConnectionsFetchLinkableRepositoriesOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ connection }:fetchLinkableRepositories`); 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 FetchLinkableRepositoriesResponse; } /** * Gets details of a single connection. * * @param name Required. The name of the Connection to retrieve. Format: `projects/*/locations/*/connections/*`. */ async projectsLocationsConnectionsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeConnection(data); } /** * Gets the access control policy for a resource. Returns an empty policy if * the resource exists and does not have a policy set. * * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsConnectionsGetIamPolicy(resource: string, opts: ProjectsLocationsConnectionsGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ resource }:getIamPolicy`); if (opts["options.requestedPolicyVersion"] !== undefined) { url.searchParams.append("options.requestedPolicyVersion", String(opts["options.requestedPolicyVersion"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Lists Connections in a given project and location. * * @param parent Required. The parent, which owns this collection of Connections. Format: `projects/*/locations/*`. */ async projectsLocationsConnectionsList(parent: string, opts: ProjectsLocationsConnectionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/connections`); 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 a single connection. * * @param name Immutable. 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}v2/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * ProcessWebhook is called by the external SCM for notifying of events. * * @param parent Required. Project and location where the webhook will be received. Format: `projects/*/locations/*`. */ async projectsLocationsConnectionsProcessWebhook(parent: string, req: HttpBody, opts: ProjectsLocationsConnectionsProcessWebhookOptions = {}): Promise { req = serializeHttpBody(req); const url = new URL(`${this.#baseUrl}v2/${ parent }/connections:processWebhook`); if (opts.webhookKey !== undefined) { url.searchParams.append("webhookKey", String(opts.webhookKey)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Fetches read token of a given repository. * * @param repository Required. The resource name of the repository in the format `projects/*/locations/*/connections/*/repositories/*`. */ async projectsLocationsConnectionsRepositoriesAccessReadToken(repository: string, req: FetchReadTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ repository }:accessReadToken`); 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 repository. * * @param repository Required. The resource name of the repository in the format `projects/*/locations/*/connections/*/repositories/*`. */ async projectsLocationsConnectionsRepositoriesAccessReadWriteToken(repository: string, req: FetchReadWriteTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ repository }:accessReadWriteToken`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeFetchReadWriteTokenResponse(data); } /** * Creates multiple repositories inside a connection. * * @param parent Required. The connection to contain all the repositories being created. Format: projects/*/locations/*/connections/* The parent field in the CreateRepositoryRequest messages must either be empty or match this field. */ async projectsLocationsConnectionsRepositoriesBatchCreate(parent: string, req: BatchCreateRepositoriesRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/repositories:batchCreate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Creates a Repository. * * @param parent Required. The connection to contain the repository. If the request is part of a BatchCreateRepositoriesRequest, this field should be empty or match the parent specified there. */ async projectsLocationsConnectionsRepositoriesCreate(parent: string, req: Repository, opts: ProjectsLocationsConnectionsRepositoriesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/repositories`); if (opts.repositoryId !== undefined) { url.searchParams.append("repositoryId", String(opts.repositoryId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a single repository. * * @param name Required. The name of the Repository to delete. Format: `projects/*/locations/*/connections/*/repositories/*`. */ async projectsLocationsConnectionsRepositoriesDelete(name: string, opts: ProjectsLocationsConnectionsRepositoriesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } 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 repository Required. The resource name of the repository in the format `projects/*/locations/*/connections/*/repositories/*`. */ async projectsLocationsConnectionsRepositoriesFetchGitRefs(repository: string, opts: ProjectsLocationsConnectionsRepositoriesFetchGitRefsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ repository }: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; } /** * Gets details of a single repository. * * @param name Required. The name of the Repository to retrieve. Format: `projects/*/locations/*/connections/*/repositories/*`. */ async projectsLocationsConnectionsRepositoriesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Repository; } /** * Lists Repositories in a given connection. * * @param parent Required. The parent, which owns this collection of Repositories. Format: `projects/*/locations/*/connections/*`. */ async projectsLocationsConnectionsRepositoriesList(parent: string, opts: ProjectsLocationsConnectionsRepositoriesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/repositories`); 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 ListRepositoriesResponse; } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and * `PERMISSION_DENIED` errors. * * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsConnectionsSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v2/${ resource }:setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Returns permissions that a caller has on the specified resource. If the * resource does not exist, this will return an empty set of permissions, not * a `NOT_FOUND` error. Note: This operation is designed to be used for * building permission-aware UIs and command-line tools, not for authorization * checking. This operation may "fail open" without warning. * * @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsConnectionsTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ resource }:testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestIamPermissionsResponse; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }/locations`); 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}v2/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); 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}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } } /** * Specifies the audit configuration for a service. The configuration * determines which permission types are logged, and what identities, if any, * are exempted from logging. An AuditConfig must have one or more * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a * specific service, the union of the two AuditConfigs is used for that service: * the log_types specified in each AuditConfig are enabled, and the * exempted_members in each AuditLogConfig are exempted. Example Policy with * multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", * "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ * "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": * "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", * "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": * "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For * sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ * logging. It also exempts `jose@example.com` from DATA_READ logging, and * `aliya@example.com` from DATA_WRITE logging. */ export interface AuditConfig { /** * The configuration for logging of each type of permission. */ auditLogConfigs?: AuditLogConfig[]; /** * Specifies a service that will be enabled for audit logging. For example, * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a * special value that covers all services. */ service?: string; } /** * Provides the configuration for logging a type of permissions. Example: { * "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ * "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables * 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from * DATA_READ logging. */ export interface AuditLogConfig { /** * Specifies the identities that do not cause logging for this type of * permission. Follows the same format of Binding.members. */ exemptedMembers?: string[]; /** * The log type that this config enables. */ logType?: | "LOG_TYPE_UNSPECIFIED" | "ADMIN_READ" | "DATA_WRITE" | "DATA_READ"; } /** * Message for creating repositoritories in batch. */ export interface BatchCreateRepositoriesRequest { /** * Required. The request messages specifying the repositories to create. */ requests?: CreateRepositoryRequest[]; } /** * Message for response of creating repositories in batch. */ export interface BatchCreateRepositoriesResponse { /** * Repository resources created. */ repositories?: Repository[]; } /** * Associates `members`, or principals, with a `role`. */ export interface Binding { /** * The condition that is associated with this binding. If the condition * evaluates to `true`, then this binding applies to the current request. If * the condition evaluates to `false`, then this binding does not apply to the * current request. However, a different role binding might grant the same * role to one or more of the principals in this binding. To learn which * resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ condition?: Expr; /** * Specifies the principals requesting access for a Google Cloud resource. * `members` can have the following values: * `allUsers`: A special identifier * that represents anyone who is on the internet; with or without a Google * account. * `allAuthenticatedUsers`: A special identifier that represents * anyone who is authenticated with a Google account or a service account. * Does not include identities that come from external identity providers * (IdPs) through identity federation. * `user:{emailid}`: An email address * that represents a specific Google account. For example, `alice@example.com` * . * `serviceAccount:{emailid}`: An email address that represents a Google * service account. For example, `my-other-app@appspot.gserviceaccount.com`. * * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An * identifier for a [Kubernetes service * account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). * For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * * `group:{emailid}`: An email address that represents a Google group. For * example, `admins@example.com`. * `domain:{domain}`: The G Suite domain * (primary) that represents all the users of that domain. For example, * `google.com` or `example.com`. * * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workforce identity pool. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: * All workforce identities in a group. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All workforce identities with a specific attribute value. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: * All identities in a workforce identity pool. * * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workload identity pool. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: * A workload identity pool group. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All identities in a workload identity pool with a certain attribute. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: * All identities in a workload identity pool. * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique * identifier) representing a user that has been recently deleted. For * example, `alice@example.com?uid=123456789012345678901`. If the user is * recovered, this value reverts to `user:{emailid}` and the recovered user * retains the role in the binding. * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus * unique identifier) representing a service account that has been recently * deleted. For example, * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If * the service account is undeleted, this value reverts to * `serviceAccount:{emailid}` and the undeleted service account retains the * role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email * address (plus unique identifier) representing a Google group that has been * recently deleted. For example, * `admins@example.com?uid=123456789012345678901`. If the group is recovered, * this value reverts to `group:{emailid}` and the recovered group retains the * role in the binding. * * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * Deleted single identity in a workforce identity pool. For example, * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. */ members?: string[]; /** * Role that is assigned to the list of `members`, or principals. For * example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview * of the IAM roles and permissions, see the [IAM * documentation](https://cloud.google.com/iam/docs/roles-overview). For a * list of the available pre-defined roles, see * [here](https://cloud.google.com/iam/docs/understanding-roles). */ role?: string; } /** * Configuration for connections to Bitbucket Cloud. */ export interface BitbucketCloudConfig { /** * Required. An access token with the `webhook`, `repository`, * `repository:admin` and `pullrequest` scope access. It can be either a * workspace, project or repository access token. It's recommended to use a * system account to generate these credentials. */ authorizerCredential?: UserCredential; /** * Required. An access token with the `repository` access. It can be either a * workspace, project or repository access token. It's recommended to use a * system account to generate the credentials. */ readAuthorizerCredential?: UserCredential; /** * Required. SecretManager resource containing the webhook secret used to * verify webhook events, formatted as `projects/*\/secrets/*\/versions/*`. */ webhookSecretSecretVersion?: string; /** * Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud * Platform. */ workspace?: string; } /** * Configuration for connections to Bitbucket Data Center. */ export interface BitbucketDataCenterConfig { /** * Required. A http access token with the `REPO_ADMIN` scope access. */ authorizerCredential?: UserCredential; /** * Required. The URI of the Bitbucket Data Center instance or cluster this * connection is for. */ hostUri?: string; /** * Required. A http access token with the `REPO_READ` access. */ readAuthorizerCredential?: UserCredential; /** * Output only. Version of the Bitbucket Data Center running on the * `host_uri`. */ readonly serverVersion?: string; /** * Optional. Configuration for using Service Directory to privately connect * to a Bitbucket Data Center. 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?: GoogleDevtoolsCloudbuildV2ServiceDirectoryConfig; /** * Optional. SSL certificate to use for requests to the Bitbucket Data * Center. */ sslCa?: string; /** * Required. Immutable. SecretManager resource containing the webhook secret * used to verify webhook events, formatted as * `projects/*\/secrets/*\/versions/*`. */ webhookSecretSecretVersion?: string; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * Capabilities adds and removes POSIX capabilities from running containers. */ export interface Capabilities { /** * Optional. Added capabilities +optional */ add?: string[]; /** * Optional. Removed capabilities +optional */ drop?: string[]; } /** * ChildStatusReference is used to point to the statuses of individual TaskRuns * and Runs within this PipelineRun. */ export interface ChildStatusReference { /** * Name is the name of the TaskRun or Run this is referencing. */ name?: string; /** * PipelineTaskName is the name of the PipelineTask this is referencing. */ pipelineTaskName?: string; /** * Output only. Type of the child reference. */ readonly type?: | "TYPE_UNSPECIFIED" | "TASK_RUN"; /** * WhenExpressions is the list of checks guarding the execution of the * PipelineTask */ whenExpressions?: WhenExpression[]; } /** * A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center, * Bitbucket Cloud or GitLab. */ export interface Connection { /** * Optional. Allows clients to store small amounts of arbitrary data. */ annotations?: { [key: string]: string }; /** * Configuration for connections to Bitbucket Cloud. */ bitbucketCloudConfig?: BitbucketCloudConfig; /** * Configuration for connections to Bitbucket Data Center. */ bitbucketDataCenterConfig?: BitbucketDataCenterConfig; /** * Output only. Server assigned timestamp for when the connection was * created. */ readonly createTime?: 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; /** * 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?: GoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig; /** * Configuration for connections to gitlab.com or an instance of GitLab * Enterprise. */ gitlabConfig?: GoogleDevtoolsCloudbuildV2GitLabConfig; /** * Output only. Installation state of the Connection. */ readonly installationState?: InstallationState; /** * Immutable. 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. Server assigned timestamp for when the connection was * updated. */ readonly updateTime?: Date; } function serializeConnection(data: any): Connection { return { ...data, githubConfig: data["githubConfig"] !== undefined ? serializeGitHubConfig(data["githubConfig"]) : undefined, githubEnterpriseConfig: data["githubEnterpriseConfig"] !== undefined ? serializeGoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig(data["githubEnterpriseConfig"]) : undefined, }; } function deserializeConnection(data: any): Connection { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, githubConfig: data["githubConfig"] !== undefined ? deserializeGitHubConfig(data["githubConfig"]) : undefined, githubEnterpriseConfig: data["githubEnterpriseConfig"] !== undefined ? deserializeGoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig(data["githubEnterpriseConfig"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Message for creating a Repository. */ export interface CreateRepositoryRequest { /** * Required. The connection to contain the repository. If the request is part * of a BatchCreateRepositoriesRequest, this field should be empty or match * the parent specified there. */ parent?: string; /** * Required. The repository to create. */ repository?: Repository; /** * 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 * -._~%!$&'()*+,;=@. */ repositoryId?: string; } /** * EmbeddedTask defines a Task that is embedded in a Pipeline. */ export interface EmbeddedTask { /** * User annotations. See https://google.aip.dev/128#annotations */ annotations?: { [key: string]: string }; /** * Spec to instantiate this TaskRun. */ taskSpec?: TaskSpec; } function serializeEmbeddedTask(data: any): EmbeddedTask { return { ...data, taskSpec: data["taskSpec"] !== undefined ? serializeTaskSpec(data["taskSpec"]) : undefined, }; } function deserializeEmbeddedTask(data: any): EmbeddedTask { return { ...data, taskSpec: data["taskSpec"] !== undefined ? deserializeTaskSpec(data["taskSpec"]) : undefined, }; } /** * 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 { } /** * Represents an empty Volume source. */ export interface EmptyDirVolumeSource { } /** * Environment variable. */ export interface EnvVar { /** * Name of the environment variable. */ name?: string; /** * Value of the environment variable. */ value?: string; } /** * ExecAction describes a "run in container" action. */ export interface ExecAction { /** * Optional. Command is the command line to execute inside the container, the * working directory for the command is root ('/') in the container's * filesystem. The command is simply exec'd, it is not run inside a shell, so * traditional shell instructions ('|', etc) won't work. To use a shell, you * need to explicitly call out to that shell. Exit status of 0 is treated as * live/healthy and non-zero is unhealthy. +optional */ command?: string[]; } /** * Represents a textual expression in the Common Expression Language (CEL) * syntax. CEL is a C-like expression language. The syntax and semantics of CEL * are documented at https://github.com/google/cel-spec. Example (Comparison): * title: "Summary size limit" description: "Determines if a summary is less * than 100 chars" expression: "document.summary.size() < 100" Example * (Equality): title: "Requestor is owner" description: "Determines if requestor * is the document owner" expression: "document.owner == * request.auth.claims.email" Example (Logic): title: "Public documents" * description: "Determine whether the document should be publicly visible" * expression: "document.type != 'private' && document.type != 'internal'" * Example (Data Manipulation): title: "Notification string" description: * "Create a notification string with a timestamp." expression: "'New message * received at ' + string(document.create_time)" The exact variables and * functions that may be referenced within an expression are determined by the * service that evaluates it. See the service documentation for additional * information. */ export interface Expr { /** * Optional. Description of the expression. This is a longer text which * describes the expression, e.g. when hovered over it in a UI. */ description?: string; /** * Textual representation of an expression in Common Expression Language * syntax. */ expression?: string; /** * Optional. String indicating the location of the expression for error * reporting, e.g. a file name and a position in the file. */ location?: string; /** * Optional. Title for the expression, i.e. a short string describing its * purpose. This can be used e.g. in UIs which allow to enter the expression. */ title?: string; } /** * 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 FetchLinkableRepositories. */ export interface FetchLinkableRepositoriesResponse { /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * repositories ready to be created. */ repositories?: Repository[]; } /** * 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 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 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, }; } /** * 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 Cloud Build * GitHub App. It is recommended to use a robot account instead of a human * user account. The OAuth token must be tied to the Cloud Build GitHub App. */ authorizerCredential?: OAuthCredential; } 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, }; } /** * Conditions defines a readiness condition for a Knative resource. */ export interface GoogleDevtoolsCloudbuildV2Condition { /** * LastTransitionTime is the last time the condition transitioned from one * status to another. */ lastTransitionTime?: Date; /** * A human readable message indicating details about the transition. */ message?: string; /** * The reason for the condition's last transition. */ reason?: string; /** * Severity with which to treat failures of this type of condition. */ severity?: | "SEVERITY_UNSPECIFIED" | "WARNING" | "INFO"; /** * Status of the condition. */ status?: | "UNKNOWN" | "TRUE" | "FALSE"; /** * Type of condition. */ type?: string; } function serializeGoogleDevtoolsCloudbuildV2Condition(data: any): GoogleDevtoolsCloudbuildV2Condition { return { ...data, lastTransitionTime: data["lastTransitionTime"] !== undefined ? data["lastTransitionTime"].toISOString() : undefined, }; } function deserializeGoogleDevtoolsCloudbuildV2Condition(data: any): GoogleDevtoolsCloudbuildV2Condition { return { ...data, lastTransitionTime: data["lastTransitionTime"] !== undefined ? new Date(data["lastTransitionTime"]) : undefined, }; } /** * Configuration for connections to an instance of GitHub Enterprise. */ export interface GoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig { /** * Required. API Key used for authentication of webhook events. */ apiKey?: string; /** * Optional. Id of the GitHub App created from the manifest. */ appId?: bigint; /** * Optional. ID of the installation of the GitHub App. */ appInstallationId?: bigint; /** * Optional. The URL-friendly name of the GitHub App. */ appSlug?: string; /** * Required. The URI of the GitHub Enterprise host this connection is for. */ hostUri?: string; /** * Optional. SecretManager resource containing the private key of the GitHub * App, formatted as `projects/*\/secrets/*\/versions/*`. */ 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?: GoogleDevtoolsCloudbuildV2ServiceDirectoryConfig; /** * Optional. SSL certificate to use for requests to GitHub Enterprise. */ sslCa?: string; /** * Optional. SecretManager resource containing the webhook secret of the * GitHub App, formatted as `projects/*\/secrets/*\/versions/*`. */ webhookSecretSecretVersion?: string; } function serializeGoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig(data: any): GoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig { return { ...data, appId: data["appId"] !== undefined ? String(data["appId"]) : undefined, appInstallationId: data["appInstallationId"] !== undefined ? String(data["appInstallationId"]) : undefined, }; } function deserializeGoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig(data: any): GoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig { return { ...data, appId: data["appId"] !== undefined ? BigInt(data["appId"]) : undefined, appInstallationId: data["appInstallationId"] !== undefined ? BigInt(data["appInstallationId"]) : undefined, }; } /** * Configuration for connections to gitlab.com or an instance of GitLab * Enterprise. */ export interface GoogleDevtoolsCloudbuildV2GitLabConfig { /** * Required. A GitLab personal access token with the `api` scope access. */ authorizerCredential?: UserCredential; /** * Optional. The URI of the GitLab Enterprise host this connection is for. If * not specified, the default value is https://gitlab.com. */ hostUri?: string; /** * Required. A GitLab personal access token with the minimum `read_api` scope * access. */ 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 server. 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?: GoogleDevtoolsCloudbuildV2ServiceDirectoryConfig; /** * Optional. SSL certificate to use for requests to GitLab Enterprise. */ sslCa?: string; /** * Required. Immutable. SecretManager resource containing the webhook secret * of a GitLab Enterprise project, formatted as * `projects/*\/secrets/*\/versions/*`. */ webhookSecretSecretVersion?: string; } /** * Represents the metadata of the long-running operation. */ export interface GoogleDevtoolsCloudbuildV2OperationMetadata { /** * 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 successfully been cancelled have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * Output only. Human-readable status of the operation, if any. */ readonly statusMessage?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * ServiceDirectoryConfig represents Service Directory configuration for a * connection. */ export interface GoogleDevtoolsCloudbuildV2ServiceDirectoryConfig { /** * Required. The Service Directory service name. Format: * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. */ service?: 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, }; } /** * 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"; } /** * Message for response to listing Connections. */ export interface ListConnectionsResponse { /** * The list of Connections. */ connections?: Connection[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: 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, }; } /** * 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; } /** * Message for response to listing Repositories. */ export interface ListRepositoriesResponse { /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * The list of Repositories. */ repositories?: Repository[]; } /** * 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 { /** * Optional. A SecretManager resource containing the OAuth token that * authorizes the Cloud Build connection. Format: * `projects/*\/secrets/*\/versions/*`. */ oauthTokenSecretVersion?: string; /** * Output only. The username associated to 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. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly cancelRequested?: boolean; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Human-readable status of the operation, if any. */ readonly statusDetail?: 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; } /** * Param defined with name and value. PipelineRef can be used to refer to a * specific instance of a Pipeline. */ export interface Param { /** * Name of the parameter. */ name?: string; /** * Value of the parameter. */ value?: ParamValue; } /** * ParamSpec defines parameters needed beyond typed inputs (such as resources). * Parameter values are provided by users as inputs on a TaskRun or PipelineRun. */ export interface ParamSpec { /** * The default value a parameter takes if no input value is supplied */ default?: ParamValue; /** * Description of the ParamSpec */ description?: string; /** * Name of the ParamSpec */ name?: string; /** * Type of ParamSpec */ type?: | "TYPE_UNSPECIFIED" | "STRING" | "ARRAY" | "OBJECT"; } /** * Parameter value. */ export interface ParamValue { /** * Value of the parameter if type is array. */ arrayVal?: string[]; /** * Optional. Value of the parameter if type is object. */ objectVal?: { [key: string]: string }; /** * Value of the parameter if type is string. */ stringVal?: string; /** * Type of parameter. */ type?: | "TYPE_UNSPECIFIED" | "STRING" | "ARRAY" | "OBJECT"; } /** * PipelineRef can be used to refer to a specific instance of a Pipeline. */ export interface PipelineRef { /** * Optional. Name of the Pipeline. */ name?: string; /** * Params contains the parameters used to identify the referenced Tekton * resource. Example entries might include "repo" or "path" but the set of * params ultimately depends on the chosen resolver. */ params?: Param[]; /** * Resolver is the name of the resolver that should perform resolution of the * referenced Tekton resource. */ resolver?: | "RESOLVER_NAME_UNSPECIFIED" | "BUNDLES" | "GCB_REPO" | "GIT" | "DEVELOPER_CONNECT" | "DEFAULT"; } /** * A value produced by a Pipeline. */ export interface PipelineResult { /** * Output only. Description of the result. */ readonly description?: string; /** * Output only. Name of the result. */ readonly name?: string; /** * Output only. The type of data that the result holds. */ readonly type?: | "TYPE_UNSPECIFIED" | "STRING" | "ARRAY" | "OBJECT"; /** * Output only. Value of the result. */ readonly value?: ResultValue; } /** * Message describing PipelineRun object */ export interface PipelineRun { /** * User annotations. See https://google.aip.dev/128#annotations */ annotations?: { [key: string]: string }; /** * Output only. List of TaskRun and Run names and PipelineTask names for * children of this PipelineRun. */ readonly childReferences?: ChildStatusReference[]; /** * Output only. Time the pipeline completed. */ readonly completionTime?: Date; /** * Output only. Kubernetes Conditions convention for PipelineRun status and * error. */ readonly conditions?: GoogleDevtoolsCloudbuildV2Condition[]; /** * Output only. Time at which the request to create the `PipelineRun` was * received. */ readonly createTime?: Date; /** * Needed for declarative-friendly resources. */ etag?: string; /** * Output only. FinallyStartTime is when all non-finally tasks have been * completed and only finally tasks are being executed. +optional */ readonly finallyStartTime?: Date; /** * Output only. GCB default params. */ readonly gcbParams?: { [key: string]: string }; /** * Output only. The `PipelineRun` name with format * `projects/{project}/locations/{location}/pipelineRuns/{pipeline_run}` */ readonly name?: string; /** * Params is a list of parameter names and values. */ params?: Param[]; /** * PipelineRef refer to a specific instance of a Pipeline. */ pipelineRef?: PipelineRef; /** * Pipelinerun status the user can provide. Used for cancellation. */ pipelineRunStatus?: | "PIPELINE_RUN_STATUS_UNSPECIFIED" | "PIPELINE_RUN_CANCELLED"; /** * PipelineSpec defines the desired state of Pipeline. */ pipelineSpec?: PipelineSpec; /** * Output only. Inline pipelineSpec yaml string, used by workflow run * requests. */ readonly pipelineSpecYaml?: string; /** * Optional. Provenance configuration. */ provenance?: Provenance; /** * Output only. The `Record` of this `PipelineRun`. Format: * `projects/{project}/locations/{location}/results/{result_id}/records/{record_id}` */ readonly record?: string; /** * Output only. The exact PipelineSpec used to instantiate the run. */ readonly resolvedPipelineSpec?: PipelineSpec; /** * Optional. Output only. List of results written out by the pipeline's * containers */ readonly results?: PipelineRunResult[]; /** * Optional. Security configuration. */ security?: Security; /** * Service account used in the Pipeline. Deprecated; please use * security.service_account instead. */ serviceAccount?: string; /** * Output only. List of tasks that were skipped due to when expressions * evaluating to false. */ readonly skippedTasks?: SkippedTask[]; /** * Output only. Time the pipeline is actually started. */ readonly startTime?: Date; /** * Time after which the Pipeline times out. Currently three keys are accepted * in the map pipeline, tasks and finally with Timeouts.pipeline >= * Timeouts.tasks + Timeouts.finally */ timeouts?: TimeoutFields; /** * Output only. A unique identifier for the `PipelineRun`. */ readonly uid?: string; /** * Output only. Time at which the request to update the `PipelineRun` was * received. */ readonly updateTime?: Date; /** * Optional. Worker configuration. */ worker?: Worker; /** * Output only. The WorkerPool used to run this PipelineRun. */ readonly workerPool?: string; /** * Output only. The Workflow used to create this PipelineRun. */ readonly workflow?: string; /** * Workspaces is a list of WorkspaceBindings from volumes to workspaces. */ workspaces?: WorkspaceBinding[]; } function serializePipelineRun(data: any): PipelineRun { return { ...data, pipelineSpec: data["pipelineSpec"] !== undefined ? serializePipelineSpec(data["pipelineSpec"]) : undefined, timeouts: data["timeouts"] !== undefined ? serializeTimeoutFields(data["timeouts"]) : undefined, }; } function deserializePipelineRun(data: any): PipelineRun { return { ...data, completionTime: data["completionTime"] !== undefined ? new Date(data["completionTime"]) : undefined, conditions: data["conditions"] !== undefined ? data["conditions"].map((item: any) => (deserializeGoogleDevtoolsCloudbuildV2Condition(item))) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, finallyStartTime: data["finallyStartTime"] !== undefined ? new Date(data["finallyStartTime"]) : undefined, pipelineSpec: data["pipelineSpec"] !== undefined ? deserializePipelineSpec(data["pipelineSpec"]) : undefined, resolvedPipelineSpec: data["resolvedPipelineSpec"] !== undefined ? deserializePipelineSpec(data["resolvedPipelineSpec"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, timeouts: data["timeouts"] !== undefined ? deserializeTimeoutFields(data["timeouts"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * PipelineRunResult used to describe the results of a pipeline */ export interface PipelineRunResult { /** * Output only. Name of the TaskRun */ readonly name?: string; /** * Output only. Value of the result. */ readonly value?: ResultValue; } /** * PipelineSpec defines the desired state of Pipeline. */ export interface PipelineSpec { /** * List of Tasks that execute just before leaving the Pipeline i.e. either * after all Tasks are finished executing successfully or after a failure * which would result in ending the Pipeline. */ finallyTasks?: PipelineTask[]; /** * Output only. auto-generated yaml that is output only for display purpose * for workflows using pipeline_spec, used by UI/gcloud cli for Workflows. */ readonly generatedYaml?: string; /** * List of parameters. */ params?: ParamSpec[]; /** * Optional. Output only. List of results written out by the pipeline's * containers */ readonly results?: PipelineResult[]; /** * List of Tasks that execute when this Pipeline is run. */ tasks?: PipelineTask[]; /** * Workspaces declares a set of named workspaces that are expected to be * provided by a PipelineRun. */ workspaces?: PipelineWorkspaceDeclaration[]; } function serializePipelineSpec(data: any): PipelineSpec { return { ...data, finallyTasks: data["finallyTasks"] !== undefined ? data["finallyTasks"].map((item: any) => (serializePipelineTask(item))) : undefined, tasks: data["tasks"] !== undefined ? data["tasks"].map((item: any) => (serializePipelineTask(item))) : undefined, }; } function deserializePipelineSpec(data: any): PipelineSpec { return { ...data, finallyTasks: data["finallyTasks"] !== undefined ? data["finallyTasks"].map((item: any) => (deserializePipelineTask(item))) : undefined, tasks: data["tasks"] !== undefined ? data["tasks"].map((item: any) => (deserializePipelineTask(item))) : undefined, }; } /** * PipelineTask defines a task in a Pipeline. */ export interface PipelineTask { /** * Name of the task. */ name?: string; /** * Params is a list of parameter names and values. */ params?: Param[]; /** * Retries represents how many times this task should be retried in case of * task failure. */ retries?: number; /** * RunAfter is the list of PipelineTask names that should be executed before * this Task executes. (Used to force a specific ordering in graph execution.) */ runAfter?: string[]; /** * Reference to a specific instance of a task. */ taskRef?: TaskRef; /** * Spec to instantiate this TaskRun. */ taskSpec?: EmbeddedTask; /** * Time after which the TaskRun times out. Defaults to 1 hour. Specified * TaskRun timeout should be less than 24h. */ timeout?: number /* Duration */; /** * Conditions that need to be true for the task to run. */ whenExpressions?: WhenExpression[]; /** * Workspaces maps workspaces from the pipeline spec to the workspaces * declared in the Task. */ workspaces?: WorkspacePipelineTaskBinding[]; } function serializePipelineTask(data: any): PipelineTask { return { ...data, taskSpec: data["taskSpec"] !== undefined ? serializeEmbeddedTask(data["taskSpec"]) : undefined, timeout: data["timeout"] !== undefined ? data["timeout"] : undefined, }; } function deserializePipelineTask(data: any): PipelineTask { return { ...data, taskSpec: data["taskSpec"] !== undefined ? deserializeEmbeddedTask(data["taskSpec"]) : undefined, timeout: data["timeout"] !== undefined ? data["timeout"] : undefined, }; } /** * Workspaces declares a set of named workspaces that are expected to be * provided by a PipelineRun. */ export interface PipelineWorkspaceDeclaration { /** * Description is a human readable string describing how the workspace will * be used in the Pipeline. */ description?: string; /** * Name is the name of a workspace to be provided by a PipelineRun. */ name?: string; /** * Optional marks a Workspace as not being required in PipelineRuns. By * default this field is false and so declared workspaces are required. */ optional?: boolean; } /** * An Identity and Access Management (IAM) policy, which specifies access * controls for Google Cloud resources. A `Policy` is a collection of * `bindings`. A `binding` binds one or more `members`, or principals, to a * single `role`. Principals can be user accounts, service accounts, Google * groups, and domains (such as G Suite). A `role` is a named list of * permissions; each `role` can be an IAM predefined role or a user-created * custom role. For some types of Google Cloud resources, a `binding` can also * specify a `condition`, which is a logical expression that allows access to a * resource only if the expression evaluates to `true`. A condition can add * constraints based on attributes of the request, the resource, or both. To * learn which resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). * **JSON example:** ``` { "bindings": [ { "role": * "roles/resourcemanager.organizationAdmin", "members": [ * "user:mike@example.com", "group:admins@example.com", "domain:google.com", * "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": * "roles/resourcemanager.organizationViewer", "members": [ * "user:eve@example.com" ], "condition": { "title": "expirable access", * "description": "Does not grant access after Sep 2020", "expression": * "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": * "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: * - user:mike@example.com - group:admins@example.com - domain:google.com - * serviceAccount:my-project-id@appspot.gserviceaccount.com role: * roles/resourcemanager.organizationAdmin - members: - user:eve@example.com * role: roles/resourcemanager.organizationViewer condition: title: expirable * access description: Does not grant access after Sep 2020 expression: * request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= * version: 3 ``` For a description of IAM and its features, see the [IAM * documentation](https://cloud.google.com/iam/docs/). */ export interface Policy { /** * Specifies cloud audit logging configuration for this policy. */ auditConfigs?: AuditConfig[]; /** * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. The * `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of * these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 * different roles to `user:alice@example.com`, and not to any other * principal, then you can add another 1,450 principals to the `bindings` in * the `Policy`. */ bindings?: Binding[]; /** * `etag` is used for optimistic concurrency control as a way to help prevent * simultaneous updates of a policy from overwriting each other. It is * strongly suggested that systems make use of the `etag` in the * read-modify-write cycle to perform policy updates in order to avoid race * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of * the conditions in the version `3` policy are lost. */ etag?: Uint8Array; /** * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. * Requests that specify an invalid value are rejected. Any operation that * affects conditional role bindings must specify version `3`. This * requirement applies to the following operations: * Getting a policy that * includes a conditional role binding * Adding a conditional role binding to * a policy * Changing a conditional role binding in a policy * Removing any * role binding, with or without a condition, from a policy that includes * conditions **Important:** If you use IAM Conditions, you must include the * `etag` field whenever you call `setIamPolicy`. If you omit this field, then * IAM allows you to overwrite a version `3` policy with a version `1` policy, * and all of the conditions in the version `3` policy are lost. If a policy * does not include any conditions, operations on that policy may specify any * valid version or leave the field unset. To learn which resources support * conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ version?: number; } function serializePolicy(data: any): Policy { return { ...data, etag: data["etag"] !== undefined ? encodeBase64(data["etag"]) : undefined, }; } function deserializePolicy(data: any): Policy { return { ...data, etag: data["etag"] !== undefined ? decodeBase64(data["etag"] as string) : undefined, }; } /** * Probe describes a health check to be performed against a container to * determine whether it is alive or ready to receive traffic. */ export interface Probe { /** * Optional. Exec specifies the action to take. +optional */ exec?: ExecAction; /** * Optional. How often (in seconds) to perform the probe. Default to 10 * seconds. Minimum value is 1. +optional */ periodSeconds?: number; } /** * Additional options for CloudBuild#projectsLocationsConnectionsCreate. */ export interface ProjectsLocationsConnectionsCreateOptions { /** * Required. The ID to use for the Connection, which will become the final * component of the Connection's resource name. Names must be unique * per-project per-location. Allows alphanumeric characters and any of * -._~%!$&'()*+,;=@. */ connectionId?: string; } /** * Additional options for CloudBuild#projectsLocationsConnectionsDelete. */ export interface ProjectsLocationsConnectionsDeleteOptions { /** * 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; /** * If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * CloudBuild#projectsLocationsConnectionsFetchLinkableRepositories. */ export interface ProjectsLocationsConnectionsFetchLinkableRepositoriesOptions { /** * Number of results to return in the list. Default to 20. */ pageSize?: number; /** * Page start. */ pageToken?: string; } /** * Additional options for CloudBuild#projectsLocationsConnectionsGetIamPolicy. */ export interface ProjectsLocationsConnectionsGetIamPolicyOptions { /** * Optional. The maximum policy version that will be used to format the * policy. Valid values are 0, 1, and 3. Requests specifying an invalid value * will be rejected. Requests for policies with any conditional role bindings * must specify version 3. Policies with no conditional role bindings may * specify any valid value or leave the field unset. The policy in the * response might use the policy version that you specified, or it might use a * lower policy version. For example, if you specify version 3, but the policy * has no conditional role bindings, the response uses version 1. To learn * which resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ ["options.requestedPolicyVersion"]?: number; } /** * Additional options for CloudBuild#projectsLocationsConnectionsList. */ export interface ProjectsLocationsConnectionsListOptions { /** * Number of results to return in the list. */ pageSize?: number; /** * Page start. */ pageToken?: string; } /** * Additional options for CloudBuild#projectsLocationsConnectionsPatch. */ export interface ProjectsLocationsConnectionsPatchOptions { /** * 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; /** * The current etag of the connection. If an etag is provided and does not * match the current etag of the connection, update will be blocked and an * ABORTED error will be returned. */ etag?: string; /** * The list of fields to be updated. */ updateMask?: string /* FieldMask */; } 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 * CloudBuild#projectsLocationsConnectionsProcessWebhook. */ export interface ProjectsLocationsConnectionsProcessWebhookOptions { /** * Arbitrary additional key to find the maching repository for a webhook * event if needed. */ webhookKey?: string; } /** * Additional options for * CloudBuild#projectsLocationsConnectionsRepositoriesCreate. */ export interface ProjectsLocationsConnectionsRepositoriesCreateOptions { /** * 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 * -._~%!$&'()*+,;=@. */ repositoryId?: string; } /** * Additional options for * CloudBuild#projectsLocationsConnectionsRepositoriesDelete. */ export interface ProjectsLocationsConnectionsRepositoriesDeleteOptions { /** * The current etag of the repository. If an etag is provided and does not * match the current etag of the repository, deletion will be blocked and an * ABORTED error will be returned. */ etag?: string; /** * If set, validate the request, but do not actually post it. */ validateOnly?: boolean; } /** * Additional options for * CloudBuild#projectsLocationsConnectionsRepositoriesFetchGitRefs. */ export interface ProjectsLocationsConnectionsRepositoriesFetchGitRefsOptions { /** * Optional. Number of results to return in the list. Default to 20. */ pageSize?: number; /** * Optional. Page start. */ pageToken?: string; /** * Type of refs to fetch */ refType?: | "REF_TYPE_UNSPECIFIED" | "TAG" | "BRANCH"; } /** * Additional options for * CloudBuild#projectsLocationsConnectionsRepositoriesList. */ export interface ProjectsLocationsConnectionsRepositoriesListOptions { /** * A filter expression that filters resources listed in the response. * Expressions must follow API improvement proposal * [AIP-160](https://google.aip.dev/160). e.g. * `remote_uri:"https://github.com*"`. */ filter?: string; /** * Number of results to return in the list. */ pageSize?: number; /** * Page start. */ pageToken?: string; } /** * Additional options for CloudBuild#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * 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; } /** * PropertySpec holds information about a property in an object. */ export interface PropertySpec { /** * A type for the object. */ type?: | "TYPE_UNSPECIFIED" | "STRING"; } /** * Provenance configuration. */ export interface Provenance { /** * Optional. Provenance push mode. */ enabled?: | "ENABLED_UNSPECIFIED" | "REQUIRED" | "OPTIMISTIC" | "DISABLED"; /** * Optional. Provenance region. */ region?: | "REGION_UNSPECIFIED" | "GLOBAL"; /** * Optional. Where provenance is stored. */ storage?: | "STORAGE_UNSPECIFIED" | "PREFER_ARTIFACT_PROJECT" | "ARTIFACT_PROJECT_ONLY" | "BUILD_PROJECT_ONLY"; } /** * A repository associated to a parent connection. */ export interface Repository { /** * Optional. Allows clients to store small amounts of arbitrary data. */ annotations?: { [key: string]: string }; /** * Output only. Server assigned timestamp for when the connection was * created. */ readonly createTime?: Date; /** * 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; /** * Immutable. Resource name of the repository, in the format * `projects/*\/locations/*\/connections/*\/repositories/*`. */ name?: string; /** * Required. Git Clone HTTPS URI. */ remoteUri?: string; /** * Output only. Server assigned timestamp for when the connection was * updated. */ readonly updateTime?: Date; /** * Output only. External ID of the webhook created for the repository. */ readonly webhookId?: string; } /** * ResultValue holds different types of data for a single result. */ export interface ResultValue { /** * Value of the result if type is array. */ arrayVal?: string[]; /** * Value of the result if type is object. */ objectVal?: { [key: string]: string }; /** * Value of the result if type is string. */ stringVal?: string; /** * Output only. The type of data that the result holds. */ readonly type?: | "TYPE_UNSPECIFIED" | "STRING" | "ARRAY" | "OBJECT"; } /** * Represents the custom metadata of the RunWorkflow long-running operation. */ export interface RunWorkflowCustomOperationMetadata { /** * 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. ID of the pipeline run created by RunWorkflow. */ readonly pipelineRunId?: string; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have successfully been cancelled have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly requestedCancellation?: boolean; /** * 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; } /** * Secret Volume Source. */ export interface SecretVolumeSource { /** * Name of the secret referenced by the WorkspaceBinding. */ secretName?: string; /** * Optional. Resource name of the SecretVersion. In format: * projects/*\/secrets/*\/versions/* */ secretVersion?: string; } /** * Security configuration. */ export interface Security { /** * Optional. Privilege mode. */ privilegeMode?: | "PRIVILEGE_MODE_UNSPECIFIED" | "PRIVILEGED" | "UNPRIVILEGED"; /** * IAM service account whose credentials will be used at runtime. */ serviceAccount?: string; } /** * Security options the container should be run with. */ export interface SecurityContext { /** * Optional. AllowPrivilegeEscalation controls whether a process can gain * more privileges than its parent process. This bool directly controls if the * no_new_privs flag will be set on the container process. * AllowPrivilegeEscalation is true always when the container is: 1) run as * Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when * spec.os.name is windows. +optional */ allowPrivilegeEscalation?: boolean; /** * Optional. Adds and removes POSIX capabilities from running containers. */ capabilities?: Capabilities; /** * Run container in privileged mode. */ privileged?: boolean; /** * Optional. The GID to run the entrypoint of the container process. Uses * runtime default if unset. May also be set in PodSecurityContext. If set in * both SecurityContext and PodSecurityContext, the value specified in * SecurityContext takes precedence. Note that this field cannot be set when * spec.os.name is windows. +optional */ runAsGroup?: bigint; /** * Optional. Indicates that the container must run as a non-root user. If * true, the Kubelet will validate the image at runtime to ensure that it does * not run as UID 0 (root) and fail to start the container if it does. If * unset or false, no such validation will be performed. May also be set in * PodSecurityContext. If set in both SecurityContext and PodSecurityContext, * the value specified in SecurityContext takes precedence. +optional */ runAsNonRoot?: boolean; /** * Optional. The UID to run the entrypoint of the container process. Defaults * to user specified in image metadata if unspecified. May also be set in * PodSecurityContext. If set in both SecurityContext and PodSecurityContext, * the value specified in SecurityContext takes precedence. Note that this * field cannot be set when spec.os.name is windows. +optional */ runAsUser?: bigint; } function serializeSecurityContext(data: any): SecurityContext { return { ...data, runAsGroup: data["runAsGroup"] !== undefined ? String(data["runAsGroup"]) : undefined, runAsUser: data["runAsUser"] !== undefined ? String(data["runAsUser"]) : undefined, }; } function deserializeSecurityContext(data: any): SecurityContext { return { ...data, runAsGroup: data["runAsGroup"] !== undefined ? BigInt(data["runAsGroup"]) : undefined, runAsUser: data["runAsUser"] !== undefined ? BigInt(data["runAsUser"]) : undefined, }; } /** * Request message for `SetIamPolicy` method. */ export interface SetIamPolicyRequest { /** * REQUIRED: The complete policy to be applied to the `resource`. The size of * the policy is limited to a few 10s of KB. An empty policy is a valid policy * but certain Google Cloud services (such as Projects) might reject them. */ policy?: Policy; /** * OPTIONAL: A FieldMask specifying which fields of the policy to modify. * Only the fields in the mask will be modified. If no mask is provided, the * following default mask is used: `paths: "bindings, etag"` */ updateMask?: string /* FieldMask */; } function serializeSetIamPolicyRequest(data: any): SetIamPolicyRequest { return { ...data, policy: data["policy"] !== undefined ? serializePolicy(data["policy"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeSetIamPolicyRequest(data: any): SetIamPolicyRequest { return { ...data, policy: data["policy"] !== undefined ? deserializePolicy(data["policy"]) : undefined, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Sidecars run alongside the Task's step containers. */ export interface Sidecar { /** * Arguments to the entrypoint. */ args?: string[]; /** * Entrypoint array. */ command?: string[]; /** * List of environment variables to set in the container. */ env?: EnvVar[]; /** * Docker image name. */ image?: string; /** * Name of the Sidecar. */ name?: string; /** * Optional. Periodic probe of Sidecar service readiness. Container will be * removed from service endpoints if the probe fails. Cannot be updated. More * info: * https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes * +optional */ readinessProbe?: Probe; /** * The contents of an executable file to execute. */ script?: string; /** * Optional. Security options the container should be run with. */ securityContext?: SecurityContext; /** * Pod volumes to mount into the container's filesystem. */ volumeMounts?: VolumeMount[]; /** * Container's working directory. */ workingDir?: string; } function serializeSidecar(data: any): Sidecar { return { ...data, securityContext: data["securityContext"] !== undefined ? serializeSecurityContext(data["securityContext"]) : undefined, }; } function deserializeSidecar(data: any): Sidecar { return { ...data, securityContext: data["securityContext"] !== undefined ? deserializeSecurityContext(data["securityContext"]) : undefined, }; } /** * SkippedTask is used to describe the Tasks that were skipped due to their * When Expressions evaluating to False. */ export interface SkippedTask { /** * Name is the Pipeline Task name */ name?: string; /** * Output only. Reason is the cause of the PipelineTask being skipped. */ readonly reason?: string; /** * WhenExpressions is the list of checks guarding the execution of the * PipelineTask */ whenExpressions?: WhenExpression[]; } /** * 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; } /** * Step embeds the Container type, which allows it to include fields not * provided by Container. */ export interface Step { /** * Arguments to the entrypoint. */ args?: string[]; /** * Entrypoint array. */ command?: string[]; /** * List of environment variables to set in the container. */ env?: EnvVar[]; /** * Docker image name. */ image?: string; /** * Name of the container specified as a DNS_LABEL. */ name?: string; /** * Optional. OnError defines the exiting behavior on error can be set to [ * continue | stopAndFail ] */ onError?: | "ON_ERROR_TYPE_UNSPECIFIED" | "STOP_AND_FAIL" | "CONTINUE"; /** * Optional. Optional parameters passed to the StepAction. */ params?: Param[]; /** * Optional. Optional reference to a remote StepAction. */ ref?: StepRef; /** * The contents of an executable file to execute. */ script?: string; /** * Optional. SecurityContext defines the security options the Step should be * run with. If set, the fields of SecurityContext override the equivalent * fields of PodSecurityContext. More info: * https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ * +optional */ securityContext?: SecurityContext; /** * Time after which the Step times out. Defaults to never. */ timeout?: number /* Duration */; /** * Pod volumes to mount into the container's filesystem. */ volumeMounts?: VolumeMount[]; /** * Container's working directory. */ workingDir?: string; } function serializeStep(data: any): Step { return { ...data, securityContext: data["securityContext"] !== undefined ? serializeSecurityContext(data["securityContext"]) : undefined, timeout: data["timeout"] !== undefined ? data["timeout"] : undefined, }; } function deserializeStep(data: any): Step { return { ...data, securityContext: data["securityContext"] !== undefined ? deserializeSecurityContext(data["securityContext"]) : undefined, timeout: data["timeout"] !== undefined ? data["timeout"] : undefined, }; } /** * A reference to a remote Step, i.e. a StepAction. */ export interface StepRef { /** * Optional. Name of the step. */ name?: string; /** * Optional. Parameters used to control the resolution. */ params?: Param[]; /** * Optional. Type of the resolver. */ resolver?: | "RESOLVER_NAME_UNSPECIFIED" | "BUNDLES" | "GCB_REPO" | "GIT" | "DEVELOPER_CONNECT" | "DEFAULT"; } /** * StepTemplate can be used as the basis for all step containers within the * Task, so that the steps inherit settings on the base container. */ export interface StepTemplate { /** * Optional. List of environment variables to set in the Step. Cannot be * updated. */ env?: EnvVar[]; /** * Optional. Pod volumes to mount into the container's filesystem. */ volumeMounts?: VolumeMount[]; } /** * TaskRef can be used to refer to a specific instance of a task. PipelineRef * can be used to refer to a specific instance of a Pipeline. */ export interface TaskRef { /** * Optional. Name of the task. */ name?: string; /** * Params contains the parameters used to identify the referenced Tekton * resource. Example entries might include "repo" or "path" but the set of * params ultimately depends on the chosen resolver. */ params?: Param[]; /** * Resolver is the name of the resolver that should perform resolution of the * referenced Tekton resource. */ resolver?: | "RESOLVER_NAME_UNSPECIFIED" | "BUNDLES" | "GCB_REPO" | "GIT" | "DEVELOPER_CONNECT" | "DEFAULT"; } /** * TaskResult is used to describe the results of a task. */ export interface TaskResult { /** * Description of the result. */ description?: string; /** * Name of the result. */ name?: string; /** * When type is OBJECT, this map holds the names of fields inside that object * along with the type of data each field holds. */ properties?: { [key: string]: PropertySpec }; /** * The type of data that the result holds. */ type?: | "TYPE_UNSPECIFIED" | "STRING" | "ARRAY" | "OBJECT"; /** * Optional. Optionally used to initialize a Task's result with a Step's * result. */ value?: ParamValue; } /** * TaskSpec contains the Spec to instantiate a TaskRun. */ export interface TaskSpec { /** * Description of the task. */ description?: string; /** * Sidecars that run alongside the Task’s step containers that should be * added to this Task. */ managedSidecars?: | "MANAGED_SIDECAR_UNSPECIFIED" | "PRIVILEGED_DOCKER_DAEMON"[]; /** * List of parameters. */ params?: ParamSpec[]; /** * Values that this Task can output. */ results?: TaskResult[]; /** * Sidecars that run alongside the Task's step containers. */ sidecars?: Sidecar[]; /** * Steps of the task. */ steps?: Step[]; /** * Optional. StepTemplate can be used as the basis for all step containers * within the Task, so that the steps inherit settings on the base container. */ stepTemplate?: StepTemplate; /** * A collection of volumes that are available to mount into steps. */ volumes?: VolumeSource[]; /** * The volumes that this Task requires. */ workspaces?: WorkspaceDeclaration[]; } function serializeTaskSpec(data: any): TaskSpec { return { ...data, sidecars: data["sidecars"] !== undefined ? data["sidecars"].map((item: any) => (serializeSidecar(item))) : undefined, steps: data["steps"] !== undefined ? data["steps"].map((item: any) => (serializeStep(item))) : undefined, }; } function deserializeTaskSpec(data: any): TaskSpec { return { ...data, sidecars: data["sidecars"] !== undefined ? data["sidecars"].map((item: any) => (deserializeSidecar(item))) : undefined, steps: data["steps"] !== undefined ? data["steps"].map((item: any) => (deserializeStep(item))) : undefined, }; } /** * Request message for `TestIamPermissions` method. */ export interface TestIamPermissionsRequest { /** * The set of permissions to check for the `resource`. Permissions with * wildcards (such as `*` or `storage.*`) are not allowed. For more * information see [IAM * Overview](https://cloud.google.com/iam/docs/overview#permissions). */ permissions?: string[]; } /** * Response message for `TestIamPermissions` method. */ export interface TestIamPermissionsResponse { /** * A subset of `TestPermissionsRequest.permissions` that the caller is * allowed. */ permissions?: string[]; } /** * TimeoutFields allows granular specification of pipeline, task, and finally * timeouts */ export interface TimeoutFields { /** * Finally sets the maximum allowed duration of this pipeline's finally */ finally?: number /* Duration */; /** * Pipeline sets the maximum allowed duration for execution of the entire * pipeline. The sum of individual timeouts for tasks and finally must not * exceed this value. */ pipeline?: number /* Duration */; /** * Tasks sets the maximum allowed duration of this pipeline's tasks */ tasks?: number /* Duration */; } function serializeTimeoutFields(data: any): TimeoutFields { return { ...data, finally: data["finally"] !== undefined ? data["finally"] : undefined, pipeline: data["pipeline"] !== undefined ? data["pipeline"] : undefined, tasks: data["tasks"] !== undefined ? data["tasks"] : undefined, }; } function deserializeTimeoutFields(data: any): TimeoutFields { return { ...data, finally: data["finally"] !== undefined ? data["finally"] : undefined, pipeline: data["pipeline"] !== undefined ? data["pipeline"] : undefined, tasks: data["tasks"] !== undefined ? data["tasks"] : undefined, }; } /** * Represents a personal access token that authorized the Connection, and * associated metadata. */ export interface UserCredential { /** * Output only. The username associated to this token. */ readonly username?: string; /** * Required. A SecretManager resource containing the user token that * authorizes the Cloud Build connection. Format: * `projects/*\/secrets/*\/versions/*`. */ userTokenSecretVersion?: string; } /** * Pod volumes to mount into the container's filesystem. */ export interface VolumeMount { /** * Path within the container at which the volume should be mounted. Must not * contain ':'. */ mountPath?: string; /** * Name of the volume. */ name?: string; /** * Mounted read-only if true, read-write otherwise (false or unspecified). */ readOnly?: boolean; /** * Path within the volume from which the container's volume should be * mounted. Defaults to "" (volume's root). */ subPath?: string; /** * Expanded path within the volume from which the container's volume should * be mounted. Behaves similarly to SubPath but environment variable * references $(VAR_NAME) are expanded using the container's environment. * Defaults to "" (volume's root). */ subPathExpr?: string; } /** * Volumes available to mount. */ export interface VolumeSource { /** * A temporary directory that shares a pod's lifetime. */ emptyDir?: EmptyDirVolumeSource; /** * Name of the Volume. Must be a DNS_LABEL and unique within the pod. More * info: * https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names */ name?: string; } /** * Conditions that need to be true for the task to run. */ export interface WhenExpression { /** * Operator that represents an Input's relationship to the values */ expressionOperator?: | "EXPRESSION_OPERATOR_UNSPECIFIED" | "IN" | "NOT_IN"; /** * Input is the string for guard checking which can be a static input or an * output from a parent Task. */ input?: string; /** * Values is an array of strings, which is compared against the input, for * guard checking. */ values?: string[]; } /** * Configuration for the worker. */ export interface Worker { /** * Optional. Machine type of a worker, default is "e2-standard-2". */ machineType?: string; } /** * WorkspaceBinding maps a workspace to a Volume. PipelineRef can be used to * refer to a specific instance of a Pipeline. */ export interface WorkspaceBinding { /** * Name of the workspace. */ name?: string; /** * Secret Volume Source. */ secret?: SecretVolumeSource; /** * Optional. SubPath is optionally a directory on the volume which should be * used for this binding (i.e. the volume will be mounted at this sub * directory). +optional */ subPath?: string; } /** * WorkspaceDeclaration is a declaration of a volume that a Task requires. */ export interface WorkspaceDeclaration { /** * Description is a human readable description of this volume. */ description?: string; /** * MountPath overrides the directory that the volume will be made available * at. */ mountPath?: string; /** * Name is the name by which you can bind the volume at runtime. */ name?: string; /** * Optional. Optional marks a Workspace as not being required in TaskRuns. By * default this field is false and so declared workspaces are required. */ optional?: boolean; /** * ReadOnly dictates whether a mounted volume is writable. */ readOnly?: boolean; } /** * WorkspacePipelineTaskBinding maps workspaces from the PipelineSpec to the * workspaces declared in the Task. */ export interface WorkspacePipelineTaskBinding { /** * Name of the workspace as declared by the task. */ name?: string; /** * Optional. SubPath is optionally a directory on the volume which should be * used for this binding (i.e. the volume will be mounted at this sub * directory). +optional */ subPath?: string; /** * Name of the workspace declared by the pipeline. */ workspace?: 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; }