// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Secure Source Manager API Client for Deno * ========================================= * * Regionally deployed, single-tenant managed source code repository hosted on Google Cloud. * * Docs: https://cloud.google.com/secure-source-manager * Source: https://googleapis.deno.dev/v1/securesourcemanager:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Regionally deployed, single-tenant managed source code repository hosted on * Google Cloud. */ export class SecureSourceManager { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://securesourcemanager.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Creates a new instance in a given project and location. * * @param parent Required. Value for parent. */ async projectsLocationsInstancesCreate(parent: string, req: Instance, opts: ProjectsLocationsInstancesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/instances`); if (opts.instanceId !== undefined) { url.searchParams.append("instanceId", String(opts.instanceId)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a single instance. * * @param name Required. Name of the resource. */ async projectsLocationsInstancesDelete(name: string, opts: ProjectsLocationsInstancesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } if (opts.requestId !== undefined) { url.searchParams.append("requestId", String(opts.requestId)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets details of a single instance. * * @param name Required. Name of the resource. */ async projectsLocationsInstancesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Instance; } /** * 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 projectsLocationsInstancesGetIamPolicy(resource: string, opts: ProjectsLocationsInstancesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ 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 Instances in a given project and location. * * @param parent Required. Parent value for ListInstancesRequest. */ async projectsLocationsInstancesList(parent: string, opts: ProjectsLocationsInstancesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/instances`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListInstancesResponse; } /** * 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 projectsLocationsInstancesSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v1/${ 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 projectsLocationsInstancesTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestIamPermissionsResponse; } /** * Lists information about the supported locations for this service. This * method can be called in two ways: * **List all public locations:** Use the * path `GET /v1/locations`. * **List project-visible locations:** Use the * path `GET /v1/projects/{project_id}/locations`. This may include public * locations as well as private or other locations specifically visible to the * project. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.extraLocationTypes !== undefined) { url.searchParams.append("extraLocationTypes", String(opts.extraLocationTypes)); } if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Starts asynchronous cancellation on a long-running operation. The server * makes a best effort to cancel the operation, but success is not guaranteed. * If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an * Operation.error value with a google.rpc.Status.code of `1`, corresponding * to `Code.CANCELLED`. * * @param name The name of the operation resource to be cancelled. */ async projectsLocationsOperationsCancel(name: string, req: CancelOperationRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a long-running operation. This method indicates that the client is * no longer interested in the operation result. It does not cancel the * operation. If the server doesn't support this method, it returns * `google.rpc.Code.UNIMPLEMENTED`. * * @param name The name of the operation resource to be deleted. */ async projectsLocationsOperationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Lists operations that match the specified filter in the request. If the * server doesn't support this method, it returns `UNIMPLEMENTED`. * * @param name The name of the operation's parent resource. */ async projectsLocationsOperationsList(name: string, opts: ProjectsLocationsOperationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/operations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.returnPartialSuccess !== undefined) { url.searchParams.append("returnPartialSuccess", String(opts.returnPartialSuccess)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListOperationsResponse; } /** * CreateBranchRule creates a branch rule in a given repository. * */ async projectsLocationsRepositoriesBranchRulesCreate(parent: string, req: BranchRule, opts: ProjectsLocationsRepositoriesBranchRulesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/branchRules`); if (opts.branchRuleId !== undefined) { url.searchParams.append("branchRuleId", String(opts.branchRuleId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * DeleteBranchRule deletes a branch rule. * */ async projectsLocationsRepositoriesBranchRulesDelete(name: string, opts: ProjectsLocationsRepositoriesBranchRulesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * GetBranchRule gets a branch rule. * * @param name Required. Name of the repository to retrieve. The format is `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. */ async projectsLocationsRepositoriesBranchRulesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as BranchRule; } /** * ListBranchRules lists branch rules in a given repository. * */ async projectsLocationsRepositoriesBranchRulesList(parent: string, opts: ProjectsLocationsRepositoriesBranchRulesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/branchRules`); 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 ListBranchRulesResponse; } /** * UpdateBranchRule updates a branch rule. * * @param name Identifier. A unique identifier for a BranchRule. The name should be of the format: `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` */ async projectsLocationsRepositoriesBranchRulesPatch(name: string, req: BranchRule, opts: ProjectsLocationsRepositoriesBranchRulesPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesBranchRulesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Creates a new repository in a given project and location. The * Repository.Instance field is required in the request body for requests * using the securesourcemanager.googleapis.com endpoint. * * @param parent Required. The project in which to create the repository. Values are of the form `projects/{project_number}/locations/{location_id}` */ async projectsLocationsRepositoriesCreate(parent: string, req: Repository, opts: ProjectsLocationsRepositoriesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ 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 Repository. * * @param name Required. Name of the repository to delete. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. */ async projectsLocationsRepositoriesDelete(name: string, opts: ProjectsLocationsRepositoriesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.allowMissing !== undefined) { url.searchParams.append("allowMissing", String(opts.allowMissing)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Fetches a blob from a repository. * * @param repository Required. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. Specifies the repository containing the blob. */ async projectsLocationsRepositoriesFetchBlob(repository: string, opts: ProjectsLocationsRepositoriesFetchBlobOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ repository }:fetchBlob`); if (opts.sha !== undefined) { url.searchParams.append("sha", String(opts.sha)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchBlobResponse; } /** * Fetches a tree from a repository. * * @param repository Required. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. Specifies the repository to fetch the tree from. */ async projectsLocationsRepositoriesFetchTree(repository: string, opts: ProjectsLocationsRepositoriesFetchTreeOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ repository }:fetchTree`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.recursive !== undefined) { url.searchParams.append("recursive", String(opts.recursive)); } if (opts.ref !== undefined) { url.searchParams.append("ref", String(opts.ref)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchTreeResponse; } /** * Gets metadata of a repository. * * @param name Required. Name of the repository to retrieve. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. */ async projectsLocationsRepositoriesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Repository; } /** * Get IAM policy for a repository. * * @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 projectsLocationsRepositoriesGetIamPolicy(resource: string, opts: ProjectsLocationsRepositoriesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ 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); } /** * Creates a new hook in a given repository. * * @param parent Required. The repository in which to create the hook. Values are of the form `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` */ async projectsLocationsRepositoriesHooksCreate(parent: string, req: Hook, opts: ProjectsLocationsRepositoriesHooksCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/hooks`); if (opts.hookId !== undefined) { url.searchParams.append("hookId", String(opts.hookId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a Hook. * * @param name Required. Name of the hook to delete. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. */ async projectsLocationsRepositoriesHooksDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets metadata of a hook. * * @param name Required. Name of the hook to retrieve. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. */ async projectsLocationsRepositoriesHooksGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Hook; } /** * Lists hooks in a given repository. * * @param parent Required. Parent value for ListHooksRequest. */ async projectsLocationsRepositoriesHooksList(parent: string, opts: ProjectsLocationsRepositoriesHooksListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/hooks`); 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 ListHooksResponse; } /** * Updates the metadata of a hook. * * @param name Identifier. A unique identifier for a Hook. The name should be of the format: `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}` */ async projectsLocationsRepositoriesHooksPatch(name: string, req: Hook, opts: ProjectsLocationsRepositoriesHooksPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesHooksPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); 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; } /** * Closes an issue. * * @param name Required. Name of the issue to close. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. */ async projectsLocationsRepositoriesIssuesClose(name: string, req: CloseIssueRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:close`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Creates an issue. * * @param parent Required. The repository in which to create the issue. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` */ async projectsLocationsRepositoriesIssuesCreate(parent: string, req: Issue): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/issues`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes an issue. * * @param name Required. Name of the issue to delete. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. */ async projectsLocationsRepositoriesIssuesDelete(name: string, opts: ProjectsLocationsRepositoriesIssuesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.etag !== undefined) { url.searchParams.append("etag", String(opts.etag)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets an issue. * * @param name Required. Name of the issue to retrieve. The format is `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. */ async projectsLocationsRepositoriesIssuesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Issue; } /** * Creates an issue comment. * * @param parent Required. The issue in which to create the issue comment. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` */ async projectsLocationsRepositoriesIssuesIssueCommentsCreate(parent: string, req: IssueComment): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/issueComments`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes an issue comment. * * @param name Required. Name of the issue comment to delete. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. */ async projectsLocationsRepositoriesIssuesIssueCommentsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets an issue comment. * * @param name Required. Name of the issue comment to retrieve. The format is `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. */ async projectsLocationsRepositoriesIssuesIssueCommentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as IssueComment; } /** * Lists comments in an issue. * * @param parent Required. The issue in which to list the comments. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}` */ async projectsLocationsRepositoriesIssuesIssueCommentsList(parent: string, opts: ProjectsLocationsRepositoriesIssuesIssueCommentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/issueComments`); 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 ListIssueCommentsResponse; } /** * Updates an issue comment. * * @param name Identifier. Unique identifier for an issue comment. The comment id is generated by the server. Format: `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}` */ async projectsLocationsRepositoriesIssuesIssueCommentsPatch(name: string, req: IssueComment, opts: ProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); 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; } /** * Lists issues in a repository. * * @param parent Required. The repository in which to list issues. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` */ async projectsLocationsRepositoriesIssuesList(parent: string, opts: ProjectsLocationsRepositoriesIssuesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/issues`); 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 ListIssuesResponse; } /** * Opens an issue. * * @param name Required. Name of the issue to open. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. */ async projectsLocationsRepositoriesIssuesOpen(name: string, req: OpenIssueRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:open`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Updates a issue. * * @param name Identifier. Unique identifier for an issue. The issue id is generated by the server. Format: `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}` */ async projectsLocationsRepositoriesIssuesPatch(name: string, req: Issue, opts: ProjectsLocationsRepositoriesIssuesPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesIssuesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); 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; } /** * Lists Repositories in a given project and location. The instance field is * required in the query parameter for requests using the * securesourcemanager.googleapis.com endpoint. * * @param parent Required. Parent value for ListRepositoriesRequest. */ async projectsLocationsRepositoriesList(parent: string, opts: ProjectsLocationsRepositoriesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/repositories`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.instance !== undefined) { url.searchParams.append("instance", String(opts.instance)); } 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; } /** * Updates the metadata of a repository. * * @param name Identifier. A unique identifier for a repository. The name should be of the format: `projects/{project}/locations/{location_id}/repositories/{repository_id}` */ async projectsLocationsRepositoriesPatch(name: string, req: Repository, opts: ProjectsLocationsRepositoriesPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } if (opts.validateOnly !== undefined) { url.searchParams.append("validateOnly", String(opts.validateOnly)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Operation; } /** * Closes a pull request without merging. * * @param name Required. The pull request to close. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsClose(name: string, req: ClosePullRequestRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:close`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Creates a pull request. * * @param parent Required. The repository that the pull request is created from. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` */ async projectsLocationsRepositoriesPullRequestsCreate(parent: string, req: PullRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequests`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Gets a pull request. * * @param name Required. Name of the pull request to retrieve. The format is `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. */ async projectsLocationsRepositoriesPullRequestsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as PullRequest; } /** * Lists pull requests in a repository. * * @param parent Required. The repository in which to list pull requests. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}` */ async projectsLocationsRepositoriesPullRequestsList(parent: string, opts: ProjectsLocationsRepositoriesPullRequestsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequests`); 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 ListPullRequestsResponse; } /** * Lists a pull request's file diffs. * * @param name Required. The pull request to list file diffs for. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsListFileDiffs(name: string, opts: ProjectsLocationsRepositoriesPullRequestsListFileDiffsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:listFileDiffs`); 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 ListPullRequestFileDiffsResponse; } /** * Merges a pull request. * * @param name Required. The pull request to merge. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsMerge(name: string, req: MergePullRequestRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:merge`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Opens a pull request. * * @param name Required. The pull request to open. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsOpen(name: string, req: OpenPullRequestRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:open`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Updates a pull request. * * @param name Output only. Identifier. A unique identifier for a PullRequest. The number appended at the end is generated by the server. Format: `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsPatch(name: string, req: PullRequest, opts: ProjectsLocationsRepositoriesPullRequestsPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesPullRequestsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); 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; } /** * Batch creates pull request comments. This function is used to create * multiple PullRequestComments for code review. There needs to be exactly one * PullRequestComment of type Review, and at most 100 PullRequestComments of * type Code per request. The Position of the code comments must be unique * within the request. * * @param parent Required. The pull request in which to create the pull request comments. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsBatchCreate(parent: string, req: BatchCreatePullRequestCommentsRequest): Promise { req = serializeBatchCreatePullRequestCommentsRequest(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequestComments:batchCreate`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Creates a pull request comment. This function is used to create a single * PullRequestComment of type Comment, or a single PullRequestComment of type * Code that's replying to another PullRequestComment of type Code. Use * BatchCreatePullRequestComments to create multiple PullRequestComments for * code reviews. * * @param parent Required. The pull request in which to create the pull request comment. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsCreate(parent: string, req: PullRequestComment): Promise { req = serializePullRequestComment(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequestComments`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a pull request comment. * * @param name Required. Name of the pull request comment to delete. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets a pull request comment. * * @param name Required. Name of the pull request comment to retrieve. The format is `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePullRequestComment(data); } /** * Lists pull request comments. * * @param parent Required. The pull request in which to list pull request comments. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsList(parent: string, opts: ProjectsLocationsRepositoriesPullRequestsPullRequestCommentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequestComments`); 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 deserializeListPullRequestCommentsResponse(data); } /** * Updates a pull request comment. * * @param name Identifier. Unique identifier for the pull request comment. The comment id is generated by the server. Format: `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}` */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsPatch(name: string, req: PullRequestComment, opts: ProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions = {}): Promise { req = serializePullRequestComment(req); opts = serializeProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); 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; } /** * Resolves pull request comments. A list of PullRequestComment names must be * provided. The PullRequestComment names must be in the same conversation * thread. If auto_fill is set, all comments in the conversation thread will * be resolved. * * @param parent Required. The pull request in which to resolve the pull request comments. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsResolve(parent: string, req: ResolvePullRequestCommentsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequestComments:resolve`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Unresolves pull request comments. A list of PullRequestComment names must * be provided. The PullRequestComment names must be in the same conversation * thread. If auto_fill is set, all comments in the conversation thread will * be unresolved. * * @param parent Required. The pull request in which to resolve the pull request comments. Format: `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ async projectsLocationsRepositoriesPullRequestsPullRequestCommentsUnresolve(parent: string, req: UnresolvePullRequestCommentsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/pullRequestComments:unresolve`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Set IAM policy on a repository. * * @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 projectsLocationsRepositoriesSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v1/${ resource }:setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Test IAM permissions on a repository. IAM permission checks are not * required on this method. * * @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 projectsLocationsRepositoriesTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestIamPermissionsResponse; } } /** * 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"; } /** * The request to batch create pull request comments. */ export interface BatchCreatePullRequestCommentsRequest { /** * Required. The request message specifying the resources to create. There * should be exactly one CreatePullRequestCommentRequest with CommentDetail * being REVIEW in the list, and no more than 100 * CreatePullRequestCommentRequests with CommentDetail being CODE in the list */ requests?: CreatePullRequestCommentRequest[]; } function serializeBatchCreatePullRequestCommentsRequest(data: any): BatchCreatePullRequestCommentsRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (serializeCreatePullRequestCommentRequest(item))) : undefined, }; } function deserializeBatchCreatePullRequestCommentsRequest(data: any): BatchCreatePullRequestCommentsRequest { return { ...data, requests: data["requests"] !== undefined ? data["requests"].map((item: any) => (deserializeCreatePullRequestCommentRequest(item))) : undefined, }; } /** * The response to batch create pull request comments. */ export interface BatchCreatePullRequestCommentsResponse { /** * The list of pull request comments created. */ pullRequestComments?: PullRequestComment[]; } function serializeBatchCreatePullRequestCommentsResponse(data: any): BatchCreatePullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (serializePullRequestComment(item))) : undefined, }; } function deserializeBatchCreatePullRequestCommentsResponse(data: any): BatchCreatePullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (deserializePullRequestComment(item))) : undefined, }; } /** * 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; } /** * Branch represents a branch involved in a pull request. */ export interface Branch { /** * Required. Name of the branch. */ ref?: string; /** * Output only. The commit at the tip of the branch. */ readonly sha?: string; } /** * Metadata of a BranchRule. BranchRule is the protection rule to enforce * pre-defined rules on designated branches within a repository. */ export interface BranchRule { /** * Optional. Determines if allow stale reviews or approvals before merging to * the branch. */ allowStaleReviews?: boolean; /** * Optional. User annotations. These attributes can only be set and used by * the user. See https://google.aip.dev/128#annotations for more details such * as format and size limitations. */ annotations?: { [key: string]: string }; /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Optional. Determines if the branch rule is disabled or not. */ disabled?: boolean; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ etag?: string; /** * Optional. The pattern of the branch that can match to this BranchRule. * Specified as regex. .* for all branches. Examples: main, (main|release.*). * Current MVP phase only support `.*` for wildcard. */ includePattern?: string; /** * Optional. The minimum number of approvals required for the branch rule to * be matched. */ minimumApprovalsCount?: number; /** * Optional. The minimum number of reviews required for the branch rule to be * matched. */ minimumReviewsCount?: number; /** * Identifier. A unique identifier for a BranchRule. The name should be of * the format: * `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}` */ name?: string; /** * Optional. Determines if require comments resolved before merging to the * branch. */ requireCommentsResolved?: boolean; /** * Optional. List of required status checks before merging to the branch. */ requiredStatusChecks?: Check[]; /** * Optional. Determines if require linear history before merging to the * branch. */ requireLinearHistory?: boolean; /** * Optional. Determines if the branch rule requires a pull request or not. */ requirePullRequest?: boolean; /** * Output only. Unique identifier of the repository. */ readonly uid?: string; /** * Output only. Update timestamp. */ readonly updateTime?: Date; } /** * The request message for Operations.CancelOperation. */ export interface CancelOperationRequest { } /** * Check is a type for status check. */ export interface Check { /** * Required. The context of the check. */ context?: string; } /** * The request to close an issue. */ export interface CloseIssueRequest { /** * Optional. The current etag of the issue. If the etag is provided and does * not match the current etag of the issue, closing will be blocked and an * ABORTED error will be returned. */ etag?: string; } /** * ClosePullRequestRequest is the request to close a pull request. */ export interface ClosePullRequestRequest { } /** * The comment on a code line. */ export interface Code { /** * Required. The comment body. */ body?: string; /** * Output only. The effective commit sha this code comment is pointing to. */ readonly effectiveCommitSha?: string; /** * Output only. The root comment of the conversation, derived from the reply * field. */ readonly effectiveRootComment?: string; /** * Optional. The position of the comment. */ position?: Position; /** * Optional. Input only. The PullRequestComment resource name that this * comment is replying to. */ reply?: string; /** * Output only. Boolean indicator if the comment is resolved. */ readonly resolved?: boolean; } function serializeCode(data: any): Code { return { ...data, position: data["position"] !== undefined ? serializePosition(data["position"]) : undefined, }; } function deserializeCode(data: any): Code { return { ...data, position: data["position"] !== undefined ? deserializePosition(data["position"]) : undefined, }; } /** * The general pull request comment. */ export interface Comment { /** * Required. The comment body. */ body?: string; } /** * The request to create a pull request comment. */ export interface CreatePullRequestCommentRequest { /** * Required. The pull request in which to create the pull request comment. * Format: * `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}` */ parent?: string; /** * Required. The pull request comment to create. */ pullRequestComment?: PullRequestComment; } function serializeCreatePullRequestCommentRequest(data: any): CreatePullRequestCommentRequest { return { ...data, pullRequestComment: data["pullRequestComment"] !== undefined ? serializePullRequestComment(data["pullRequestComment"]) : undefined, }; } function deserializeCreatePullRequestCommentRequest(data: any): CreatePullRequestCommentRequest { return { ...data, pullRequestComment: data["pullRequestComment"] !== undefined ? deserializePullRequestComment(data["pullRequestComment"]) : undefined, }; } /** * Custom host config for the instance. */ export interface CustomHostConfig { /** * Required. The custom API hostname for the instance, e.g., * "api.source.internal.mycompany.com" */ api?: string; /** * Required. The custom git http hostname for the instance, e.g., * "git.source.internal.mycompany.com" */ gitHttp?: string; /** * Required. The custom git ssh hostname for the instance, e.g., * "ssh.source.internal.mycompany.com" */ gitSsh?: string; /** * Required. The custom UI hostname for the instance, e.g., * "git.source.internal.mycompany.com" */ html?: string; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * 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 message containing the content of a blob. */ export interface FetchBlobResponse { /** * The content of the blob, encoded as base64. */ content?: string; /** * The SHA-1 hash of the blob. */ sha?: string; } /** * Response message containing a list of TreeEntry objects. */ export interface FetchTreeResponse { /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * The list of TreeEntry objects. */ treeEntries?: TreeEntry[]; } /** * Metadata of a FileDiff. FileDiff represents a single file diff in a pull * request. */ export interface FileDiff { /** * Output only. The action taken on the file (eg. added, modified, deleted). */ readonly action?: | "ACTION_UNSPECIFIED" | "ADDED" | "MODIFIED" | "DELETED"; /** * Output only. The name of the file. */ readonly name?: string; /** * Output only. The git patch containing the file changes. */ readonly patch?: string; /** * Output only. The commit pointing to the file changes. */ readonly sha?: string; } /** * Metadata of a Secure Source Manager Hook. */ export interface Hook { /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Optional. Determines if the hook disabled or not. Set to true to stop * sending traffic. */ disabled?: boolean; /** * Optional. The events that trigger hook on. */ events?: | "UNSPECIFIED" | "PUSH" | "PULL_REQUEST"[]; /** * Identifier. A unique identifier for a Hook. The name should be of the * format: * `projects/{project}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}` */ name?: string; /** * Optional. The trigger option for push events. */ pushOption?: PushOption; /** * Optional. The sensitive query string to be appended to the target URI. */ sensitiveQueryString?: string; /** * Required. The target URI to which the payloads will be delivered. */ targetUri?: string; /** * Output only. Unique identifier of the hook. */ readonly uid?: string; /** * Output only. Update timestamp. */ readonly updateTime?: Date; } /** * HostConfig has different instance endpoints. */ export interface HostConfig { /** * Output only. API hostname. */ readonly api?: string; /** * Output only. Git HTTP hostname. */ readonly gitHttp?: string; /** * Output only. Git SSH hostname. */ readonly gitSsh?: string; /** * Output only. HTML hostname. */ readonly html?: string; } /** * Repository initialization configuration. */ export interface InitialConfig { /** * Default branch name of the repository. */ defaultBranch?: string; /** * List of gitignore template names user can choose from. Valid values: * actionscript, ada, agda, android, anjuta, ansible, appcelerator-titanium, * app-engine, archives, arch-linux-packages, atmel-studio, autotools, backup, * bazaar, bazel, bitrix, bricx-cc, c, cake-php, calabash, cf-wheels, * chef-cookbook, clojure, cloud9, c-make, code-igniter, code-kit, * code-sniffer, common-lisp, composer, concrete5, coq, cordova, cpp, * craft-cms, cuda, cvs, d, dart, dart-editor, delphi, diff, dm, dreamweaver, * dropbox, drupal, drupal-7, eagle, eclipse, eiffel-studio, elisp, elixir, * elm, emacs, ensime, epi-server, erlang, esp-idf, espresso, exercism, * expression-engine, ext-js, fancy, finale, flex-builder, force-dot-com, * fortran, fuel-php, gcov, git-book, gnome-shell-extension, go, godot, gpg, * gradle, grails, gwt, haskell, hugo, iar-ewarm, idris, igor-pro, images, * infor-cms, java, jboss, jboss-4, jboss-6, jdeveloper, jekyll, jenkins-home, * jenv, jet-brains, jigsaw, joomla, julia, jupyter-notebooks, kate, * kdevelop4, kentico, ki-cad, kohana, kotlin, lab-view, laravel, lazarus, * leiningen, lemon-stand, libre-office, lilypond, linux, lithium, logtalk, * lua, lyx, mac-os, magento, magento-1, magento-2, matlab, maven, mercurial, * mercury, metals, meta-programming-system, meteor, microsoft-office, * model-sim, momentics, mono-develop, nanoc, net-beans, nikola, nim, ninja, * node, notepad-pp, nwjs, objective--c, ocaml, octave, opa, open-cart, * openssl, oracle-forms, otto, packer, patch, perl, perl6, phalcon, phoenix, * pimcore, play-framework, plone, prestashop, processing, psoc-creator, * puppet, pure-script, putty, python, qooxdoo, qt, r, racket, rails, raku, * red, redcar, redis, rhodes-rhomobile, ros, ruby, rust, sam, sass, sbt, * scala, scheme, scons, scrivener, sdcc, seam-gen, sketch-up, slick-edit, * smalltalk, snap, splunk, stata, stella, sublime-text, sugar-crm, svn, * swift, symfony, symphony-cms, synopsys-vcs, tags, terraform, tex, * text-mate, textpattern, think-php, tortoise-git, turbo-gears-2, typo3, * umbraco, unity, unreal-engine, vagrant, vim, virtual-env, virtuoso, * visual-studio, visual-studio-code, vue, vvvv, waf, web-methods, windows, * word-press, xcode, xilinx, xilinx-ise, xojo, yeoman, yii, zend-framework, * zephir. */ gitignores?: string[]; /** * License template name user can choose from. Valid values: license-0bsd, * license-389-exception, aal, abstyles, adobe-2006, adobe-glyph, adsl, * afl-1-1, afl-1-2, afl-2-0, afl-2-1, afl-3-0, afmparse, agpl-1-0, * agpl-1-0-only, agpl-1-0-or-later, agpl-3-0-only, agpl-3-0-or-later, * aladdin, amdplpa, aml, ampas, antlr-pd, antlr-pd-fallback, apache-1-0, * apache-1-1, apache-2-0, apafml, apl-1-0, apsl-1-0, apsl-1-1, apsl-1-2, * apsl-2-0, artistic-1-0, artistic-1-0-cl8, artistic-1-0-perl, artistic-2-0, * autoconf-exception-2-0, autoconf-exception-3-0, bahyph, barr, beerware, * bison-exception-2-2, bittorrent-1-0, bittorrent-1-1, blessing, * blueoak-1-0-0, bootloader-exception, borceux, bsd-1-clause, bsd-2-clause, * bsd-2-clause-freebsd, bsd-2-clause-netbsd, bsd-2-clause-patent, * bsd-2-clause-views, bsd-3-clause, bsd-3-clause-attribution, * bsd-3-clause-clear, bsd-3-clause-lbnl, bsd-3-clause-modification, * bsd-3-clause-no-nuclear-license, bsd-3-clause-no-nuclear-license-2014, * bsd-3-clause-no-nuclear-warranty, bsd-3-clause-open-mpi, bsd-4-clause, * bsd-4-clause-shortened, bsd-4-clause-uc, bsd-protection, bsd-source-code, * bsl-1-0, busl-1-1, cal-1-0, cal-1-0-combined-work-exception, caldera, * catosl-1-1, cc0-1-0, cc-by-1-0, cc-by-2-0, cc-by-3-0, cc-by-3-0-at, * cc-by-3-0-us, cc-by-4-0, cc-by-nc-1-0, cc-by-nc-2-0, cc-by-nc-3-0, * cc-by-nc-4-0, cc-by-nc-nd-1-0, cc-by-nc-nd-2-0, cc-by-nc-nd-3-0, * cc-by-nc-nd-3-0-igo, cc-by-nc-nd-4-0, cc-by-nc-sa-1-0, cc-by-nc-sa-2-0, * cc-by-nc-sa-3-0, cc-by-nc-sa-4-0, cc-by-nd-1-0, cc-by-nd-2-0, cc-by-nd-3-0, * cc-by-nd-4-0, cc-by-sa-1-0, cc-by-sa-2-0, cc-by-sa-2-0-uk, cc-by-sa-2-1-jp, * cc-by-sa-3-0, cc-by-sa-3-0-at, cc-by-sa-4-0, cc-pddc, cddl-1-0, cddl-1-1, * cdla-permissive-1-0, cdla-sharing-1-0, cecill-1-0, cecill-1-1, cecill-2-0, * cecill-2-1, cecill-b, cecill-c, cern-ohl-1-1, cern-ohl-1-2, cern-ohl-p-2-0, * cern-ohl-s-2-0, cern-ohl-w-2-0, clartistic, classpath-exception-2-0, * clisp-exception-2-0, cnri-jython, cnri-python, cnri-python-gpl-compatible, * condor-1-1, copyleft-next-0-3-0, copyleft-next-0-3-1, cpal-1-0, cpl-1-0, * cpol-1-02, crossword, crystal-stacker, cua-opl-1-0, cube, c-uda-1-0, curl, * d-fsl-1-0, diffmark, digirule-foss-exception, doc, dotseqn, drl-1-0, dsdp, * dvipdfm, ecl-1-0, ecl-2-0, ecos-exception-2-0, efl-1-0, efl-2-0, egenix, * entessa, epics, epl-1-0, epl-2-0, erlpl-1-1, etalab-2-0, eu-datagrid, * eupl-1-0, eupl-1-1, eupl-1-2, eurosym, fair, fawkes-runtime-exception, * fltk-exception, font-exception-2-0, frameworx-1-0, freebsd-doc, freeimage, * freertos-exception-2-0, fsfap, fsful, fsfullr, ftl, gcc-exception-2-0, * gcc-exception-3-1, gd, gfdl-1-1-invariants-only, * gfdl-1-1-invariants-or-later, gfdl-1-1-no-invariants-only, * gfdl-1-1-no-invariants-or-later, gfdl-1-1-only, gfdl-1-1-or-later, * gfdl-1-2-invariants-only, gfdl-1-2-invariants-or-later, * gfdl-1-2-no-invariants-only, gfdl-1-2-no-invariants-or-later, * gfdl-1-2-only, gfdl-1-2-or-later, gfdl-1-3-invariants-only, * gfdl-1-3-invariants-or-later, gfdl-1-3-no-invariants-only, * gfdl-1-3-no-invariants-or-later, gfdl-1-3-only, gfdl-1-3-or-later, * giftware, gl2ps, glide, glulxe, glwtpl, gnu-javamail-exception, gnuplot, * gpl-1-0-only, gpl-1-0-or-later, gpl-2-0-only, gpl-2-0-or-later, * gpl-3-0-linking-exception, gpl-3-0-linking-source-exception, gpl-3-0-only, * gpl-3-0-or-later, gpl-cc-1-0, gsoap-1-3b, haskell-report, hippocratic-2-1, * hpnd, hpnd-sell-variant, htmltidy, i2p-gpl-java-exception, ibm-pibs, icu, * ijg, image-magick, imatix, imlib2, info-zip, intel, intel-acpi, * interbase-1-0, ipa, ipl-1-0, isc, jasper-2-0, jpnic, json, lal-1-2, * lal-1-3, latex2e, leptonica, lgpl-2-0-only, lgpl-2-0-or-later, * lgpl-2-1-only, lgpl-2-1-or-later, lgpl-3-0-linking-exception, * lgpl-3-0-only, lgpl-3-0-or-later, lgpllr, libpng, libpng-2-0, * libselinux-1-0, libtiff, libtool-exception, liliq-p-1-1, liliq-r-1-1, * liliq-rplus-1-1, linux-openib, linux-syscall-note, llvm-exception, lpl-1-0, * lpl-1-02, lppl-1-0, lppl-1-1, lppl-1-2, lppl-1-3a, lppl-1-3c, * lzma-exception, make-index, mif-exception, miros, mit, mit-0, * mit-advertising, mit-cmu, mit-enna, mit-feh, mit-modern-variant, mitnfa, * mit-open-group, motosoto, mpich2, mpl-1-0, mpl-1-1, mpl-2-0, * mpl-2-0-no-copyleft-exception, ms-pl, ms-rl, mtll, mulanpsl-1-0, * mulanpsl-2-0, multics, mup, naist-2003, nasa-1-3, naumen, nbpl-1-0, * ncgl-uk-2-0, ncsa, netcdf, net-snmp, newsletr, ngpl, nist-pd, * nist-pd-fallback, nlod-1-0, nlpl, nokia, nokia-qt-exception-1-1, nosl, * noweb, npl-1-0, npl-1-1, nposl-3-0, nrl, ntp, ntp-0, * ocaml-lgpl-linking-exception, occt-exception-1-0, occt-pl, oclc-2-0, * odbl-1-0, odc-by-1-0, ofl-1-0, ofl-1-0-no-rfn, ofl-1-0-rfn, ofl-1-1, * ofl-1-1-no-rfn, ofl-1-1-rfn, ogc-1-0, ogdl-taiwan-1-0, ogl-canada-2-0, * ogl-uk-1-0, ogl-uk-2-0, ogl-uk-3-0, ogtsl, oldap-1-1, oldap-1-2, oldap-1-3, * oldap-1-4, oldap-2-0, oldap-2-0-1, oldap-2-1, oldap-2-2, oldap-2-2-1, * oldap-2-2-2, oldap-2-3, oldap-2-4, oldap-2-7, oml, * openjdk-assembly-exception-1-0, openssl, openvpn-openssl-exception, * opl-1-0, oset-pl-2-1, osl-1-0, osl-1-1, osl-2-0, osl-2-1, osl-3-0, * o-uda-1-0, parity-6-0-0, parity-7-0-0, pddl-1-0, php-3-0, php-3-01, plexus, * polyform-noncommercial-1-0-0, polyform-small-business-1-0-0, postgresql, * psf-2-0, psfrag, ps-or-pdf-font-exception-20170817, psutils, python-2-0, * qhull, qpl-1-0, qt-gpl-exception-1-0, qt-lgpl-exception-1-1, * qwt-exception-1-0, rdisc, rhecos-1-1, rpl-1-1, rpsl-1-0, rsa-md, rscpl, * ruby, saxpath, sax-pd, scea, sendmail, sendmail-8-23, sgi-b-1-0, sgi-b-1-1, * sgi-b-2-0, shl-0-51, shl-2-0, shl-2-1, simpl-2-0, sissl, sissl-1-2, * sleepycat, smlnj, smppl, snia, spencer-86, spencer-94, spencer-99, spl-1-0, * ssh-openssh, ssh-short, sspl-1-0, sugarcrm-1-1-3, swift-exception, swl, * tapr-ohl-1-0, tcl, tcp-wrappers, tmate, torque-1-1, tosl, tu-berlin-1-0, * tu-berlin-2-0, u-boot-exception-2-0, ucl-1-0, unicode-dfs-2015, * unicode-dfs-2016, unicode-tou, universal-foss-exception-1-0, unlicense, * upl-1-0, vim, vostrom, vsl-1-0, w3c, w3c-19980720, w3c-20150513, * watcom-1-0, wsuipa, wtfpl, wxwindows-exception-3-1, x11, xerox, * xfree86-1-1, xinetd, xnet, xpp, xskat, ypl-1-0, ypl-1-1, zed, zend-2-0, * zimbra-1-3, zimbra-1-4, zlib, zlib-acknowledgement, zpl-1-1, zpl-2-0, * zpl-2-1. */ license?: string; /** * README template name. Valid template name(s) are: default. */ readme?: string; } /** * A resource that represents a Secure Source Manager instance. */ export interface Instance { /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Output only. A list of hostnames for this instance. */ readonly hostConfig?: HostConfig; /** * Optional. Immutable. Customer-managed encryption key name, in the format * projects/*\/locations/*\/keyRings/*\/cryptoKeys/*. */ kmsKey?: string; /** * Optional. Labels as key value pairs. Keys and values can contain only * lowercase letters, numeric characters, underscores, and dashes. For more * information, see [Requirements for * labels](https://cloud.google.com/resource-manager/docs/best-practices-labels#label_encoding). */ labels?: { [key: string]: string }; /** * Identifier. A unique identifier for an instance. The name should be of the * format: * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * `project_number`: Maps to a unique int64 id assigned to each project. * `location_id`: Refers to the region where the instance will be deployed. * Since Secure Source Manager is a regional service, it must be one of the * valid GCP regions. `instance_id`: User provided name for the instance, must * be unique for a project_number and location_id combination. */ name?: string; /** * Optional. Private settings for private instance. */ privateConfig?: PrivateConfig; /** * Output only. Current state of the instance. */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "ACTIVE" | "DELETING" | "PAUSED" | "UNKNOWN"; /** * Output only. An optional field providing information about the current * instance state. */ readonly stateNote?: | "STATE_NOTE_UNSPECIFIED" | "PAUSED_CMEK_UNAVAILABLE" | "INSTANCE_RESUMING"; /** * Output only. Update timestamp. */ readonly updateTime?: Date; /** * Optional. Configuration for Workforce Identity Federation to support third * party identity provider. If unset, defaults to the Google OIDC IdP. */ workforceIdentityFederationConfig?: WorkforceIdentityFederationConfig; } /** * Metadata of an Issue. */ export interface Issue { /** * Optional. Issue body. Provides a detailed description of the issue. */ body?: string; /** * Output only. Close timestamp (if closed). Cleared when is re-opened. */ readonly closeTime?: Date; /** * Output only. Creation timestamp. */ readonly createTime?: Date; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ etag?: string; /** * Identifier. Unique identifier for an issue. The issue id is generated by * the server. Format: * `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}` */ name?: string; /** * Output only. State of the issue. */ readonly state?: | "STATE_UNSPECIFIED" | "OPEN" | "CLOSED"; /** * Required. Issue title. */ title?: string; /** * Output only. Last updated timestamp. */ readonly updateTime?: Date; } /** * IssueComment represents a comment on an issue. */ export interface IssueComment { /** * Required. The comment body. */ body?: string; /** * Output only. Creation timestamp. */ readonly createTime?: Date; /** * Identifier. Unique identifier for an issue comment. The comment id is * generated by the server. Format: * `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment_id}` */ name?: string; /** * Output only. Last updated timestamp. */ readonly updateTime?: Date; } /** * ListBranchRulesResponse is the response to listing branchRules. */ export interface ListBranchRulesResponse { /** * The list of branch rules. */ branchRules?: BranchRule[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; } /** * ListHooksResponse is response to list hooks. */ export interface ListHooksResponse { /** * The list of hooks. */ hooks?: Hook[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; } export interface ListInstancesResponse { /** * The list of instances. */ instances?: Instance[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * Locations that could not be reached. */ unreachable?: string[]; } /** * The response to list issue comments. */ export interface ListIssueCommentsResponse { /** * The list of issue comments. */ issueComments?: IssueComment[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; } /** * The response to list issues. */ export interface ListIssuesResponse { /** * The list of issues. */ issues?: Issue[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; } /** * The response message for Locations.ListLocations. */ export interface ListLocationsResponse { /** * A list of locations that matches the specified filter in the request. */ locations?: Location[]; /** * The standard List next-page token. */ nextPageToken?: string; } /** * The response message for Operations.ListOperations. */ export interface ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string; /** * A list of operations that matches the specified filter in the request. */ operations?: Operation[]; /** * Unordered list. Unreachable resources. Populated when the request sets * `ListOperationsRequest.return_partial_success` and reads across * collections. For example, when attempting to list all resources across all * supported locations. */ unreachable?: string[]; } /** * The response to list pull request comments. */ export interface ListPullRequestCommentsResponse { /** * A token to set as page_token to retrieve the next page. If this field is * omitted, there are no subsequent pages. */ nextPageToken?: string; /** * The list of pull request comments. */ pullRequestComments?: PullRequestComment[]; } function serializeListPullRequestCommentsResponse(data: any): ListPullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (serializePullRequestComment(item))) : undefined, }; } function deserializeListPullRequestCommentsResponse(data: any): ListPullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (deserializePullRequestComment(item))) : undefined, }; } /** * ListPullRequestFileDiffsResponse is the response containing file diffs * returned from ListPullRequestFileDiffs. */ export interface ListPullRequestFileDiffsResponse { /** * The list of pull request file diffs. */ fileDiffs?: FileDiff[]; /** * A token identifying a page of results the server should return. */ nextPageToken?: string; } /** * ListPullRequestsResponse is the response to list pull requests. */ export interface ListPullRequestsResponse { /** * A token identifying a page of results the server should return. */ nextPageToken?: string; /** * The list of pull requests. */ pullRequests?: PullRequest[]; } 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; } /** * MergePullRequestRequest is the request to merge a pull request. */ export interface MergePullRequestRequest { } /** * The request to open an issue. */ export interface OpenIssueRequest { /** * Optional. The current etag of the issue. If the etag is provided and does * not match the current etag of the issue, opening will be blocked and an * ABORTED error will be returned. */ etag?: string; } /** * OpenPullRequestRequest is the request to open a pull request. */ export interface OpenPullRequestRequest { } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Represents the metadata of the long-running operation. */ export interface OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have 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; } /** * 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, }; } /** * The position of the code comment. */ export interface Position { /** * Required. The line number of the comment. Positive value means it's on the * new side of the diff, negative value means it's on the old side. */ line?: bigint; /** * Required. The path of the file. */ path?: string; } function serializePosition(data: any): Position { return { ...data, line: data["line"] !== undefined ? String(data["line"]) : undefined, }; } function deserializePosition(data: any): Position { return { ...data, line: data["line"] !== undefined ? BigInt(data["line"]) : undefined, }; } /** * PrivateConfig includes settings for private instance. */ export interface PrivateConfig { /** * Optional. Immutable. CA pool resource, resource must in the format of * `projects/{project}/locations/{location}/caPools/{ca_pool}`. */ caPool?: string; /** * Optional. Custom host config for the instance. */ customHostConfig?: CustomHostConfig; /** * Output only. Service Attachment for HTTP, resource is in the format of * `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. */ readonly httpServiceAttachment?: string; /** * Required. Immutable. Indicate if it's private instance. */ isPrivate?: boolean; /** * Optional. Additional allowed projects for setting up PSC connections. * Instance host project is automatically allowed and does not need to be * included in this list. */ pscAllowedProjects?: string[]; /** * Output only. Service Attachment for SSH, resource is in the format of * `projects/{project}/regions/{region}/serviceAttachments/{service_attachment}`. */ readonly sshServiceAttachment?: string; } /** * Additional options for SecureSourceManager#projectsLocationsInstancesCreate. */ export interface ProjectsLocationsInstancesCreateOptions { /** * Required. ID of the instance to be created. */ instanceId?: string; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes since the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for SecureSourceManager#projectsLocationsInstancesDelete. */ export interface ProjectsLocationsInstancesDeleteOptions { /** * Optional. If set to true, will force the deletion of the instance. */ force?: boolean; /** * Optional. An optional request ID to identify requests. Specify a unique * request ID so that if you must retry your request, the server will know to * ignore the request if it has already been completed. The server will * guarantee that for at least 60 minutes after the first request. For * example, consider a situation where you make an initial request and the * request times out. If you make the request again with the same request ID, * the server can check if original operation with the same request ID was * received, and if so, will ignore the second request. This prevents clients * from accidentally creating duplicate commitments. The request ID must be a * valid UUID with the exception that zero UUID is not supported * (00000000-0000-0000-0000-000000000000). */ requestId?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsInstancesGetIamPolicy. */ export interface ProjectsLocationsInstancesGetIamPolicyOptions { /** * 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 SecureSourceManager#projectsLocationsInstancesList. */ export interface ProjectsLocationsInstancesListOptions { /** * Optional. Filter for filtering results. */ filter?: string; /** * Optional. Hint for how to order the results. */ orderBy?: string; /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, server will pick an appropriate default. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for SecureSourceManager#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * Optional. Do not use this field. It is unsupported and is ignored unless * explicitly documented otherwise. This is primarily for internal usage. */ extraLocationTypes?: string; /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for SecureSourceManager#projectsLocationsOperationsList. */ export interface ProjectsLocationsOperationsListOptions { /** * The standard list filter. */ filter?: string; /** * The standard list page size. */ pageSize?: number; /** * The standard list page token. */ pageToken?: string; /** * When set to `true`, operations that are reachable are returned as normal, * and those that are unreachable are returned in the * ListOperationsResponse.unreachable field. This can only be `true` when * reading across collections. For example, when `parent` is set to * `"projects/example/locations/-"`. This field is not supported by default * and will result in an `UNIMPLEMENTED` error if set unless explicitly * documented otherwise in service or product specific documentation. */ returnPartialSuccess?: boolean; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesBranchRulesCreate. */ export interface ProjectsLocationsRepositoriesBranchRulesCreateOptions { branchRuleId?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesBranchRulesDelete. */ export interface ProjectsLocationsRepositoriesBranchRulesDeleteOptions { /** * Optional. If set to true, and the branch rule is not found, the request * will succeed but no action will be taken on the server. */ allowMissing?: boolean; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesBranchRulesList. */ export interface ProjectsLocationsRepositoriesBranchRulesListOptions { /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesBranchRulesPatch. */ export interface ProjectsLocationsRepositoriesBranchRulesPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the branchRule resource by the update. The fields specified in the * update_mask are relative to the resource, not the full request. A field * will be overwritten if it is in the mask. The special value "*" means full * replacement. */ updateMask?: string /* FieldMask */; /** * Optional. If set, validate the request and preview the review, but do not * actually post it. (https://google.aip.dev/163, for declarative friendly) */ validateOnly?: boolean; } function serializeProjectsLocationsRepositoriesBranchRulesPatchOptions(data: any): ProjectsLocationsRepositoriesBranchRulesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesBranchRulesPatchOptions(data: any): ProjectsLocationsRepositoriesBranchRulesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesCreate. */ export interface ProjectsLocationsRepositoriesCreateOptions { /** * Required. The ID to use for the repository, which will become the final * component of the repository's resource name. This value should be 4-63 * characters, and valid characters are /a-z-/. */ repositoryId?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesDelete. */ export interface ProjectsLocationsRepositoriesDeleteOptions { /** * Optional. If set to true, and the repository is not found, the request * will succeed but no action will be taken on the server. */ allowMissing?: boolean; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesFetchBlob. */ export interface ProjectsLocationsRepositoriesFetchBlobOptions { /** * Required. The SHA-1 hash of the blob to retrieve. */ sha?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesFetchTree. */ export interface ProjectsLocationsRepositoriesFetchTreeOptions { /** * Optional. Requested page size. Server may return fewer items than * requested. If unspecified, at most 10,000 items will be returned. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; /** * Optional. If true, include all subfolders and their files in the response. * If false, only the immediate children are returned. */ recursive?: boolean; /** * Optional. `ref` can be a SHA-1 hash, a branch name, or a tag. Specifies * which tree to fetch. If not specified, the default branch will be used. */ ref?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesGetIamPolicy. */ export interface ProjectsLocationsRepositoriesGetIamPolicyOptions { /** * 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 * SecureSourceManager#projectsLocationsRepositoriesHooksCreate. */ export interface ProjectsLocationsRepositoriesHooksCreateOptions { /** * Required. The ID to use for the hook, which will become the final * component of the hook's resource name. This value restricts to lower-case * letters, numbers, and hyphen, with the first character a letter, the last a * letter or a number, and a 63 character maximum. */ hookId?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesHooksList. */ export interface ProjectsLocationsRepositoriesHooksListOptions { /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesHooksPatch. */ export interface ProjectsLocationsRepositoriesHooksPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the hook resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. The special value "*" means full * replacement. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesHooksPatchOptions(data: any): ProjectsLocationsRepositoriesHooksPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesHooksPatchOptions(data: any): ProjectsLocationsRepositoriesHooksPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesIssuesDelete. */ export interface ProjectsLocationsRepositoriesIssuesDeleteOptions { /** * Optional. The current etag of the issue. If the etag is provided and does * not match the current etag of the issue, deletion will be blocked and an * ABORTED error will be returned. */ etag?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesIssuesIssueCommentsList. */ export interface ProjectsLocationsRepositoriesIssuesIssueCommentsListOptions { /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesIssuesIssueCommentsPatch. */ export interface ProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the issue comment resource by the update. The fields specified in the * update_mask are relative to the resource, not the full request. A field * will be overwritten if it is in the mask. The special value "*" means full * replacement. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions(data: any): ProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions(data: any): ProjectsLocationsRepositoriesIssuesIssueCommentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesIssuesList. */ export interface ProjectsLocationsRepositoriesIssuesListOptions { /** * Optional. Used to filter the resulting issues list. */ filter?: string; /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesIssuesPatch. */ export interface ProjectsLocationsRepositoriesIssuesPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the issue resource by the update. The fields specified in the update_mask * are relative to the resource, not the full request. A field will be * overwritten if it is in the mask. The special value "*" means full * replacement. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesIssuesPatchOptions(data: any): ProjectsLocationsRepositoriesIssuesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesIssuesPatchOptions(data: any): ProjectsLocationsRepositoriesIssuesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesList. */ export interface ProjectsLocationsRepositoriesListOptions { /** * Optional. Filter results. */ filter?: string; /** * Optional. The name of the instance in which the repository is hosted, * formatted as * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. * When listing repositories via securesourcemanager.googleapis.com, this * field is required. When listing repositories via *.sourcemanager.dev, this * field is ignored. */ instance?: string; /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesPatch. */ export interface ProjectsLocationsRepositoriesPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the repository resource by the update. The fields specified in the * update_mask are relative to the resource, not the full request. A field * will be overwritten if it is in the mask. If the user does not provide a * mask then all fields will be overwritten. */ updateMask?: string /* FieldMask */; /** * Optional. False by default. If set to true, the request is validated and * the user is provided with an expected result, but no actual change is made. */ validateOnly?: boolean; } function serializeProjectsLocationsRepositoriesPatchOptions(data: any): ProjectsLocationsRepositoriesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPatchOptions(data: any): ProjectsLocationsRepositoriesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesPullRequestsListFileDiffs. */ export interface ProjectsLocationsRepositoriesPullRequestsListFileDiffsOptions { /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesPullRequestsList. */ export interface ProjectsLocationsRepositoriesPullRequestsListOptions { /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesPullRequestsPatch. */ export interface ProjectsLocationsRepositoriesPullRequestsPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the pull request resource by the update. The fields specified in the * update_mask are relative to the resource, not the full request. A field * will be overwritten if it is in the mask. The special value "*" means full * replacement. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesPullRequestsPatchOptions(data: any): ProjectsLocationsRepositoriesPullRequestsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPullRequestsPatchOptions(data: any): ProjectsLocationsRepositoriesPullRequestsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesPullRequestsPullRequestCommentsList. */ export interface ProjectsLocationsRepositoriesPullRequestsPullRequestCommentsListOptions { /** * Optional. Requested page size. If unspecified, a default size of 30 will * be used. The maximum value is 100; values above 100 will be coerced to 100. */ pageSize?: number; /** * Optional. A token identifying a page of results the server should return. */ pageToken?: string; } /** * Additional options for * SecureSourceManager#projectsLocationsRepositoriesPullRequestsPullRequestCommentsPatch. */ export interface ProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions { /** * Optional. Field mask is used to specify the fields to be overwritten in * the pull request comment resource by the update. Updatable fields are * `body`. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions(data: any): ProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions(data: any): ProjectsLocationsRepositoriesPullRequestsPullRequestCommentsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Metadata of a PullRequest. PullRequest is the request from a user to merge a * branch (head) into another branch (base). */ export interface PullRequest { /** * Required. The branch to merge changes in. */ base?: Branch; /** * Optional. The pull request body. Provides a detailed description of the * changes. */ body?: string; /** * Output only. Close timestamp (if closed or merged). Cleared when pull * request is re-opened. */ readonly closeTime?: Date; /** * Output only. Creation timestamp. */ readonly createTime?: Date; /** * Immutable. The branch containing the changes to be merged. */ head?: Branch; /** * Output only. Identifier. A unique identifier for a PullRequest. The number * appended at the end is generated by the server. Format: * `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request_id}` */ readonly name?: string; /** * Output only. State of the pull request (open, closed or merged). */ readonly state?: | "STATE_UNSPECIFIED" | "OPEN" | "CLOSED" | "MERGED"; /** * Required. The pull request title. */ title?: string; /** * Output only. Last updated timestamp. */ readonly updateTime?: Date; } /** * PullRequestComment represents a comment on a pull request. */ export interface PullRequestComment { /** * Optional. The comment on a code line. */ code?: Code; /** * Optional. The general pull request comment. */ comment?: Comment; /** * Output only. Creation timestamp. */ readonly createTime?: Date; /** * Identifier. Unique identifier for the pull request comment. The comment id * is generated by the server. Format: * `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment_id}` */ name?: string; /** * Optional. The review summary comment. */ review?: Review; /** * Output only. Last updated timestamp. */ readonly updateTime?: Date; } function serializePullRequestComment(data: any): PullRequestComment { return { ...data, code: data["code"] !== undefined ? serializeCode(data["code"]) : undefined, }; } function deserializePullRequestComment(data: any): PullRequestComment { return { ...data, code: data["code"] !== undefined ? deserializeCode(data["code"]) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } export interface PushOption { /** * Optional. Trigger hook for matching branches only. Specified as glob * pattern. If empty or *, events for all branches are reported. Examples: * main, {main,release*}. See https://pkg.go.dev/github.com/gobwas/glob * documentation. */ branchFilter?: string; } /** * Metadata of a Secure Source Manager repository. */ export interface Repository { /** * Output only. Create timestamp. */ readonly createTime?: Date; /** * Optional. Description of the repository, which cannot exceed 500 * characters. */ description?: string; /** * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. */ etag?: string; /** * Input only. Initial configurations for the repository. */ initialConfig?: InitialConfig; /** * Optional. The name of the instance in which the repository is hosted, * formatted as * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * When creating repository via securesourcemanager.googleapis.com, this field * is used as input. When creating repository via *.sourcemanager.dev, this * field is output only. */ instance?: string; /** * Identifier. A unique identifier for a repository. The name should be of * the format: * `projects/{project}/locations/{location_id}/repositories/{repository_id}` */ name?: string; /** * Output only. Unique identifier of the repository. */ readonly uid?: string; /** * Output only. Update timestamp. */ readonly updateTime?: Date; /** * Output only. URIs for the repository. */ readonly uris?: URIs; } /** * The request to resolve multiple pull request comments. */ export interface ResolvePullRequestCommentsRequest { /** * Optional. If set, at least one comment in a thread is required, rest of * the comments in the same thread will be automatically updated to resolved. * If unset, all comments in the same thread need be present. */ autoFill?: boolean; /** * Required. The names of the pull request comments to resolve. Format: * `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` * Only comments from the same threads are allowed in the same request. */ names?: string[]; } /** * The response to resolve multiple pull request comments. */ export interface ResolvePullRequestCommentsResponse { /** * The list of pull request comments resolved. */ pullRequestComments?: PullRequestComment[]; } function serializeResolvePullRequestCommentsResponse(data: any): ResolvePullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (serializePullRequestComment(item))) : undefined, }; } function deserializeResolvePullRequestCommentsResponse(data: any): ResolvePullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (deserializePullRequestComment(item))) : undefined, }; } /** * The review summary comment. */ export interface Review { /** * Required. The review action type. */ actionType?: | "ACTION_TYPE_UNSPECIFIED" | "COMMENT" | "CHANGE_REQUESTED" | "APPROVED"; /** * Optional. The comment body. */ body?: string; /** * Output only. The effective commit sha this review is pointing to. */ readonly effectiveCommitSha?: string; } /** * 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, }; } /** * 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; } /** * 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[]; } /** * Represents an entry within a tree structure (like a Git tree). */ export interface TreeEntry { /** * Output only. The file mode as a string (e.g., "100644"). Indicates file * type. Output-only. */ readonly mode?: string; /** * Output only. The path of the file or directory within the tree (e.g., * "src/main/java/MyClass.java"). Output-only. */ readonly path?: string; /** * Output only. The SHA-1 hash of the object (unique identifier). * Output-only. */ readonly sha?: string; /** * Output only. The size of the object in bytes (only for blobs). * Output-only. */ readonly size?: bigint; /** * Output only. The type of the object (TREE, BLOB, COMMIT). Output-only. */ readonly type?: | "OBJECT_TYPE_UNSPECIFIED" | "TREE" | "BLOB" | "COMMIT"; } /** * The request to unresolve multiple pull request comments. */ export interface UnresolvePullRequestCommentsRequest { /** * Optional. If set, at least one comment in a thread is required, rest of * the comments in the same thread will be automatically updated to * unresolved. If unset, all comments in the same thread need be present. */ autoFill?: boolean; /** * Required. The names of the pull request comments to unresolve. Format: * `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}` * Only comments from the same threads are allowed in the same request. */ names?: string[]; } /** * The response to unresolve multiple pull request comments. */ export interface UnresolvePullRequestCommentsResponse { /** * The list of pull request comments unresolved. */ pullRequestComments?: PullRequestComment[]; } function serializeUnresolvePullRequestCommentsResponse(data: any): UnresolvePullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (serializePullRequestComment(item))) : undefined, }; } function deserializeUnresolvePullRequestCommentsResponse(data: any): UnresolvePullRequestCommentsResponse { return { ...data, pullRequestComments: data["pullRequestComments"] !== undefined ? data["pullRequestComments"].map((item: any) => (deserializePullRequestComment(item))) : undefined, }; } /** * URIs for the repository. */ export interface URIs { /** * Output only. API is the URI for API access. */ readonly api?: string; /** * Output only. git_https is the git HTTPS URI for git operations. */ readonly gitHttps?: string; /** * Output only. HTML is the URI for user to view the repository in a browser. */ readonly html?: string; } /** * WorkforceIdentityFederationConfig allows this instance to support users from * external identity providers. */ export interface WorkforceIdentityFederationConfig { /** * Optional. Immutable. Whether Workforce Identity Federation is enabled. */ enabled?: boolean; } 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; }