// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Dataform API Client for Deno * ============================ * * * * Docs: https://cloud.google.com/dataform/docs * Source: https://googleapis.deno.dev/v1/dataform:v1beta1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; export class Dataform { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://dataform.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}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Lists information about the supported locations for this service. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }/locations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.includeUnrevealedLocations !== undefined) { url.searchParams.append("includeUnrevealedLocations", String(opts.includeUnrevealedLocations)); } 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; } /** * Creates a new CompilationResult in a given project and location. * * @param parent Required. The repository in which to create the compilation result. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesCompilationResultsCreate(parent: string, req: CompilationResult): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/compilationResults`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as CompilationResult; } /** * Fetches a single CompilationResult. * * @param name Required. The compilation result's name. */ async projectsLocationsRepositoriesCompilationResultsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as CompilationResult; } /** * Lists CompilationResults in a given Repository. * * @param parent Required. The repository in which to list compilation results. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesCompilationResultsList(parent: string, opts: ProjectsLocationsRepositoriesCompilationResultsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/compilationResults`); 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 ListCompilationResultsResponse; } /** * Returns CompilationResultActions in a given CompilationResult. * * @param name Required. The compilation result's name. */ async projectsLocationsRepositoriesCompilationResultsQuery(name: string, opts: ProjectsLocationsRepositoriesCompilationResultsQueryOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:query`); 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 QueryCompilationResultActionsResponse; } /** * Creates a new Repository in a given project and location. * * @param parent Required. The location in which to create the repository. Must be in the format `projects/*/locations/*`. */ async projectsLocationsRepositoriesCreate(parent: string, req: Repository, opts: ProjectsLocationsRepositoriesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ 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 Repository; } /** * Deletes a single Repository. * * @param name Required. The repository's name. */ async projectsLocationsRepositoriesDelete(name: string, opts: ProjectsLocationsRepositoriesDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Fetches a Repository's remote branches. * * @param name Required. The repository's name. */ async projectsLocationsRepositoriesFetchRemoteBranches(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:fetchRemoteBranches`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchRemoteBranchesResponse; } /** * Fetches a single Repository. * * @param name Required. The repository's name. */ async projectsLocationsRepositoriesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Repository; } /** * Lists Repositories in a given project and location. * * @param parent Required. The location in which to list repositories. Must be in the format `projects/*/locations/*`. */ async projectsLocationsRepositoriesList(parent: string, opts: ProjectsLocationsRepositoriesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/repositories`); 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 ListRepositoriesResponse; } /** * Updates a single Repository. * * @param name Output only. The repository's name. */ async projectsLocationsRepositoriesPatch(name: string, req: Repository, opts: ProjectsLocationsRepositoriesPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1beta1/${ 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 Repository; } /** * Creates a new ReleaseConfig in a given Repository. * * @param parent Required. The repository in which to create the release config. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesReleaseConfigsCreate(parent: string, req: ReleaseConfig, opts: ProjectsLocationsRepositoriesReleaseConfigsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/releaseConfigs`); if (opts.releaseConfigId !== undefined) { url.searchParams.append("releaseConfigId", String(opts.releaseConfigId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as ReleaseConfig; } /** * Deletes a single ReleaseConfig. * * @param name Required. The release config's name. */ async projectsLocationsRepositoriesReleaseConfigsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Fetches a single ReleaseConfig. * * @param name Required. The release config's name. */ async projectsLocationsRepositoriesReleaseConfigsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ReleaseConfig; } /** * Lists ReleaseConfigs in a given Repository. * * @param parent Required. The repository in which to list release configs. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesReleaseConfigsList(parent: string, opts: ProjectsLocationsRepositoriesReleaseConfigsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/releaseConfigs`); 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 ListReleaseConfigsResponse; } /** * Updates a single ReleaseConfig. * * @param name Output only. The release config's name. */ async projectsLocationsRepositoriesReleaseConfigsPatch(name: string, req: ReleaseConfig, opts: ProjectsLocationsRepositoriesReleaseConfigsPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesReleaseConfigsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1beta1/${ 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 ReleaseConfig; } /** * Creates a new WorkflowConfig in a given Repository. * * @param parent Required. The repository in which to create the workflow config. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesWorkflowConfigsCreate(parent: string, req: WorkflowConfig, opts: ProjectsLocationsRepositoriesWorkflowConfigsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/workflowConfigs`); if (opts.workflowConfigId !== undefined) { url.searchParams.append("workflowConfigId", String(opts.workflowConfigId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as WorkflowConfig; } /** * Deletes a single WorkflowConfig. * * @param name Required. The workflow config's name. */ async projectsLocationsRepositoriesWorkflowConfigsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Fetches a single WorkflowConfig. * * @param name Required. The workflow config's name. */ async projectsLocationsRepositoriesWorkflowConfigsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as WorkflowConfig; } /** * Lists WorkflowConfigs in a given Repository. * * @param parent Required. The repository in which to list workflow configs. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesWorkflowConfigsList(parent: string, opts: ProjectsLocationsRepositoriesWorkflowConfigsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/workflowConfigs`); 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 ListWorkflowConfigsResponse; } /** * Updates a single WorkflowConfig. * * @param name Output only. The workflow config's name. */ async projectsLocationsRepositoriesWorkflowConfigsPatch(name: string, req: WorkflowConfig, opts: ProjectsLocationsRepositoriesWorkflowConfigsPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesWorkflowConfigsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1beta1/${ 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 WorkflowConfig; } /** * Requests cancellation of a running WorkflowInvocation. * * @param name Required. The workflow invocation resource's name. */ async projectsLocationsRepositoriesWorkflowInvocationsCancel(name: string, req: CancelWorkflowInvocationRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:cancel`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Creates a new WorkflowInvocation in a given Repository. * * @param parent Required. The repository in which to create the workflow invocation. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesWorkflowInvocationsCreate(parent: string, req: WorkflowInvocation): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/workflowInvocations`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as WorkflowInvocation; } /** * Deletes a single WorkflowInvocation. * * @param name Required. The workflow invocation resource's name. */ async projectsLocationsRepositoriesWorkflowInvocationsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Fetches a single WorkflowInvocation. * * @param name Required. The workflow invocation resource's name. */ async projectsLocationsRepositoriesWorkflowInvocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as WorkflowInvocation; } /** * Lists WorkflowInvocations in a given Repository. * * @param parent Required. The parent resource of the WorkflowInvocation type. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesWorkflowInvocationsList(parent: string, opts: ProjectsLocationsRepositoriesWorkflowInvocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/workflowInvocations`); 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 ListWorkflowInvocationsResponse; } /** * Returns WorkflowInvocationActions in a given WorkflowInvocation. * * @param name Required. The workflow invocation's name. */ async projectsLocationsRepositoriesWorkflowInvocationsQuery(name: string, opts: ProjectsLocationsRepositoriesWorkflowInvocationsQueryOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:query`); 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 QueryWorkflowInvocationActionsResponse; } /** * Applies a Git commit for uncommitted files in a Workspace. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesCommit(name: string, req: CommitWorkspaceChangesRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:commit`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Creates a new Workspace in a given Repository. * * @param parent Required. The repository in which to create the workspace. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesWorkspacesCreate(parent: string, req: Workspace, opts: ProjectsLocationsRepositoriesWorkspacesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/workspaces`); if (opts.workspaceId !== undefined) { url.searchParams.append("workspaceId", String(opts.workspaceId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Workspace; } /** * Deletes a single Workspace. * * @param name Required. The workspace resource's name. */ async projectsLocationsRepositoriesWorkspacesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Fetches Git diff for an uncommitted file in a Workspace. * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesFetchFileDiff(workspace: string, opts: ProjectsLocationsRepositoriesWorkspacesFetchFileDiffOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:fetchFileDiff`); if (opts.path !== undefined) { url.searchParams.append("path", String(opts.path)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchFileDiffResponse; } /** * Fetches Git statuses for the files in a Workspace. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesFetchFileGitStatuses(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:fetchFileGitStatuses`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchFileGitStatusesResponse; } /** * Fetches Git ahead/behind against a remote branch. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesFetchGitAheadBehind(name: string, opts: ProjectsLocationsRepositoriesWorkspacesFetchGitAheadBehindOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:fetchGitAheadBehind`); if (opts.remoteBranch !== undefined) { url.searchParams.append("remoteBranch", String(opts.remoteBranch)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as FetchGitAheadBehindResponse; } /** * Fetches a single Workspace. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Workspace; } /** * Installs dependency NPM packages (inside a Workspace). * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesInstallNpmPackages(workspace: string, req: InstallNpmPackagesRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:installNpmPackages`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as InstallNpmPackagesResponse; } /** * Lists Workspaces in a given Repository. * * @param parent Required. The repository in which to list workspaces. Must be in the format `projects/*/locations/*/repositories/*`. */ async projectsLocationsRepositoriesWorkspacesList(parent: string, opts: ProjectsLocationsRepositoriesWorkspacesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ parent }/workspaces`); 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 ListWorkspacesResponse; } /** * Creates a directory inside a Workspace. * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesMakeDirectory(workspace: string, req: MakeDirectoryRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:makeDirectory`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as MakeDirectoryResponse; } /** * Moves a directory (inside a Workspace), and all of its contents, to a new * location. * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesMoveDirectory(workspace: string, req: MoveDirectoryRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:moveDirectory`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as MoveDirectoryResponse; } /** * Moves a file (inside a Workspace) to a new location. * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesMoveFile(workspace: string, req: MoveFileRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:moveFile`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as MoveFileResponse; } /** * Pulls Git commits from the Repository's remote into a Workspace. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesPull(name: string, req: PullGitCommitsRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:pull`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Pushes Git commits from a Workspace to the Repository's remote. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesPush(name: string, req: PushGitCommitsRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:push`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Returns the contents of a given Workspace directory. * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesQueryDirectoryContents(workspace: string, opts: ProjectsLocationsRepositoriesWorkspacesQueryDirectoryContentsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:queryDirectoryContents`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.path !== undefined) { url.searchParams.append("path", String(opts.path)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as QueryDirectoryContentsResponse; } /** * Returns the contents of a file (inside a Workspace). * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesReadFile(workspace: string, opts: ProjectsLocationsRepositoriesWorkspacesReadFileOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:readFile`); if (opts.path !== undefined) { url.searchParams.append("path", String(opts.path)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeReadFileResponse(data); } /** * Deletes a directory (inside a Workspace) and all of its contents. * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesRemoveDirectory(workspace: string, req: RemoveDirectoryRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:removeDirectory`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Deletes a file (inside a Workspace). * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesRemoveFile(workspace: string, req: RemoveFileRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:removeFile`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Performs a Git reset for uncommitted files in a Workspace. * * @param name Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesReset(name: string, req: ResetWorkspaceChangesRequest): Promise { const url = new URL(`${this.#baseUrl}v1beta1/${ name }:reset`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Empty; } /** * Writes to a file (inside a Workspace). * * @param workspace Required. The workspace's name. */ async projectsLocationsRepositoriesWorkspacesWriteFile(workspace: string, req: WriteFileRequest): Promise { req = serializeWriteFileRequest(req); const url = new URL(`${this.#baseUrl}v1beta1/${ workspace }:writeFile`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as WriteFileResponse; } } /** * Represents an assertion upon a SQL query which is required return zero rows. */ export interface Assertion { /** * A list of actions that this action depends on. */ dependencyTargets?: Target[]; /** * Whether this action is disabled (i.e. should not be run). */ disabled?: boolean; /** * The parent action of this assertion. Only set if this assertion was * automatically generated. */ parentAction?: Target; /** * Descriptor for the assertion's automatically-generated view and its * columns. */ relationDescriptor?: RelationDescriptor; /** * The SELECT query which must return zero rows in order for this assertion * to succeed. */ selectQuery?: string; /** * Arbitrary, user-defined tags on this action. */ tags?: string[]; } /** * Represents a workflow action that will run against BigQuery. */ export interface BigQueryAction { /** * Output only. The generated BigQuery SQL script that will be executed. */ readonly sqlScript?: string; } /** * `CancelWorkflowInvocation` request message. */ export interface CancelWorkflowInvocationRequest { } /** * Configures various aspects of Dataform code compilation. */ export interface CodeCompilationConfig { /** * Optional. The default schema (BigQuery dataset ID) for assertions. */ assertionSchema?: string; /** * Optional. The suffix that should be appended to all database (Google Cloud * project ID) names. */ databaseSuffix?: string; /** * Optional. The default database (Google Cloud project ID). */ defaultDatabase?: string; /** * Optional. The default BigQuery location to use. Defaults to "US". See the * BigQuery docs for a full list of locations: * https://cloud.google.com/bigquery/docs/locations. */ defaultLocation?: string; /** * Optional. The default schema (BigQuery dataset ID). */ defaultSchema?: string; /** * Optional. The suffix that should be appended to all schema (BigQuery * dataset ID) names. */ schemaSuffix?: string; /** * Optional. The prefix that should be prepended to all table names. */ tablePrefix?: string; /** * Optional. User-defined variables that are made available to project code * during compilation. */ vars?: { [key: string]: string }; } /** * Describes a column. */ export interface ColumnDescriptor { /** * A list of BigQuery policy tags that will be applied to the column. */ bigqueryPolicyTags?: string[]; /** * A textual description of the column. */ description?: string; /** * The identifier for the column. Each entry in `path` represents one level * of nesting. */ path?: string[]; } /** * Represents the author of a Git commit. */ export interface CommitAuthor { /** * Required. The commit author's email address. */ emailAddress?: string; /** * Required. The commit author's name. */ name?: string; } /** * `CommitWorkspaceChanges` request message. */ export interface CommitWorkspaceChangesRequest { /** * Required. The commit's author. */ author?: CommitAuthor; /** * Optional. The commit's message. */ commitMessage?: string; /** * Optional. Full file paths to commit including filename, rooted at * workspace root. If left empty, all files will be committed. */ paths?: string[]; } /** * An error encountered when attempting to compile a Dataform project. */ export interface CompilationError { /** * Output only. The identifier of the action where this error occurred, if * available. */ readonly actionTarget?: Target; /** * Output only. The error's top level message. */ readonly message?: string; /** * Output only. The path of the file where this error occurred, if available, * relative to the project root. */ readonly path?: string; /** * Output only. The error's full stack trace. */ readonly stack?: string; } /** * Represents the result of compiling a Dataform project. */ export interface CompilationResult { /** * Immutable. If set, fields of `code_compilation_config` override the * default compilation settings that are specified in dataform.json. */ codeCompilationConfig?: CodeCompilationConfig; /** * Output only. Errors encountered during project compilation. */ readonly compilationErrors?: CompilationError[]; /** * Output only. The version of `@dataform/core` that was used for * compilation. */ readonly dataformCoreVersion?: string; /** * Immutable. Git commit/tag/branch name at which the repository should be * compiled. Must exist in the remote repository. Examples: - a commit SHA: * `12ade345` - a tag: `tag1` - a branch name: `branch1` */ gitCommitish?: string; /** * Output only. The compilation result's name. */ readonly name?: string; /** * Immutable. The name of the release config to compile. The release config's * 'current_compilation_result' field will be updated to this compilation * result. Must be in the format * `projects/*\/locations/*\/repositories/*\/releaseConfigs/*`. */ releaseConfig?: string; /** * Output only. The fully resolved Git commit SHA of the code that was * compiled. Not set for compilation results whose source is a workspace. */ readonly resolvedGitCommitSha?: string; /** * Immutable. The name of the workspace to compile. Must be in the format * `projects/*\/locations/*\/repositories/*\/workspaces/*`. */ workspace?: string; } /** * Represents a single Dataform action in a compilation result. */ export interface CompilationResultAction { /** * The assertion executed by this action. */ assertion?: Assertion; /** * The action's identifier if the project had been compiled without any * overrides configured. Unique within the compilation result. */ canonicalTarget?: Target; /** * The declaration declared by this action. */ declaration?: Declaration; /** * The full path including filename in which this action is located, relative * to the workspace root. */ filePath?: string; /** * The database operations executed by this action. */ operations?: Operations; /** * The database relation created/updated by this action. */ relation?: Relation; /** * This action's identifier. Unique within the compilation result. */ target?: Target; } /** * Represents a relation which is not managed by Dataform but which may be * referenced by Dataform actions. */ export interface Declaration { /** * Descriptor for the relation and its columns. Used as documentation only, * i.e. values here will result in no changes to the relation's metadata. */ relationDescriptor?: RelationDescriptor; } /** * Represents a single entry in a workspace directory. */ export interface DirectoryEntry { /** * A child directory in the directory. */ directory?: string; /** * A file in the directory. */ file?: 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 { } /** * `FetchFileDiff` response message. */ export interface FetchFileDiffResponse { /** * The raw formatted Git diff for the file. */ formattedDiff?: string; } /** * `FetchFileGitStatuses` response message. */ export interface FetchFileGitStatusesResponse { /** * A list of all files which have uncommitted Git changes. There will only be * a single entry for any given file. */ uncommittedFileChanges?: UncommittedFileChange[]; } /** * `FetchGitAheadBehind` response message. */ export interface FetchGitAheadBehindResponse { /** * The number of commits in the remote branch that are not in the workspace. */ commitsAhead?: number; /** * The number of commits in the workspace that are not in the remote branch. */ commitsBehind?: number; } /** * `FetchRemoteBranches` response message. */ export interface FetchRemoteBranchesResponse { /** * The remote repository's branch names. */ branches?: string[]; } /** * Controls Git remote configuration for a repository. */ export interface GitRemoteSettings { /** * Required. The name of the Secret Manager secret version to use as an * authentication token for Git operations. Must be in the format * `projects/*\/secrets/*\/versions/*`. */ authenticationTokenSecretVersion?: string; /** * Required. The Git remote's default branch name. */ defaultBranch?: string; /** * Output only. Indicates the status of the Git access token. */ readonly tokenStatus?: | "TOKEN_STATUS_UNSPECIFIED" | "NOT_FOUND" | "INVALID" | "VALID"; /** * Required. The Git remote's URL. */ url?: string; } /** * Contains settings for relations of type `INCREMENTAL_TABLE`. */ export interface IncrementalTableConfig { /** * SQL statements to be executed after inserting new rows into the relation. */ incrementalPostOperations?: string[]; /** * SQL statements to be executed before inserting new rows into the relation. */ incrementalPreOperations?: string[]; /** * The SELECT query which returns rows which should be inserted into the * relation if it already exists and is not being refreshed. */ incrementalSelectQuery?: string; /** * Whether this table should be protected from being refreshed. */ refreshDisabled?: boolean; /** * A set of columns or SQL expressions used to define row uniqueness. If any * duplicates are discovered (as defined by `unique_key_parts`), only the * newly selected rows (as defined by `incremental_select_query`) will be * included in the relation. */ uniqueKeyParts?: string[]; /** * A SQL expression conditional used to limit the set of existing rows * considered for a merge operation (see `unique_key_parts` for more * information). */ updatePartitionFilter?: string; } /** * `InstallNpmPackages` request message. */ export interface InstallNpmPackagesRequest { } /** * `InstallNpmPackages` response message. */ export interface InstallNpmPackagesResponse { } /** * Represents a time interval, encoded as a Timestamp start (inclusive) and a * Timestamp end (exclusive). The start must be less than or equal to the end. * When the start equals the end, the interval is empty (matches no time). When * both start and end are unspecified, the interval matches any time. */ export interface Interval { /** * Optional. Exclusive end of the interval. If specified, a Timestamp * matching this interval will have to be before the end. */ endTime?: Date; /** * Optional. Inclusive start of the interval. If specified, a Timestamp * matching this interval will have to be the same or after the start. */ startTime?: Date; } function serializeInterval(data: any): Interval { return { ...data, endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeInterval(data: any): Interval { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Includes various configuration options for a workflow invocation. If both * `included_targets` and `included_tags` are unset, all actions will be * included. */ export interface InvocationConfig { /** * Optional. When set to true, any incremental tables will be fully * refreshed. */ fullyRefreshIncrementalTablesEnabled?: boolean; /** * Optional. The set of tags to include. */ includedTags?: string[]; /** * Optional. The set of action identifiers to include. */ includedTargets?: Target[]; /** * Optional. When set to true, transitive dependencies of included actions * will be executed. */ transitiveDependenciesIncluded?: boolean; /** * Optional. When set to true, transitive dependents of included actions will * be executed. */ transitiveDependentsIncluded?: boolean; } /** * `ListCompilationResults` response message. */ export interface ListCompilationResultsResponse { /** * List of compilation results. */ compilationResults?: CompilationResult[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * Locations which could not be reached. */ unreachable?: string[]; } /** * The response message for Locations.ListLocations. */ export interface ListLocationsResponse { /** * A list of locations that matches the specified filter in the request. */ locations?: Location[]; /** * The standard List next-page token. */ nextPageToken?: string; } /** * `ListReleaseConfigs` response message. */ export interface ListReleaseConfigsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * List of release configs. */ releaseConfigs?: ReleaseConfig[]; /** * Locations which could not be reached. */ unreachable?: string[]; } /** * `ListRepositories` response message. */ export interface ListRepositoriesResponse { /** * A token which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * List of repositories. */ repositories?: Repository[]; /** * Locations which could not be reached. */ unreachable?: string[]; } /** * `ListWorkflowConfigs` response message. */ export interface ListWorkflowConfigsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * Locations which could not be reached. */ unreachable?: string[]; /** * List of workflow configs. */ workflowConfigs?: WorkflowConfig[]; } /** * `ListWorkflowInvocations` response message. */ export interface ListWorkflowInvocationsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * Locations which could not be reached. */ unreachable?: string[]; /** * List of workflow invocations. */ workflowInvocations?: WorkflowInvocation[]; } /** * `ListWorkspaces` response message. */ export interface ListWorkspacesResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * Locations which could not be reached. */ unreachable?: string[]; /** * List of workspaces. */ workspaces?: Workspace[]; } /** * A resource that represents Google Cloud Platform 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; } /** * `MakeDirectory` request message. */ export interface MakeDirectoryRequest { /** * Required. The directory's full path including directory name, relative to * the workspace root. */ path?: string; } /** * `MakeDirectory` response message. */ export interface MakeDirectoryResponse { } /** * `MoveDirectory` request message. */ export interface MoveDirectoryRequest { /** * Required. The new path for the directory including directory name, rooted * at workspace root. */ newPath?: string; /** * Required. The directory's full path including directory name, relative to * the workspace root. */ path?: string; } /** * `MoveDirectory` response message. */ export interface MoveDirectoryResponse { } /** * `MoveFile` request message. */ export interface MoveFileRequest { /** * Required. The file's new path including filename, relative to the * workspace root. */ newPath?: string; /** * Required. The file's full path including filename, relative to the * workspace root. */ path?: string; } /** * `MoveFile` response message. */ export interface MoveFileResponse { } /** * Represents the metadata of the long-running operation. */ export interface OperationMetadata { /** * Output only. API version used to start the operation. */ readonly apiVersion?: string; /** * Output only. Identifies whether the user has requested cancellation of the * operation. Operations that have been cancelled successfully have * Operation.error value with a google.rpc.Status.code of 1, corresponding to * `Code.CANCELLED`. */ readonly cancelRequested?: boolean; /** * Output only. The time the operation was created. */ readonly createTime?: Date; /** * Output only. The time the operation finished running. */ readonly endTime?: Date; /** * Output only. Human-readable status of the operation, if any. */ readonly statusDetail?: string; /** * Output only. Server-defined resource path for the target of the operation. */ readonly target?: string; /** * Output only. Name of the verb executed by the operation. */ readonly verb?: string; } /** * Represents a list of arbitrary database operations. */ export interface Operations { /** * A list of actions that this action depends on. */ dependencyTargets?: Target[]; /** * Whether this action is disabled (i.e. should not be run). */ disabled?: boolean; /** * Whether these operations produce an output relation. */ hasOutput?: boolean; /** * A list of arbitrary SQL statements that will be executed without * alteration. */ queries?: string[]; /** * Descriptor for any output relation and its columns. Only set if * `has_output` is true. */ relationDescriptor?: RelationDescriptor; /** * Arbitrary, user-defined tags on this action. */ tags?: string[]; } /** * Additional options for Dataform#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * If true, the returned list will include locations which are not yet * revealed. */ includeUnrevealedLocations?: boolean; /** * 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 * Dataform#projectsLocationsRepositoriesCompilationResultsList. */ export interface ProjectsLocationsRepositoriesCompilationResultsListOptions { /** * Optional. Maximum number of compilation results to return. The server may * return fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous `ListCompilationResults` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListCompilationResults` must match the call * that provided the page token. */ pageToken?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesCompilationResultsQuery. */ export interface ProjectsLocationsRepositoriesCompilationResultsQueryOptions { /** * Optional. Optional filter for the returned list. Filtering is only * currently supported on the `file_path` field. */ filter?: string; /** * Optional. Maximum number of compilation results to return. The server may * return fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous * `QueryCompilationResultActions` call. Provide this to retrieve the * subsequent page. When paginating, all other parameters provided to * `QueryCompilationResultActions` must match the call that provided the page * token. */ pageToken?: string; } /** * Additional options for Dataform#projectsLocationsRepositoriesCreate. */ export interface ProjectsLocationsRepositoriesCreateOptions { /** * Required. The ID to use for the repository, which will become the final * component of the repository's resource name. */ repositoryId?: string; } /** * Additional options for Dataform#projectsLocationsRepositoriesDelete. */ export interface ProjectsLocationsRepositoriesDeleteOptions { /** * If set to true, any child resources of this repository will also be * deleted. (Otherwise, the request will only succeed if the repository has no * child resources.) */ force?: boolean; } /** * Additional options for Dataform#projectsLocationsRepositoriesList. */ export interface ProjectsLocationsRepositoriesListOptions { /** * Optional. Filter for the returned list. */ filter?: string; /** * Optional. This field only supports ordering by `name`. If unspecified, the * server will choose the ordering. If specified, the default order is * ascending for the `name` field. */ orderBy?: string; /** * Optional. Maximum number of repositories to return. The server may return * fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous `ListRepositories` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListRepositories` must match the call that provided * the page token. */ pageToken?: string; } /** * Additional options for Dataform#projectsLocationsRepositoriesPatch. */ export interface ProjectsLocationsRepositoriesPatchOptions { /** * Optional. Specifies the fields to be updated in the repository. If left * unset, all fields will be updated. */ updateMask?: string /* FieldMask */; } 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 * Dataform#projectsLocationsRepositoriesReleaseConfigsCreate. */ export interface ProjectsLocationsRepositoriesReleaseConfigsCreateOptions { /** * Required. The ID to use for the release config, which will become the * final component of the release config's resource name. */ releaseConfigId?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesReleaseConfigsList. */ export interface ProjectsLocationsRepositoriesReleaseConfigsListOptions { /** * Optional. Maximum number of release configs to return. The server may * return fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous `ListReleaseConfigs` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListReleaseConfigs` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesReleaseConfigsPatch. */ export interface ProjectsLocationsRepositoriesReleaseConfigsPatchOptions { /** * Optional. Specifies the fields to be updated in the release config. If * left unset, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesReleaseConfigsPatchOptions(data: any): ProjectsLocationsRepositoriesReleaseConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesReleaseConfigsPatchOptions(data: any): ProjectsLocationsRepositoriesReleaseConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkflowConfigsCreate. */ export interface ProjectsLocationsRepositoriesWorkflowConfigsCreateOptions { /** * Required. The ID to use for the workflow config, which will become the * final component of the workflow config's resource name. */ workflowConfigId?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkflowConfigsList. */ export interface ProjectsLocationsRepositoriesWorkflowConfigsListOptions { /** * Optional. Maximum number of workflow configs to return. The server may * return fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous `ListWorkflowConfigs` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListWorkflowConfigs` must match the call that * provided the page token. */ pageToken?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkflowConfigsPatch. */ export interface ProjectsLocationsRepositoriesWorkflowConfigsPatchOptions { /** * Optional. Specifies the fields to be updated in the workflow config. If * left unset, all fields will be updated. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesWorkflowConfigsPatchOptions(data: any): ProjectsLocationsRepositoriesWorkflowConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesWorkflowConfigsPatchOptions(data: any): ProjectsLocationsRepositoriesWorkflowConfigsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkflowInvocationsList. */ export interface ProjectsLocationsRepositoriesWorkflowInvocationsListOptions { /** * Optional. Filter for the returned list. */ filter?: string; /** * Optional. This field only supports ordering by `name`. If unspecified, the * server will choose the ordering. If specified, the default order is * ascending for the `name` field. */ orderBy?: string; /** * Optional. Maximum number of workflow invocations to return. The server may * return fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous `ListWorkflowInvocations` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `ListWorkflowInvocations` must match the call * that provided the page token. */ pageToken?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkflowInvocationsQuery. */ export interface ProjectsLocationsRepositoriesWorkflowInvocationsQueryOptions { /** * Optional. Maximum number of workflow invocations to return. The server may * return fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous * `QueryWorkflowInvocationActions` call. Provide this to retrieve the * subsequent page. When paginating, all other parameters provided to * `QueryWorkflowInvocationActions` must match the call that provided the page * token. */ pageToken?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkspacesCreate. */ export interface ProjectsLocationsRepositoriesWorkspacesCreateOptions { /** * Required. The ID to use for the workspace, which will become the final * component of the workspace's resource name. */ workspaceId?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkspacesFetchFileDiff. */ export interface ProjectsLocationsRepositoriesWorkspacesFetchFileDiffOptions { /** * Required. The file's full path including filename, relative to the * workspace root. */ path?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkspacesFetchGitAheadBehind. */ export interface ProjectsLocationsRepositoriesWorkspacesFetchGitAheadBehindOptions { /** * Optional. The name of the branch in the Git remote against which this * workspace should be compared. If left unset, the repository's default * branch name will be used. */ remoteBranch?: string; } /** * Additional options for Dataform#projectsLocationsRepositoriesWorkspacesList. */ export interface ProjectsLocationsRepositoriesWorkspacesListOptions { /** * Optional. Filter for the returned list. */ filter?: string; /** * Optional. This field only supports ordering by `name`. If unspecified, the * server will choose the ordering. If specified, the default order is * ascending for the `name` field. */ orderBy?: string; /** * Optional. Maximum number of workspaces to return. The server may return * fewer items than requested. If unspecified, the server will pick an * appropriate default. */ pageSize?: number; /** * Optional. Page token received from a previous `ListWorkspaces` call. * Provide this to retrieve the subsequent page. When paginating, all other * parameters provided to `ListWorkspaces` must match the call that provided * the page token. */ pageToken?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkspacesQueryDirectoryContents. */ export interface ProjectsLocationsRepositoriesWorkspacesQueryDirectoryContentsOptions { /** * Optional. Maximum number of paths to return. The server may return fewer * items than requested. If unspecified, the server will pick an appropriate * default. */ pageSize?: number; /** * Optional. Page token received from a previous `QueryDirectoryContents` * call. Provide this to retrieve the subsequent page. When paginating, all * other parameters provided to `QueryDirectoryContents` must match the call * that provided the page token. */ pageToken?: string; /** * Optional. The directory's full path including directory name, relative to * the workspace root. If left unset, the workspace root is used. */ path?: string; } /** * Additional options for * Dataform#projectsLocationsRepositoriesWorkspacesReadFile. */ export interface ProjectsLocationsRepositoriesWorkspacesReadFileOptions { /** * Required. The file's full path including filename, relative to the * workspace root. */ path?: string; } /** * `PullGitCommits` request message. */ export interface PullGitCommitsRequest { /** * Required. The author of any merge commit which may be created as a result * of merging fetched Git commits into this workspace. */ author?: CommitAuthor; /** * Optional. The name of the branch in the Git remote from which to pull * commits. If left unset, the repository's default branch name will be used. */ remoteBranch?: string; } /** * `PushGitCommits` request message. */ export interface PushGitCommitsRequest { /** * Optional. The name of the branch in the Git remote to which commits should * be pushed. If left unset, the repository's default branch name will be * used. */ remoteBranch?: string; } /** * `QueryCompilationResultActions` response message. */ export interface QueryCompilationResultActionsResponse { /** * List of compilation result actions. */ compilationResultActions?: CompilationResultAction[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * `QueryDirectoryContents` response message. */ export interface QueryDirectoryContentsResponse { /** * List of entries in the directory. */ directoryEntries?: DirectoryEntry[]; /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; } /** * `QueryWorkflowInvocationActions` response message. */ export interface QueryWorkflowInvocationActionsResponse { /** * A token, which can be sent as `page_token` to retrieve the next page. If * this field is omitted, there are no subsequent pages. */ nextPageToken?: string; /** * List of workflow invocation actions. */ workflowInvocationActions?: WorkflowInvocationAction[]; } /** * `ReadFile` response message. */ export interface ReadFileResponse { /** * The file's contents. */ fileContents?: Uint8Array; } function serializeReadFileResponse(data: any): ReadFileResponse { return { ...data, fileContents: data["fileContents"] !== undefined ? encodeBase64(data["fileContents"]) : undefined, }; } function deserializeReadFileResponse(data: any): ReadFileResponse { return { ...data, fileContents: data["fileContents"] !== undefined ? decodeBase64(data["fileContents"] as string) : undefined, }; } /** * Represents a database relation. */ export interface Relation { /** * Additional options that will be provided as key/value pairs into the * options clause of a create table/view statement. See * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language * for more information on which options are supported. */ additionalOptions?: { [key: string]: string }; /** * A list of columns or SQL expressions used to cluster the table. */ clusterExpressions?: string[]; /** * A list of actions that this action depends on. */ dependencyTargets?: Target[]; /** * Whether this action is disabled (i.e. should not be run). */ disabled?: boolean; /** * Configures `INCREMENTAL_TABLE` settings for this relation. Only set if * `relation_type` is `INCREMENTAL_TABLE`. */ incrementalTableConfig?: IncrementalTableConfig; /** * Sets the partition expiration in days. */ partitionExpirationDays?: number; /** * The SQL expression used to partition the relation. */ partitionExpression?: string; /** * SQL statements to be executed after creating the relation. */ postOperations?: string[]; /** * SQL statements to be executed before creating the relation. */ preOperations?: string[]; /** * Descriptor for the relation and its columns. */ relationDescriptor?: RelationDescriptor; /** * The type of this relation. */ relationType?: | "RELATION_TYPE_UNSPECIFIED" | "TABLE" | "VIEW" | "INCREMENTAL_TABLE" | "MATERIALIZED_VIEW"; /** * Specifies whether queries on this table must include a predicate filter * that filters on the partitioning column. */ requirePartitionFilter?: boolean; /** * The SELECT query which returns rows which this relation should contain. */ selectQuery?: string; /** * Arbitrary, user-defined tags on this action. */ tags?: string[]; } /** * Describes a relation and its columns. */ export interface RelationDescriptor { /** * A set of BigQuery labels that should be applied to the relation. */ bigqueryLabels?: { [key: string]: string }; /** * A list of descriptions of columns within the relation. */ columns?: ColumnDescriptor[]; /** * A text description of the relation. */ description?: string; } /** * Represents a Dataform release configuration. */ export interface ReleaseConfig { /** * Optional. If set, fields of `code_compilation_config` override the default * compilation settings that are specified in dataform.json. */ codeCompilationConfig?: CodeCompilationConfig; /** * Optional. Optional schedule (in cron format) for automatic creation of * compilation results. */ cronSchedule?: string; /** * Required. Git commit/tag/branch name at which the repository should be * compiled. Must exist in the remote repository. Examples: - a commit SHA: * `12ade345` - a tag: `tag1` - a branch name: `branch1` */ gitCommitish?: string; /** * Output only. The release config's name. */ readonly name?: string; /** * Output only. Records of the 10 most recent scheduled release attempts. * Updated whenever automatic creation of a compilation result is triggered by * cron_schedule. */ readonly recentScheduledReleaseRecords?: ScheduledReleaseRecord[]; /** * Optional. The name of the currently released compilation result for this * release config. This value is updated when a compilation result is created * from this release config, or when this resource is updated by API call * (perhaps to roll back to an earlier release). The compilation result must * have been created using this release config. Must be in the format * `projects/*\/locations/*\/repositories/*\/compilationResults/*`. */ releaseCompilationResult?: string; /** * Optional. Specifies the time zone to be used when interpreting * cron_schedule. Must be a time zone name from the time zone database * (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left * unspecified, the default is UTC. */ timeZone?: string; } /** * `RemoveDirectory` request message. */ export interface RemoveDirectoryRequest { /** * Required. The directory's full path including directory name, relative to * the workspace root. */ path?: string; } /** * `RemoveFile` request message. */ export interface RemoveFileRequest { /** * Required. The file's full path including filename, relative to the * workspace root. */ path?: string; } /** * Represents a Dataform Git repository. */ export interface Repository { /** * Optional. If set, configures this repository to be linked to a Git remote. */ gitRemoteSettings?: GitRemoteSettings; /** * Output only. The repository's name. */ readonly name?: string; /** * Optional. The name of the Secret Manager secret version to be used to * interpolate variables into the .npmrc file for package installation * operations. Must be in the format `projects/*\/secrets/*\/versions/*`. The * file itself must be in a JSON format. */ npmrcEnvironmentVariablesSecretVersion?: string; } /** * `ResetWorkspaceChanges` request message. */ export interface ResetWorkspaceChangesRequest { /** * Optional. If set to true, untracked files will be deleted. */ clean?: boolean; /** * Optional. Full file paths to reset back to their committed state including * filename, rooted at workspace root. If left empty, all files will be reset. */ paths?: string[]; } /** * A record of an attempt to create a workflow invocation for this workflow * config. */ export interface ScheduledExecutionRecord { /** * The error status encountered upon this attempt to create the workflow * invocation, if the attempt was unsuccessful. */ errorStatus?: Status; /** * The timestamp of this execution attempt. */ executionTime?: Date; /** * The name of the created workflow invocation, if one was successfully * created. Must be in the format * `projects/*\/locations/*\/repositories/*\/workflowInvocations/*`. */ workflowInvocation?: string; } function serializeScheduledExecutionRecord(data: any): ScheduledExecutionRecord { return { ...data, executionTime: data["executionTime"] !== undefined ? data["executionTime"].toISOString() : undefined, }; } function deserializeScheduledExecutionRecord(data: any): ScheduledExecutionRecord { return { ...data, executionTime: data["executionTime"] !== undefined ? new Date(data["executionTime"]) : undefined, }; } /** * A record of an attempt to create a compilation result for this release * config. */ export interface ScheduledReleaseRecord { /** * The name of the created compilation result, if one was successfully * created. Must be in the format * `projects/*\/locations/*\/repositories/*\/compilationResults/*`. */ compilationResult?: string; /** * The error status encountered upon this attempt to create the compilation * result, if the attempt was unsuccessful. */ errorStatus?: Status; /** * The timestamp of this release attempt. */ releaseTime?: Date; } function serializeScheduledReleaseRecord(data: any): ScheduledReleaseRecord { return { ...data, releaseTime: data["releaseTime"] !== undefined ? data["releaseTime"].toISOString() : undefined, }; } function deserializeScheduledReleaseRecord(data: any): ScheduledReleaseRecord { return { ...data, releaseTime: data["releaseTime"] !== undefined ? new Date(data["releaseTime"]) : 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; } /** * Represents an action identifier. If the action writes output, the output * will be written to the referenced database object. */ export interface Target { /** * The action's database (Google Cloud project ID) . */ database?: string; /** * The action's name, within `database` and `schema`. */ name?: string; /** * The action's schema (BigQuery dataset ID), within `database`. */ schema?: string; } /** * Represents the Git state of a file with uncommitted changes. */ export interface UncommittedFileChange { /** * The file's full path including filename, relative to the workspace root. */ path?: string; /** * Indicates the status of the file. */ state?: | "STATE_UNSPECIFIED" | "ADDED" | "DELETED" | "MODIFIED" | "HAS_CONFLICTS"; } /** * Represents a Dataform workflow configuration. */ export interface WorkflowConfig { /** * Optional. Optional schedule (in cron format) for automatic execution of * this workflow config. */ cronSchedule?: string; /** * Optional. If left unset, a default InvocationConfig will be used. */ invocationConfig?: InvocationConfig; /** * Output only. The workflow config's name. */ readonly name?: string; /** * Output only. Records of the 10 most recent scheduled execution attempts. * Updated whenever automatic creation of a compilation result is triggered by * cron_schedule. */ readonly recentScheduledExecutionRecords?: ScheduledExecutionRecord[]; /** * Required. The name of the release config whose release_compilation_result * should be executed. Must be in the format * `projects/*\/locations/*\/repositories/*\/releaseConfigs/*`. */ releaseConfig?: string; /** * Optional. Specifies the time zone to be used when interpreting * cron_schedule. Must be a time zone name from the time zone database * (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left * unspecified, the default is UTC. */ timeZone?: string; } /** * Represents a single invocation of a compilation result. */ export interface WorkflowInvocation { /** * Immutable. The name of the compilation result to compile. Must be in the * format `projects/*\/locations/*\/repositories/*\/compilationResults/*`. */ compilationResult?: string; /** * Immutable. If left unset, a default InvocationConfig will be used. */ invocationConfig?: InvocationConfig; /** * Output only. This workflow invocation's timing details. */ readonly invocationTiming?: Interval; /** * Output only. The workflow invocation's name. */ readonly name?: string; /** * Output only. This workflow invocation's current state. */ readonly state?: | "STATE_UNSPECIFIED" | "RUNNING" | "SUCCEEDED" | "CANCELLED" | "FAILED" | "CANCELING"; /** * Immutable. The name of the workflow config to invoke. Must be in the * format `projects/*\/locations/*\/repositories/*\/workflowConfigs/*`. */ workflowConfig?: string; } /** * Represents a single action in a workflow invocation. */ export interface WorkflowInvocationAction { /** * Output only. The workflow action's bigquery action details. */ readonly bigqueryAction?: BigQueryAction; /** * Output only. The action's identifier if the project had been compiled * without any overrides configured. Unique within the compilation result. */ readonly canonicalTarget?: Target; /** * Output only. If and only if action's state is FAILED a failure reason is * set. */ readonly failureReason?: string; /** * Output only. This action's timing details. `start_time` will be set if the * action is in [RUNNING, SUCCEEDED, CANCELLED, FAILED] state. `end_time` will * be set if the action is in [SUCCEEDED, CANCELLED, FAILED] state. */ readonly invocationTiming?: Interval; /** * Output only. This action's current state. */ readonly state?: | "PENDING" | "RUNNING" | "SKIPPED" | "DISABLED" | "SUCCEEDED" | "CANCELLED" | "FAILED"; /** * Output only. This action's identifier. Unique within the workflow * invocation. */ readonly target?: Target; } /** * Represents a Dataform Git workspace. */ export interface Workspace { /** * Output only. The workspace's name. */ readonly name?: string; } /** * `WriteFile` request message. */ export interface WriteFileRequest { /** * Required. The file's contents. */ contents?: Uint8Array; /** * Required. The file. */ path?: string; } function serializeWriteFileRequest(data: any): WriteFileRequest { return { ...data, contents: data["contents"] !== undefined ? encodeBase64(data["contents"]) : undefined, }; } function deserializeWriteFileRequest(data: any): WriteFileRequest { return { ...data, contents: data["contents"] !== undefined ? decodeBase64(data["contents"] as string) : undefined, }; } /** * `WriteFile` response message. */ export interface WriteFileResponse { } 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; }