From a9d1965263563adf84a49e706d1b4d53b9543087 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 20 Aug 2022 00:58:18 +0000 Subject: [PATCH 1/2] fix: better support for fallback mode PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- owl-bot-staging/v1alpha2/.eslintignore | 7 + owl-bot-staging/v1alpha2/.eslintrc.json | 3 + owl-bot-staging/v1alpha2/.gitignore | 14 + owl-bot-staging/v1alpha2/.jsdoc.js | 55 + owl-bot-staging/v1alpha2/.mocharc.js | 33 + owl-bot-staging/v1alpha2/.prettierrc.js | 22 + owl-bot-staging/v1alpha2/README.md | 1 + .../v1alpha2/linkinator.config.json | 16 + owl-bot-staging/v1alpha2/package.json | 64 + .../cloud/dataform/v1alpha2/dataform.proto | 1628 +++++ .../dataform.cancel_workflow_invocation.js | 61 + .../dataform.commit_workspace_changes.js | 75 + .../dataform.create_compilation_result.js | 67 + .../v1alpha2/dataform.create_repository.js | 73 + .../dataform.create_workflow_invocation.js | 66 + .../v1alpha2/dataform.create_workspace.js | 73 + .../v1alpha2/dataform.delete_repository.js | 67 + .../dataform.delete_workflow_invocation.js | 61 + .../v1alpha2/dataform.delete_workspace.js | 61 + .../v1alpha2/dataform.fetch_file_diff.js | 66 + .../dataform.fetch_file_git_statuses.js | 61 + .../dataform.fetch_git_ahead_behind.js | 67 + .../dataform.fetch_remote_branches.js | 61 + .../dataform.get_compilation_result.js | 61 + .../v1alpha2/dataform.get_repository.js | 61 + .../dataform.get_workflow_invocation.js | 61 + .../v1alpha2/dataform.get_workspace.js | 61 + .../v1alpha2/dataform.install_npm_packages.js | 61 + .../dataform.list_compilation_results.js | 77 + .../v1alpha2/dataform.list_repositories.js | 87 + .../dataform.list_workflow_invocations.js | 77 + .../v1alpha2/dataform.list_workspaces.js | 87 + .../v1alpha2/dataform.make_directory.js | 67 + .../v1alpha2/dataform.move_directory.js | 73 + .../generated/v1alpha2/dataform.move_file.js | 71 + .../v1alpha2/dataform.pull_git_commits.js | 72 + .../v1alpha2/dataform.push_git_commits.js | 66 + ...taform.query_compilation_result_actions.js | 82 + .../dataform.query_directory_contents.js | 82 + ...aform.query_workflow_invocation_actions.js | 77 + .../generated/v1alpha2/dataform.read_file.js | 66 + .../v1alpha2/dataform.remove_directory.js | 67 + .../v1alpha2/dataform.remove_file.js | 66 + .../dataform.reset_workspace_changes.js | 70 + .../v1alpha2/dataform.update_repository.js | 66 + .../generated/v1alpha2/dataform.write_file.js | 71 + ...tadata.google.cloud.dataform.v1alpha2.json | 1647 ++++++ owl-bot-staging/v1alpha2/src/index.ts | 25 + .../v1alpha2/src/v1alpha2/dataform_client.ts | 4387 ++++++++++++++ .../src/v1alpha2/dataform_client_config.json | 170 + .../src/v1alpha2/dataform_proto_list.json | 3 + .../v1alpha2/src/v1alpha2/gapic_metadata.json | 411 ++ .../v1alpha2/src/v1alpha2/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1alpha2/system-test/install.ts | 49 + .../v1alpha2/test/gapic_dataform_v1alpha2.ts | 5251 +++++++++++++++++ owl-bot-staging/v1alpha2/tsconfig.json | 19 + owl-bot-staging/v1alpha2/webpack.config.js | 64 + owl-bot-staging/v1beta1/.eslintignore | 7 + owl-bot-staging/v1beta1/.eslintrc.json | 3 + owl-bot-staging/v1beta1/.gitignore | 14 + owl-bot-staging/v1beta1/.jsdoc.js | 55 + owl-bot-staging/v1beta1/.mocharc.js | 33 + owl-bot-staging/v1beta1/.prettierrc.js | 22 + owl-bot-staging/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 16 + owl-bot-staging/v1beta1/package.json | 64 + .../cloud/dataform/v1beta1/dataform.proto | 1629 +++++ .../dataform.cancel_workflow_invocation.js | 61 + .../dataform.commit_workspace_changes.js | 75 + .../dataform.create_compilation_result.js | 67 + .../v1beta1/dataform.create_repository.js | 73 + .../dataform.create_workflow_invocation.js | 67 + .../v1beta1/dataform.create_workspace.js | 73 + .../v1beta1/dataform.delete_repository.js | 67 + .../dataform.delete_workflow_invocation.js | 61 + .../v1beta1/dataform.delete_workspace.js | 61 + .../v1beta1/dataform.fetch_file_diff.js | 66 + .../dataform.fetch_file_git_statuses.js | 61 + .../dataform.fetch_git_ahead_behind.js | 67 + .../v1beta1/dataform.fetch_remote_branches.js | 61 + .../dataform.get_compilation_result.js | 61 + .../v1beta1/dataform.get_repository.js | 61 + .../dataform.get_workflow_invocation.js | 61 + .../v1beta1/dataform.get_workspace.js | 61 + .../v1beta1/dataform.install_npm_packages.js | 61 + .../dataform.list_compilation_results.js | 77 + .../v1beta1/dataform.list_repositories.js | 87 + .../dataform.list_workflow_invocations.js | 77 + .../v1beta1/dataform.list_workspaces.js | 87 + .../v1beta1/dataform.make_directory.js | 67 + .../v1beta1/dataform.move_directory.js | 73 + .../generated/v1beta1/dataform.move_file.js | 71 + .../v1beta1/dataform.pull_git_commits.js | 72 + .../v1beta1/dataform.push_git_commits.js | 66 + ...taform.query_compilation_result_actions.js | 82 + .../dataform.query_directory_contents.js | 82 + ...aform.query_workflow_invocation_actions.js | 77 + .../generated/v1beta1/dataform.read_file.js | 66 + .../v1beta1/dataform.remove_directory.js | 67 + .../generated/v1beta1/dataform.remove_file.js | 66 + .../dataform.reset_workspace_changes.js | 70 + .../v1beta1/dataform.update_repository.js | 66 + .../generated/v1beta1/dataform.write_file.js | 71 + ...etadata.google.cloud.dataform.v1beta1.json | 1647 ++++++ owl-bot-staging/v1beta1/src/index.ts | 25 + .../v1beta1/src/v1beta1/dataform_client.ts | 4388 ++++++++++++++ .../src/v1beta1/dataform_client_config.json | 170 + .../src/v1beta1/dataform_proto_list.json | 3 + .../v1beta1/src/v1beta1/gapic_metadata.json | 411 ++ owl-bot-staging/v1beta1/src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1beta1/system-test/install.ts | 49 + .../v1beta1/test/gapic_dataform_v1beta1.ts | 5251 +++++++++++++++++ owl-bot-staging/v1beta1/tsconfig.json | 19 + owl-bot-staging/v1beta1/webpack.config.js | 64 + 118 files changed, 32873 insertions(+) create mode 100644 owl-bot-staging/v1alpha2/.eslintignore create mode 100644 owl-bot-staging/v1alpha2/.eslintrc.json create mode 100644 owl-bot-staging/v1alpha2/.gitignore create mode 100644 owl-bot-staging/v1alpha2/.jsdoc.js create mode 100644 owl-bot-staging/v1alpha2/.mocharc.js create mode 100644 owl-bot-staging/v1alpha2/.prettierrc.js create mode 100644 owl-bot-staging/v1alpha2/README.md create mode 100644 owl-bot-staging/v1alpha2/linkinator.config.json create mode 100644 owl-bot-staging/v1alpha2/package.json create mode 100644 owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js create mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json create mode 100644 owl-bot-staging/v1alpha2/src/index.ts create mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts create mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json create mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json create mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json create mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/index.ts create mode 100644 owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1alpha2/system-test/install.ts create mode 100644 owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts create mode 100644 owl-bot-staging/v1alpha2/tsconfig.json create mode 100644 owl-bot-staging/v1alpha2/webpack.config.js create mode 100644 owl-bot-staging/v1beta1/.eslintignore create mode 100644 owl-bot-staging/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/v1beta1/.gitignore create mode 100644 owl-bot-staging/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/v1beta1/README.md create mode 100644 owl-bot-staging/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/v1beta1/package.json create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js create mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json create mode 100644 owl-bot-staging/v1beta1/src/index.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/v1beta1/webpack.config.js diff --git a/owl-bot-staging/v1alpha2/.eslintignore b/owl-bot-staging/v1alpha2/.eslintignore new file mode 100644 index 0000000..cfc348e --- /dev/null +++ b/owl-bot-staging/v1alpha2/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1alpha2/.eslintrc.json b/owl-bot-staging/v1alpha2/.eslintrc.json new file mode 100644 index 0000000..7821534 --- /dev/null +++ b/owl-bot-staging/v1alpha2/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1alpha2/.gitignore b/owl-bot-staging/v1alpha2/.gitignore new file mode 100644 index 0000000..5d32b23 --- /dev/null +++ b/owl-bot-staging/v1alpha2/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1alpha2/.jsdoc.js b/owl-bot-staging/v1alpha2/.jsdoc.js new file mode 100644 index 0000000..166ea79 --- /dev/null +++ b/owl-bot-staging/v1alpha2/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dataform', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1alpha2/.mocharc.js b/owl-bot-staging/v1alpha2/.mocharc.js new file mode 100644 index 0000000..481c522 --- /dev/null +++ b/owl-bot-staging/v1alpha2/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1alpha2/.prettierrc.js b/owl-bot-staging/v1alpha2/.prettierrc.js new file mode 100644 index 0000000..494e147 --- /dev/null +++ b/owl-bot-staging/v1alpha2/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1alpha2/README.md b/owl-bot-staging/v1alpha2/README.md new file mode 100644 index 0000000..cd744d1 --- /dev/null +++ b/owl-bot-staging/v1alpha2/README.md @@ -0,0 +1 @@ +Dataform: Nodejs Client diff --git a/owl-bot-staging/v1alpha2/linkinator.config.json b/owl-bot-staging/v1alpha2/linkinator.config.json new file mode 100644 index 0000000..befd23c --- /dev/null +++ b/owl-bot-staging/v1alpha2/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v1alpha2/package.json b/owl-bot-staging/v1alpha2/package.json new file mode 100644 index 0000000..8b0851c --- /dev/null +++ b/owl-bot-staging/v1alpha2/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/dataform", + "version": "0.1.0", + "description": "Dataform client for Node.js", + "repository": "googleapis/nodejs-dataform", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google dataform", + "dataform", + "dataform" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.2.0" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.50", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.2", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.7.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto b/owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto new file mode 100644 index 0000000..771acdb --- /dev/null +++ b/owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto @@ -0,0 +1,1628 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataform.v1alpha2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.Dataform.V1Alpha2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataform/v1alpha2;dataform"; +option java_multiple_files = true; +option java_outer_classname = "DataformProto"; +option java_package = "com.google.cloud.dataform.v1alpha2"; +option php_namespace = "Google\\Cloud\\Dataform\\V1alpha2"; +option ruby_package = "Google::Cloud::Dataform::V1alpha2"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; + +// Dataform is a service to develop, create, document, test, and update curated +// tables in BigQuery. +service Dataform { + option (google.api.default_host) = "dataform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Repositories in a given project and location. + rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) { + option (google.api.http) = { + get: "/v1alpha2/{parent=projects/*/locations/*}/repositories" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single Repository. + rpc GetRepository(GetRepositoryRequest) returns (Repository) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Repository in a given project and location. + rpc CreateRepository(CreateRepositoryRequest) returns (Repository) { + option (google.api.http) = { + post: "/v1alpha2/{parent=projects/*/locations/*}/repositories" + body: "repository" + }; + option (google.api.method_signature) = "parent,repository,repository_id"; + } + + // Updates a single Repository. + rpc UpdateRepository(UpdateRepositoryRequest) returns (Repository) { + option (google.api.http) = { + patch: "/v1alpha2/{repository.name=projects/*/locations/*/repositories/*}" + body: "repository" + }; + option (google.api.method_signature) = "repository,update_mask"; + } + + // Deletes a single Repository. + rpc DeleteRepository(DeleteRepositoryRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha2/{name=projects/*/locations/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Fetches a Repository's remote branches. + rpc FetchRemoteBranches(FetchRemoteBranchesRequest) returns (FetchRemoteBranchesResponse) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*}:fetchRemoteBranches" + }; + } + + // Lists Workspaces in a given Repository. + rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) { + option (google.api.http) = { + get: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workspaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single Workspace. + rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Workspace in a given Repository. + rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) { + option (google.api.http) = { + post: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workspaces" + body: "workspace" + }; + option (google.api.method_signature) = "parent,workspace,workspace_id"; + } + + // Deletes a single Workspace. + rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Installs dependency NPM packages (inside a Workspace). + rpc InstallNpmPackages(InstallNpmPackagesRequest) returns (InstallNpmPackagesResponse) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:installNpmPackages" + body: "*" + }; + } + + // Pulls Git commits from the Repository's remote into a Workspace. + rpc PullGitCommits(PullGitCommitsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:pull" + body: "*" + }; + } + + // Pushes Git commits from a Workspace to the Repository's remote. + rpc PushGitCommits(PushGitCommitsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:push" + body: "*" + }; + } + + // Fetches Git statuses for the files in a Workspace. + rpc FetchFileGitStatuses(FetchFileGitStatusesRequest) returns (FetchFileGitStatusesResponse) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileGitStatuses" + }; + } + + // Fetches Git ahead/behind against a remote branch. + rpc FetchGitAheadBehind(FetchGitAheadBehindRequest) returns (FetchGitAheadBehindResponse) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind" + }; + } + + // Applies a Git commit for uncommitted files in a Workspace. + rpc CommitWorkspaceChanges(CommitWorkspaceChangesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:commit" + body: "*" + }; + } + + // Performs a Git reset for uncommitted files in a Workspace. + rpc ResetWorkspaceChanges(ResetWorkspaceChangesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:reset" + body: "*" + }; + } + + // Fetches Git diff for an uncommitted file in a Workspace. + rpc FetchFileDiff(FetchFileDiffRequest) returns (FetchFileDiffResponse) { + option (google.api.http) = { + get: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileDiff" + }; + } + + // Returns the contents of a given Workspace directory. + rpc QueryDirectoryContents(QueryDirectoryContentsRequest) returns (QueryDirectoryContentsResponse) { + option (google.api.http) = { + get: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents" + }; + } + + // Creates a directory inside a Workspace. + rpc MakeDirectory(MakeDirectoryRequest) returns (MakeDirectoryResponse) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:makeDirectory" + body: "*" + }; + } + + // Deletes a directory (inside a Workspace) and all of its contents. + rpc RemoveDirectory(RemoveDirectoryRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeDirectory" + body: "*" + }; + } + + // Moves a directory (inside a Workspace), and all of its contents, to a new + // location. + rpc MoveDirectory(MoveDirectoryRequest) returns (MoveDirectoryResponse) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveDirectory" + body: "*" + }; + } + + // Returns the contents of a file (inside a Workspace). + rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) { + option (google.api.http) = { + get: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile" + }; + } + + // Deletes a file (inside a Workspace). + rpc RemoveFile(RemoveFileRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeFile" + body: "*" + }; + } + + // Moves a file (inside a Workspace) to a new location. + rpc MoveFile(MoveFileRequest) returns (MoveFileResponse) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveFile" + body: "*" + }; + } + + // Writes to a file (inside a Workspace). + rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) { + option (google.api.http) = { + post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:writeFile" + body: "*" + }; + } + + // Lists CompilationResults in a given Repository. + rpc ListCompilationResults(ListCompilationResultsRequest) returns (ListCompilationResultsResponse) { + option (google.api.http) = { + get: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/compilationResults" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single CompilationResult. + rpc GetCompilationResult(GetCompilationResultRequest) returns (CompilationResult) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/compilationResults/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new CompilationResult in a given project and location. + rpc CreateCompilationResult(CreateCompilationResultRequest) returns (CompilationResult) { + option (google.api.http) = { + post: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/compilationResults" + body: "compilation_result" + }; + option (google.api.method_signature) = "parent,compilation_result"; + } + + // Returns CompilationResultActions in a given CompilationResult. + rpc QueryCompilationResultActions(QueryCompilationResultActionsRequest) returns (QueryCompilationResultActionsResponse) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/compilationResults/*}:query" + }; + } + + // Lists WorkflowInvocations in a given Repository. + rpc ListWorkflowInvocations(ListWorkflowInvocationsRequest) returns (ListWorkflowInvocationsResponse) { + option (google.api.http) = { + get: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single WorkflowInvocation. + rpc GetWorkflowInvocation(GetWorkflowInvocationRequest) returns (WorkflowInvocation) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new WorkflowInvocation in a given Repository. + rpc CreateWorkflowInvocation(CreateWorkflowInvocationRequest) returns (WorkflowInvocation) { + option (google.api.http) = { + post: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" + body: "workflow_invocation" + }; + option (google.api.method_signature) = "parent,workflow_invocation"; + } + + // Deletes a single WorkflowInvocation. + rpc DeleteWorkflowInvocation(DeleteWorkflowInvocationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Requests cancellation of a running WorkflowInvocation. + rpc CancelWorkflowInvocation(CancelWorkflowInvocationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:cancel" + body: "*" + }; + } + + // Returns WorkflowInvocationActions in a given WorkflowInvocation. + rpc QueryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest) returns (QueryWorkflowInvocationActionsResponse) { + option (google.api.http) = { + get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:query" + }; + } +} + +// Represents a Dataform Git repository. +message Repository { + option (google.api.resource) = { + type: "dataform.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/repositories/{repository}" + }; + + // Controls Git remote configuration for a repository. + message GitRemoteSettings { + // Indicates the status of a Git authentication token. + enum TokenStatus { + // Default value. This value is unused. + TOKEN_STATUS_UNSPECIFIED = 0; + + // The token could not be found in Secret Manager (or the Dataform + // Service Account did not have permission to access it). + NOT_FOUND = 1; + + // The token could not be used to authenticate against the Git remote. + INVALID = 2; + + // The token was used successfully to authenticate against the Git remote. + VALID = 3; + } + + // Required. The Git remote's URL. + string url = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Git remote's default branch name. + string default_branch = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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/*`. + string authentication_token_secret_version = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Output only. Indicates the status of the Git access token. + TokenStatus token_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The repository's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. If set, configures this repository to be linked to a Git remote. + GitRemoteSettings git_remote_settings = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListRepositories` request message. +message ListRepositoriesRequest { + // Required. The location in which to list repositories. Must be in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Maximum number of repositories to return. The server may return fewer + // items than requested. If unspecified, the server will pick an appropriate + // default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter for the returned list. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListRepositories` response message. +message ListRepositoriesResponse { + // List of repositories. + repeated Repository repositories = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetRepository` request message. +message GetRepositoryRequest { + // Required. The repository's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; +} + +// `CreateRepository` request message. +message CreateRepositoryRequest { + // Required. The location in which to create the repository. Must be in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The repository to create. + Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the repository, which will become the final component of + // the repository's resource name. + string repository_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `UpdateRepository` request message. +message UpdateRepositoryRequest { + // Optional. Specifies the fields to be updated in the repository. If left unset, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The repository to update. + Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `DeleteRepository` request message. +message DeleteRepositoryRequest { + // Required. The repository's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // 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.) + bool force = 2; +} + +// `FetchRemoteBranches` request message. +message FetchRemoteBranchesRequest { + // Required. The repository's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; +} + +// `FetchRemoteBranches` response message. +message FetchRemoteBranchesResponse { + // The remote repository's branch names. + repeated string branches = 1; +} + +// Represents a Dataform Git workspace. +message Workspace { + option (google.api.resource) = { + type: "dataform.googleapis.com/Workspace" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}" + }; + + // Output only. The workspace's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `ListWorkspaces` request message. +message ListWorkspacesRequest { + // Required. The repository in which to list workspaces. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Optional. Maximum number of workspaces to return. The server may return fewer + // items than requested. If unspecified, the server will pick an appropriate + // default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter for the returned list. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListWorkspaces` response message. +message ListWorkspacesResponse { + // List of workspaces. + repeated Workspace workspaces = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetWorkspace` request message. +message GetWorkspaceRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// `CreateWorkspace` request message. +message CreateWorkspaceRequest { + // Required. The repository in which to create the workspace. Must be in the format + // `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Required. The workspace to create. + Workspace workspace = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the workspace, which will become the final component of + // the workspace's resource name. + string workspace_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `DeleteWorkspace` request message. +message DeleteWorkspaceRequest { + // Required. The workspace resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// Represents the author of a Git commit. +message CommitAuthor { + // Required. The commit author's name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The commit author's email address. + string email_address = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `PullGitCommits` request message. +message PullGitCommitsRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The author of any merge commit which may be created as a result of merging + // fetched Git commits into this workspace. + CommitAuthor author = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `PushGitCommits` request message. +message PushGitCommitsRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `FetchFileGitStatuses` request message. +message FetchFileGitStatusesRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// `FetchFileGitStatuses` response message. +message FetchFileGitStatusesResponse { + // Represents the Git state of a file with uncommitted changes. + message UncommittedFileChange { + // Indicates the status of an uncommitted file change. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The file has been newly added. + ADDED = 1; + + // The file has been deleted. + DELETED = 2; + + // The file has been modified. + MODIFIED = 3; + + // The file contains merge conflicts. + HAS_CONFLICTS = 4; + } + + // The file's full path including filename, relative to the workspace root. + string path = 1; + + // Indicates the status of the file. + State state = 2; + } + + // A list of all files which have uncommitted Git changes. There will only be + // a single entry for any given file. + repeated UncommittedFileChange uncommitted_file_changes = 1; +} + +// `FetchGitAheadBehind` request message. +message FetchGitAheadBehindRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `FetchGitAheadBehind` response message. +message FetchGitAheadBehindResponse { + // The number of commits in the remote branch that are not in the workspace. + int32 commits_ahead = 1; + + // The number of commits in the workspace that are not in the remote branch. + int32 commits_behind = 2; +} + +// `CommitWorkspaceChanges` request message. +message CommitWorkspaceChangesRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The commit's author. + CommitAuthor author = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The commit's message. + string commit_message = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full file paths to commit including filename, rooted at workspace root. If + // left empty, all files will be committed. + repeated string paths = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ResetWorkspaceChanges` request message. +message ResetWorkspaceChangesRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + repeated string paths = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, untracked files will be deleted. + bool clean = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `FetchFileDiff` request message. +message FetchFileDiffRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `FetchFileDiff` response message. +message FetchFileDiffResponse { + // The raw formatted Git diff for the file. + string formatted_diff = 1; +} + +// `QueryDirectoryContents` request message. +message QueryDirectoryContentsRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Optional. The directory's full path including directory name, relative to the + // workspace root. If left unset, the workspace root is used. + string path = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of paths to return. The server may return fewer + // items than requested. If unspecified, the server will pick an appropriate + // default. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// `QueryDirectoryContents` response message. +message QueryDirectoryContentsResponse { + // Represents a single entry in a workspace directory. + message DirectoryEntry { + oneof entry { + // A file in the directory. + string file = 1; + + // A child directory in the directory. + string directory = 2; + } + } + + // List of entries in the directory. + repeated DirectoryEntry directory_entries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// `MakeDirectory` request message. +message MakeDirectoryRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The directory's full path including directory name, relative to the + // workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `MakeDirectory` response message. +message MakeDirectoryResponse { + +} + +// `RemoveDirectory` request message. +message RemoveDirectoryRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The directory's full path including directory name, relative to the + // workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveDirectory` request message. +message MoveDirectoryRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The directory's full path including directory name, relative to the + // workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new path for the directory including directory name, rooted at + // workspace root. + string new_path = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveDirectory` response message. +message MoveDirectoryResponse { + +} + +// `ReadFile` request message. +message ReadFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `ReadFile` response message. +message ReadFileResponse { + // The file's contents. + bytes file_contents = 1; +} + +// `RemoveFile` request message. +message RemoveFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveFile` request message. +message MoveFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The file's new path including filename, relative to the workspace root. + string new_path = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveFile` response message. +message MoveFileResponse { + +} + +// `WriteFile` request message. +message WriteFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The file's contents. + bytes contents = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `WriteFile` response message. +message WriteFileResponse { + +} + +// `InstallNpmPackages` request message. +message InstallNpmPackagesRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// `InstallNpmPackages` response message. +message InstallNpmPackagesResponse { + +} + +// Represents the result of compiling a Dataform project. +message CompilationResult { + option (google.api.resource) = { + type: "dataform.googleapis.com/CompilationResult" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}" + }; + + // Configures various aspects of Dataform code compilation. + message CodeCompilationConfig { + // Optional. The default database (Google Cloud project ID). + string default_database = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default schema (BigQuery dataset ID). + string default_schema = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string default_location = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default schema (BigQuery dataset ID) for assertions. + string assertion_schema = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-defined variables that are made available to project code during + // compilation. + map vars = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The suffix that should be appended to all database (Google Cloud project + // ID) names. + string database_suffix = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The suffix that should be appended to all schema (BigQuery dataset ID) + // names. + string schema_suffix = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prefix that should be prepended to all table names. + string table_prefix = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // An error encountered when attempting to compile a Dataform project. + message CompilationError { + // Output only. The error's top level message. + string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error's full stack trace. + string stack = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The path of the file where this error occurred, if available, relative to + // the project root. + string path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the action where this error occurred, if available. + Target action_target = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The compilation result's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof source { + // 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` + string git_commitish = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The name of the workspace to compile. Must be in the format + // `projects/*/locations/*/repositories/*/workspaces/*`. + string workspace = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + } + + // Immutable. If set, fields of `code_compilation_overrides` override the default + // compilation settings that are specified in dataform.json. + CodeCompilationConfig code_compilation_config = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The version of `@dataform/core` that was used for compilation. + string dataform_core_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Errors encountered during project compilation. + repeated CompilationError compilation_errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `ListCompilationResults` request message. +message ListCompilationResultsRequest { + // Required. The repository in which to list compilation results. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListCompilationResults` response message. +message ListCompilationResultsResponse { + // List of compilation results. + repeated CompilationResult compilation_results = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetCompilationResult` request message. +message GetCompilationResultRequest { + // Required. The compilation result's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/CompilationResult" + } + ]; +} + +// `CreateCompilationResult` request message. +message CreateCompilationResultRequest { + // Required. The repository in which to create the compilation result. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Required. The compilation result to create. + CompilationResult compilation_result = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents an action identifier. If the action writes output, the output +// will be written to the referenced database object. +message Target { + // The action's database (Google Cloud project ID) . + string database = 1; + + // The action's schema (BigQuery dataset ID), within `database`. + string schema = 2; + + // The action's name, within `database` and `schema`. + string name = 3; +} + +// Describes a relation and its columns. +message RelationDescriptor { + // Describes a column. + message ColumnDescriptor { + // The identifier for the column. Each entry in `path` represents one level + // of nesting. + repeated string path = 1; + + // A textual description of the column. + string description = 2; + + // A list of BigQuery policy tags that will be applied to the column. + repeated string bigquery_policy_tags = 3; + } + + // A text description of the relation. + string description = 1; + + // A list of descriptions of columns within the relation. + repeated ColumnDescriptor columns = 2; + + // A set of BigQuery labels that should be applied to the relation. + map bigquery_labels = 3; +} + +// Represents a single Dataform action in a compilation result. +message CompilationResultAction { + // Represents a database relation. + message Relation { + // Indicates the type of this relation. + enum RelationType { + // Default value. This value is unused. + RELATION_TYPE_UNSPECIFIED = 0; + + // The relation is a table. + TABLE = 1; + + // The relation is a view. + VIEW = 2; + + // The relation is an incrementalized table. + INCREMENTAL_TABLE = 3; + + // The relation is a materialized view. + MATERIALIZED_VIEW = 4; + } + + // Contains settings for relations of type `INCREMENTAL_TABLE`. + message IncrementalTableConfig { + // The SELECT query which returns rows which should be inserted into the + // relation if it already exists and is not being refreshed. + string incremental_select_query = 1; + + // Whether this table should be protected from being refreshed. + bool refresh_disabled = 2; + + // 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. + repeated string unique_key_parts = 3; + + // A SQL expression conditional used to limit the set of existing rows + // considered for a merge operation (see `unique_key_parts` for more + // information). + string update_partition_filter = 4; + + // SQL statements to be executed before inserting new rows into the + // relation. + repeated string incremental_pre_operations = 5; + + // SQL statements to be executed after inserting new rows into the + // relation. + repeated string incremental_post_operations = 6; + } + + // A list of actions that this action depends on. + repeated Target dependency_targets = 1; + + // Whether this action is disabled (i.e. should not be run). + bool disabled = 2; + + // Arbitrary, user-defined tags on this action. + repeated string tags = 3; + + // Descriptor for the relation and its columns. + RelationDescriptor relation_descriptor = 4; + + // The type of this relation. + RelationType relation_type = 5; + + // The SELECT query which returns rows which this relation should contain. + string select_query = 6; + + // SQL statements to be executed before creating the relation. + repeated string pre_operations = 7; + + // SQL statements to be executed after creating the relation. + repeated string post_operations = 8; + + // Configures `INCREMENTAL_TABLE` settings for this relation. Only set if + // `relation_type` is `INCREMENTAL_TABLE`. + IncrementalTableConfig incremental_table_config = 9; + + // The SQL expression used to partition the relation. + string partition_expression = 10; + + // A list of columns or SQL expressions used to cluster the table. + repeated string cluster_expressions = 11; + + // Sets the partition expiration in days. + int32 partition_expiration_days = 12; + + // Specifies whether queries on this table must include a predicate filter + // that filters on the partitioning column. + bool require_partition_filter = 13; + + // 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. + map additional_options = 14; + } + + // Represents a list of arbitrary database operations. + message Operations { + // A list of actions that this action depends on. + repeated Target dependency_targets = 1; + + // Whether this action is disabled (i.e. should not be run). + bool disabled = 2; + + // Arbitrary, user-defined tags on this action. + repeated string tags = 3; + + // Descriptor for any output relation and its columns. Only set if + // `has_output` is true. + RelationDescriptor relation_descriptor = 6; + + // A list of arbitrary SQL statements that will be executed without + // alteration. + repeated string queries = 4; + + // Whether these operations produce an output relation. + bool has_output = 5; + } + + // Represents an assertion upon a SQL query which is required return zero + // rows. + message Assertion { + // A list of actions that this action depends on. + repeated Target dependency_targets = 1; + + // The parent action of this assertion. Only set if this assertion was + // automatically generated. + Target parent_action = 5; + + // Whether this action is disabled (i.e. should not be run). + bool disabled = 2; + + // Arbitrary, user-defined tags on this action. + repeated string tags = 3; + + // The SELECT query which must return zero rows in order for this assertion + // to succeed. + string select_query = 4; + + // Descriptor for the assertion's automatically-generated view and its + // columns. + RelationDescriptor relation_descriptor = 6; + } + + // Represents a relation which is not managed by Dataform but which may be + // referenced by Dataform actions. + message 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 relation_descriptor = 1; + } + + // This action's identifier. Unique within the compilation result. + Target target = 1; + + // The action's identifier if the project had been compiled without any + // overrides configured. Unique within the compilation result. + Target canonical_target = 2; + + // The full path including filename in which this action is located, relative + // to the workspace root. + string file_path = 3; + + oneof compiled_object { + // The database relation created/updated by this action. + Relation relation = 4; + + // The database operations executed by this action. + Operations operations = 5; + + // The assertion executed by this action. + Assertion assertion = 6; + + // The declaration declared by this action. + Declaration declaration = 7; + } +} + +// `QueryCompilationResultActions` request message. +message QueryCompilationResultActionsRequest { + // Required. The compilation result's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/CompilationResult" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional filter for the returned list. Filtering is only currently + // supported on the `file_path` field. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// `QueryCompilationResultActions` response message. +message QueryCompilationResultActionsResponse { + // List of compilation result actions. + repeated CompilationResultAction compilation_result_actions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Represents a single invocation of a compilation result. +message WorkflowInvocation { + option (google.api.resource) = { + type: "dataform.googleapis.com/WorkflowInvocation" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}" + }; + + // Includes various configuration options for this workflow invocation. + // If both `included_targets` and `included_tags` are unset, all actions + // will be included. + message InvocationConfig { + // Immutable. The set of action identifiers to include. + repeated Target included_targets = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The set of tags to include. + repeated string included_tags = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. When set to true, transitive dependencies of included actions will be + // executed. + bool transitive_dependencies_included = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. When set to true, transitive dependents of included actions will be + // executed. + bool transitive_dependents_included = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. When set to true, any incremental tables will be fully refreshed. + bool fully_refresh_incremental_tables_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Represents the current state of a workflow invocation. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The workflow invocation is currently running. + RUNNING = 1; + + // The workflow invocation succeeded. A terminal state. + SUCCEEDED = 2; + + // The workflow invocation was cancelled. A terminal state. + CANCELLED = 3; + + // The workflow invocation failed. A terminal state. + FAILED = 4; + + // The workflow invocation is being cancelled, but some actions are still + // running. + CANCELING = 5; + } + + // Output only. The workflow invocation's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The name of the compilation result to compile. Must be in the format + // `projects/*/locations/*/repositories/*/compilationResults/*`. + string compilation_result = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/CompilationResult" + } + ]; + + // Immutable. If left unset, a default InvocationConfig will be used. + InvocationConfig invocation_config = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. This workflow invocation's current state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This workflow invocation's timing details. + google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `ListWorkflowInvocations` request message. +message ListWorkflowInvocationsRequest { + // Required. The parent resource of the WorkflowInvocation type. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListWorkflowInvocations` response message. +message ListWorkflowInvocationsResponse { + // List of workflow invocations. + repeated WorkflowInvocation workflow_invocations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetWorkflowInvocation` request message. +message GetWorkflowInvocationRequest { + // Required. The workflow invocation resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; +} + +// `CreateWorkflowInvocation` request message. +message CreateWorkflowInvocationRequest { + // Required. The parent resource of the WorkflowInvocation type. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Required. The workflow invocation resource to create. + WorkflowInvocation workflow_invocation = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `DeleteWorkflowInvocation` request message. +message DeleteWorkflowInvocationRequest { + // Required. The workflow invocation resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; +} + +// `CancelWorkflowInvocation` request message. +message CancelWorkflowInvocationRequest { + // Required. The workflow invocation resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; +} + +// Represents a single action in a workflow invocation. +message WorkflowInvocationAction { + // Represents the current state of an workflow invocation action. + enum State { + // The action has not yet been considered for invocation. + PENDING = 0; + + // The action is currently running. + RUNNING = 1; + + // Execution of the action was skipped because upstream dependencies did not + // all complete successfully. A terminal state. + SKIPPED = 2; + + // Execution of the action was disabled as per the configuration of the + // corresponding compilation result action. A terminal state. + DISABLED = 3; + + // The action succeeded. A terminal state. + SUCCEEDED = 4; + + // The action was cancelled. A terminal state. + CANCELLED = 5; + + // The action failed. A terminal state. + FAILED = 6; + } + + // Represents a workflow action that will run against BigQuery. + message BigQueryAction { + // Output only. The generated BigQuery SQL script that will be executed. + string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. This action's identifier. Unique within the workflow invocation. + Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The action's identifier if the project had been compiled without any + // overrides configured. Unique within the compilation result. + Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This action's current state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If and only if action's state is FAILED a failure reason is set. + string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The workflow action's bigquery action details. + BigQueryAction bigquery_action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `QueryWorkflowInvocationActions` request message. +message QueryWorkflowInvocationActionsRequest { + // Required. The workflow invocation's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `QueryWorkflowInvocationActions` response message. +message QueryWorkflowInvocationActionsResponse { + // List of workflow invocation actions. + repeated WorkflowInvocationAction workflow_invocation_actions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js new file mode 100644 index 0000000..65ab554 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCancelWorkflowInvocation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.cancelWorkflowInvocation(request); + console.log(response); + } + + callCancelWorkflowInvocation(); + // [END dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js new file mode 100644 index 0000000..e4b9e76 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, author) { + // [START dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * Required. The commit's author. + */ + // const author = {} + /** + * Optional. The commit's message. + */ + // const commitMessage = 'abc123' + /** + * Optional. Full file paths to commit including filename, rooted at workspace root. If + * left empty, all files will be committed. + */ + // const paths = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCommitWorkspaceChanges() { + // Construct request + const request = { + name, + author, + }; + + // Run request + const response = await dataformClient.commitWorkspaceChanges(request); + console.log(response); + } + + callCommitWorkspaceChanges(); + // [END dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js new file mode 100644 index 0000000..42cafe8 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, compilationResult) { + // [START dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to create the compilation result. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Required. The compilation result to create. + */ + // const compilationResult = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateCompilationResult() { + // Construct request + const request = { + parent, + compilationResult, + }; + + // Run request + const response = await dataformClient.createCompilationResult(request); + console.log(response); + } + + callCreateCompilationResult(); + // [END dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js new file mode 100644 index 0000000..b734380 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, repository, repositoryId) { + // [START dataform_v1alpha2_generated_Dataform_CreateRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location in which to create the repository. Must be in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. The repository to create. + */ + // const repository = {} + /** + * Required. The ID to use for the repository, which will become the final component of + * the repository's resource name. + */ + // const repositoryId = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateRepository() { + // Construct request + const request = { + parent, + repository, + repositoryId, + }; + + // Run request + const response = await dataformClient.createRepository(request); + console.log(response); + } + + callCreateRepository(); + // [END dataform_v1alpha2_generated_Dataform_CreateRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js new file mode 100644 index 0000000..7aeaced --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workflowInvocation) { + // [START dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the WorkflowInvocation type. + */ + // const parent = 'abc123' + /** + * Required. The workflow invocation resource to create. + */ + // const workflowInvocation = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateWorkflowInvocation() { + // Construct request + const request = { + parent, + workflowInvocation, + }; + + // Run request + const response = await dataformClient.createWorkflowInvocation(request); + console.log(response); + } + + callCreateWorkflowInvocation(); + // [END dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js new file mode 100644 index 0000000..2b55956 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workspace, workspaceId) { + // [START dataform_v1alpha2_generated_Dataform_CreateWorkspace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to create the workspace. Must be in the format + * `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Required. The workspace to create. + */ + // const workspace = {} + /** + * Required. The ID to use for the workspace, which will become the final component of + * the workspace's resource name. + */ + // const workspaceId = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateWorkspace() { + // Construct request + const request = { + parent, + workspace, + workspaceId, + }; + + // Run request + const response = await dataformClient.createWorkspace(request); + console.log(response); + } + + callCreateWorkspace(); + // [END dataform_v1alpha2_generated_Dataform_CreateWorkspace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js new file mode 100644 index 0000000..bfe3dc9 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_DeleteRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository's name. + */ + // const name = 'abc123' + /** + * 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.) + */ + // const force = true + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callDeleteRepository() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.deleteRepository(request); + console.log(response); + } + + callDeleteRepository(); + // [END dataform_v1alpha2_generated_Dataform_DeleteRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js new file mode 100644 index 0000000..800461d --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callDeleteWorkflowInvocation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.deleteWorkflowInvocation(request); + console.log(response); + } + + callDeleteWorkflowInvocation(); + // [END dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js new file mode 100644 index 0000000..f773c39 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callDeleteWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.deleteWorkspace(request); + console.log(response); + } + + callDeleteWorkspace(); + // [END dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js new file mode 100644 index 0000000..df28731 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchFileDiff() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.fetchFileDiff(request); + console.log(response); + } + + callFetchFileDiff(); + // [END dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js new file mode 100644 index 0000000..ba0e827 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchFileGitStatuses() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.fetchFileGitStatuses(request); + console.log(response); + } + + callFetchFileGitStatuses(); + // [END dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js new file mode 100644 index 0000000..1dcc54b --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const remoteBranch = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchGitAheadBehind() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.fetchGitAheadBehind(request); + console.log(response); + } + + callFetchGitAheadBehind(); + // [END dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js new file mode 100644 index 0000000..c6c2b7f --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchRemoteBranches() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.fetchRemoteBranches(request); + console.log(response); + } + + callFetchRemoteBranches(); + // [END dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js new file mode 100644 index 0000000..38711f9 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_GetCompilationResult_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The compilation result's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetCompilationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getCompilationResult(request); + console.log(response); + } + + callGetCompilationResult(); + // [END dataform_v1alpha2_generated_Dataform_GetCompilationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js new file mode 100644 index 0000000..e633675 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_GetRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetRepository() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getRepository(request); + console.log(response); + } + + callGetRepository(); + // [END dataform_v1alpha2_generated_Dataform_GetRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js new file mode 100644 index 0000000..8ed6ab4 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetWorkflowInvocation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getWorkflowInvocation(request); + console.log(response); + } + + callGetWorkflowInvocation(); + // [END dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js new file mode 100644 index 0000000..294d027 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_GetWorkspace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getWorkspace(request); + console.log(response); + } + + callGetWorkspace(); + // [END dataform_v1alpha2_generated_Dataform_GetWorkspace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js new file mode 100644 index 0000000..bfae9b7 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace) { + // [START dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callInstallNpmPackages() { + // Construct request + const request = { + workspace, + }; + + // Run request + const response = await dataformClient.installNpmPackages(request); + console.log(response); + } + + callInstallNpmPackages(); + // [END dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js new file mode 100644 index 0000000..f463dc1 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1alpha2_generated_Dataform_ListCompilationResults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListCompilationResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listCompilationResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCompilationResults(); + // [END dataform_v1alpha2_generated_Dataform_ListCompilationResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js new file mode 100644 index 0000000..2f81c22 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1alpha2_generated_Dataform_ListRepositories_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * 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. + */ + // const orderBy = 'abc123' + /** + * Optional. Filter for the returned list. + */ + // const filter = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListRepositories() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listRepositoriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRepositories(); + // [END dataform_v1alpha2_generated_Dataform_ListRepositories_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js new file mode 100644 index 0000000..12e7d3e --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListWorkflowInvocations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listWorkflowInvocationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkflowInvocations(); + // [END dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js new file mode 100644 index 0000000..8a1f1c9 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1alpha2_generated_Dataform_ListWorkspaces_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * 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. + */ + // const orderBy = 'abc123' + /** + * Optional. Filter for the returned list. + */ + // const filter = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListWorkspaces() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listWorkspacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkspaces(); + // [END dataform_v1alpha2_generated_Dataform_ListWorkspaces_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js new file mode 100644 index 0000000..faf321e --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1alpha2_generated_Dataform_MakeDirectory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The directory's full path including directory name, relative to the + * workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callMakeDirectory() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.makeDirectory(request); + console.log(response); + } + + callMakeDirectory(); + // [END dataform_v1alpha2_generated_Dataform_MakeDirectory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js new file mode 100644 index 0000000..d50b32b --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path, newPath) { + // [START dataform_v1alpha2_generated_Dataform_MoveDirectory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The directory's full path including directory name, relative to the + * workspace root. + */ + // const path = 'abc123' + /** + * Required. The new path for the directory including directory name, rooted at + * workspace root. + */ + // const newPath = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callMoveDirectory() { + // Construct request + const request = { + workspace, + path, + newPath, + }; + + // Run request + const response = await dataformClient.moveDirectory(request); + console.log(response); + } + + callMoveDirectory(); + // [END dataform_v1alpha2_generated_Dataform_MoveDirectory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js new file mode 100644 index 0000000..7f04c99 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path, newPath) { + // [START dataform_v1alpha2_generated_Dataform_MoveFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + /** + * Required. The file's new path including filename, relative to the workspace root. + */ + // const newPath = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callMoveFile() { + // Construct request + const request = { + workspace, + path, + newPath, + }; + + // Run request + const response = await dataformClient.moveFile(request); + console.log(response); + } + + callMoveFile(); + // [END dataform_v1alpha2_generated_Dataform_MoveFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js new file mode 100644 index 0000000..2b6de81 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, author) { + // [START dataform_v1alpha2_generated_Dataform_PullGitCommits_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const remoteBranch = 'abc123' + /** + * Required. The author of any merge commit which may be created as a result of merging + * fetched Git commits into this workspace. + */ + // const author = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callPullGitCommits() { + // Construct request + const request = { + name, + author, + }; + + // Run request + const response = await dataformClient.pullGitCommits(request); + console.log(response); + } + + callPullGitCommits(); + // [END dataform_v1alpha2_generated_Dataform_PullGitCommits_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js new file mode 100644 index 0000000..bdcd4b2 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_PushGitCommits_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const remoteBranch = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callPushGitCommits() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.pushGitCommits(request); + console.log(response); + } + + callPushGitCommits(); + // [END dataform_v1alpha2_generated_Dataform_PushGitCommits_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js new file mode 100644 index 0000000..e829710 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The compilation result's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + */ + // const filter = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callQueryCompilationResultActions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await dataformClient.queryCompilationResultActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callQueryCompilationResultActions(); + // [END dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js new file mode 100644 index 0000000..2e5c0bc --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace) { + // [START dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + */ + // const path = 'abc123' + /** + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callQueryDirectoryContents() { + // Construct request + const request = { + workspace, + }; + + // Run request + const iterable = await dataformClient.queryDirectoryContentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callQueryDirectoryContents(); + // [END dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js new file mode 100644 index 0000000..0abc8a2 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callQueryWorkflowInvocationActions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await dataformClient.queryWorkflowInvocationActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callQueryWorkflowInvocationActions(); + // [END dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js new file mode 100644 index 0000000..7cd0572 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1alpha2_generated_Dataform_ReadFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callReadFile() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.readFile(request); + console.log(response); + } + + callReadFile(); + // [END dataform_v1alpha2_generated_Dataform_ReadFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js new file mode 100644 index 0000000..157e012 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1alpha2_generated_Dataform_RemoveDirectory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The directory's full path including directory name, relative to the + * workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callRemoveDirectory() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.removeDirectory(request); + console.log(response); + } + + callRemoveDirectory(); + // [END dataform_v1alpha2_generated_Dataform_RemoveDirectory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js new file mode 100644 index 0000000..396738b --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1alpha2_generated_Dataform_RemoveFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callRemoveFile() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.removeFile(request); + console.log(response); + } + + callRemoveFile(); + // [END dataform_v1alpha2_generated_Dataform_RemoveFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js new file mode 100644 index 0000000..d91ec7f --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const paths = 'abc123' + /** + * Optional. If set to true, untracked files will be deleted. + */ + // const clean = true + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callResetWorkspaceChanges() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.resetWorkspaceChanges(request); + console.log(response); + } + + callResetWorkspaceChanges(); + // [END dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js new file mode 100644 index 0000000..48c5d61 --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(repository) { + // [START dataform_v1alpha2_generated_Dataform_UpdateRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Specifies the fields to be updated in the repository. If left unset, + * all fields will be updated. + */ + // const updateMask = {} + /** + * Required. The repository to update. + */ + // const repository = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callUpdateRepository() { + // Construct request + const request = { + repository, + }; + + // Run request + const response = await dataformClient.updateRepository(request); + console.log(response); + } + + callUpdateRepository(); + // [END dataform_v1alpha2_generated_Dataform_UpdateRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js new file mode 100644 index 0000000..08ed5bb --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path, contents) { + // [START dataform_v1alpha2_generated_Dataform_WriteFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file. + */ + // const path = 'abc123' + /** + * Required. The file's contents. + */ + // const contents = 'Buffer.from('string')' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callWriteFile() { + // Construct request + const request = { + workspace, + path, + contents, + }; + + // Run request + const response = await dataformClient.writeFile(request); + console.log(response); + } + + callWriteFile(); + // [END dataform_v1alpha2_generated_Dataform_WriteFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json new file mode 100644 index 0000000..db87e4b --- /dev/null +++ b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json @@ -0,0 +1,1647 @@ +{ + "clientLibrary": { + "name": "nodejs-dataform", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.dataform.v1alpha2", + "version": "v1alpha2" + } + ] + }, + "snippets": [ + { + "regionTag": "dataform_v1alpha2_generated_Dataform_ListRepositories_async", + "title": "Dataform listRepositories Sample", + "origin": "API_DEFINITION", + "description": " Lists Repositories in a given project and location.", + "canonical": true, + "file": "dataform.list_repositories.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRepositories", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListRepositories", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.ListRepositoriesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "ListRepositories", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListRepositories", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_GetRepository_async", + "title": "Dataform getRepository Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single Repository.", + "canonical": true, + "file": "dataform.get_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetRepository", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.Repository", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "GetRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_CreateRepository_async", + "title": "Dataform createRepository Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Repository in a given project and location.", + "canonical": true, + "file": "dataform.create_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateRepository", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "repository", + "type": ".google.cloud.dataform.v1alpha2.Repository" + }, + { + "name": "repository_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.Repository", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "CreateRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_UpdateRepository_async", + "title": "Dataform updateRepository Sample", + "origin": "API_DEFINITION", + "description": " Updates a single Repository.", + "canonical": true, + "file": "dataform.update_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.UpdateRepository", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "repository", + "type": ".google.cloud.dataform.v1alpha2.Repository" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.Repository", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "UpdateRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.UpdateRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_DeleteRepository_async", + "title": "Dataform deleteRepository Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Repository.", + "canonical": true, + "file": "dataform.delete_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteRepository", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "DeleteRepository", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async", + "title": "Dataform fetchRemoteBranches Sample", + "origin": "API_DEFINITION", + "description": " Fetches a Repository's remote branches.", + "canonical": true, + "file": "dataform.fetch_remote_branches.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchRemoteBranches", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchRemoteBranches", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "FetchRemoteBranches", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchRemoteBranches", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_ListWorkspaces_async", + "title": "Dataform listWorkspaces Sample", + "origin": "API_DEFINITION", + "description": " Lists Workspaces in a given Repository.", + "canonical": true, + "file": "dataform.list_workspaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkspaces", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkspaces", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.ListWorkspacesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "ListWorkspaces", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkspaces", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_GetWorkspace_async", + "title": "Dataform getWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single Workspace.", + "canonical": true, + "file": "dataform.get_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkspace", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.Workspace", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "GetWorkspace", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkspace", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_CreateWorkspace_async", + "title": "Dataform createWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Workspace in a given Repository.", + "canonical": true, + "file": "dataform.create_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkspace", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkspace", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workspace", + "type": ".google.cloud.dataform.v1alpha2.Workspace" + }, + { + "name": "workspace_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.Workspace", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "CreateWorkspace", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkspace", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async", + "title": "Dataform deleteWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Workspace.", + "canonical": true, + "file": "dataform.delete_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkspace", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "DeleteWorkspace", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkspace", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async", + "title": "Dataform installNpmPackages Sample", + "origin": "API_DEFINITION", + "description": " Installs dependency NPM packages (inside a Workspace).", + "canonical": true, + "file": "dataform.install_npm_packages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InstallNpmPackages", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.InstallNpmPackages", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "InstallNpmPackages", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.InstallNpmPackages", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_PullGitCommits_async", + "title": "Dataform pullGitCommits Sample", + "origin": "API_DEFINITION", + "description": " Pulls Git commits from the Repository's remote into a Workspace.", + "canonical": true, + "file": "dataform.pull_git_commits.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PullGitCommits", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.PullGitCommits", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "remote_branch", + "type": "TYPE_STRING" + }, + { + "name": "author", + "type": ".google.cloud.dataform.v1alpha2.CommitAuthor" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "PullGitCommits", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.PullGitCommits", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_PushGitCommits_async", + "title": "Dataform pushGitCommits Sample", + "origin": "API_DEFINITION", + "description": " Pushes Git commits from a Workspace to the Repository's remote.", + "canonical": true, + "file": "dataform.push_git_commits.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PushGitCommits", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.PushGitCommits", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "remote_branch", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "PushGitCommits", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.PushGitCommits", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async", + "title": "Dataform fetchFileGitStatuses Sample", + "origin": "API_DEFINITION", + "description": " Fetches Git statuses for the files in a Workspace.", + "canonical": true, + "file": "dataform.fetch_file_git_statuses.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchFileGitStatuses", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileGitStatuses", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "FetchFileGitStatuses", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileGitStatuses", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async", + "title": "Dataform fetchGitAheadBehind Sample", + "origin": "API_DEFINITION", + "description": " Fetches Git ahead/behind against a remote branch.", + "canonical": true, + "file": "dataform.fetch_git_ahead_behind.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchGitAheadBehind", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchGitAheadBehind", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "remote_branch", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "FetchGitAheadBehind", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchGitAheadBehind", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async", + "title": "Dataform commitWorkspaceChanges Sample", + "origin": "API_DEFINITION", + "description": " Applies a Git commit for uncommitted files in a Workspace.", + "canonical": true, + "file": "dataform.commit_workspace_changes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CommitWorkspaceChanges", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CommitWorkspaceChanges", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "author", + "type": ".google.cloud.dataform.v1alpha2.CommitAuthor" + }, + { + "name": "commit_message", + "type": "TYPE_STRING" + }, + { + "name": "paths", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "CommitWorkspaceChanges", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CommitWorkspaceChanges", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async", + "title": "Dataform resetWorkspaceChanges Sample", + "origin": "API_DEFINITION", + "description": " Performs a Git reset for uncommitted files in a Workspace.", + "canonical": true, + "file": "dataform.reset_workspace_changes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResetWorkspaceChanges", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ResetWorkspaceChanges", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "paths", + "type": "TYPE_STRING[]" + }, + { + "name": "clean", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "ResetWorkspaceChanges", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ResetWorkspaceChanges", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_FetchFileDiff_async", + "title": "Dataform fetchFileDiff Sample", + "origin": "API_DEFINITION", + "description": " Fetches Git diff for an uncommitted file in a Workspace.", + "canonical": true, + "file": "dataform.fetch_file_diff.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchFileDiff", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileDiff", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.FetchFileDiffResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "FetchFileDiff", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileDiff", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async", + "title": "Dataform queryDirectoryContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a given Workspace directory.", + "canonical": true, + "file": "dataform.query_directory_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryDirectoryContents", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryDirectoryContents", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "QueryDirectoryContents", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryDirectoryContents", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_MakeDirectory_async", + "title": "Dataform makeDirectory Sample", + "origin": "API_DEFINITION", + "description": " Creates a directory inside a Workspace.", + "canonical": true, + "file": "dataform.make_directory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MakeDirectory", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.MakeDirectory", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.MakeDirectoryResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "MakeDirectory", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.MakeDirectory", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_RemoveDirectory_async", + "title": "Dataform removeDirectory Sample", + "origin": "API_DEFINITION", + "description": " Deletes a directory (inside a Workspace) and all of its contents.", + "canonical": true, + "file": "dataform.remove_directory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveDirectory", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveDirectory", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "RemoveDirectory", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveDirectory", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_MoveDirectory_async", + "title": "Dataform moveDirectory Sample", + "origin": "API_DEFINITION", + "description": " Moves a directory (inside a Workspace), and all of its contents, to a new location.", + "canonical": true, + "file": "dataform.move_directory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveDirectory", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveDirectory", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "new_path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.MoveDirectoryResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "MoveDirectory", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveDirectory", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_ReadFile_async", + "title": "Dataform readFile Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a file (inside a Workspace).", + "canonical": true, + "file": "dataform.read_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ReadFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.ReadFileResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "ReadFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ReadFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_RemoveFile_async", + "title": "Dataform removeFile Sample", + "origin": "API_DEFINITION", + "description": " Deletes a file (inside a Workspace).", + "canonical": true, + "file": "dataform.remove_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "RemoveFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_MoveFile_async", + "title": "Dataform moveFile Sample", + "origin": "API_DEFINITION", + "description": " Moves a file (inside a Workspace) to a new location.", + "canonical": true, + "file": "dataform.move_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "new_path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.MoveFileResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "MoveFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_WriteFile_async", + "title": "Dataform writeFile Sample", + "origin": "API_DEFINITION", + "description": " Writes to a file (inside a Workspace).", + "canonical": true, + "file": "dataform.write_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "WriteFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.WriteFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.WriteFileResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "WriteFile", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.WriteFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_ListCompilationResults_async", + "title": "Dataform listCompilationResults Sample", + "origin": "API_DEFINITION", + "description": " Lists CompilationResults in a given Repository.", + "canonical": true, + "file": "dataform.list_compilation_results.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCompilationResults", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListCompilationResults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.ListCompilationResultsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "ListCompilationResults", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListCompilationResults", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_GetCompilationResult_async", + "title": "Dataform getCompilationResult Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single CompilationResult.", + "canonical": true, + "file": "dataform.get_compilation_result.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCompilationResult", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetCompilationResult", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.CompilationResult", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "GetCompilationResult", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetCompilationResult", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async", + "title": "Dataform createCompilationResult Sample", + "origin": "API_DEFINITION", + "description": " Creates a new CompilationResult in a given project and location.", + "canonical": true, + "file": "dataform.create_compilation_result.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCompilationResult", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateCompilationResult", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "compilation_result", + "type": ".google.cloud.dataform.v1alpha2.CompilationResult" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.CompilationResult", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "CreateCompilationResult", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateCompilationResult", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async", + "title": "Dataform queryCompilationResultActions Sample", + "origin": "API_DEFINITION", + "description": " Returns CompilationResultActions in a given CompilationResult.", + "canonical": true, + "file": "dataform.query_compilation_result_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryCompilationResultActions", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryCompilationResultActions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.QueryCompilationResultActionsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "QueryCompilationResultActions", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryCompilationResultActions", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async", + "title": "Dataform listWorkflowInvocations Sample", + "origin": "API_DEFINITION", + "description": " Lists WorkflowInvocations in a given Repository.", + "canonical": true, + "file": "dataform.list_workflow_invocations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkflowInvocations", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkflowInvocations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.ListWorkflowInvocationsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "ListWorkflowInvocations", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkflowInvocations", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async", + "title": "Dataform getWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single WorkflowInvocation.", + "canonical": true, + "file": "dataform.get_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.WorkflowInvocation", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "GetWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async", + "title": "Dataform createWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Creates a new WorkflowInvocation in a given Repository.", + "canonical": true, + "file": "dataform.create_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workflow_invocation", + "type": ".google.cloud.dataform.v1alpha2.WorkflowInvocation" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.WorkflowInvocation", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "CreateWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async", + "title": "Dataform deleteWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single WorkflowInvocation.", + "canonical": true, + "file": "dataform.delete_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "DeleteWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async", + "title": "Dataform cancelWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Requests cancellation of a running WorkflowInvocation.", + "canonical": true, + "file": "dataform.cancel_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CancelWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "CancelWorkflowInvocation", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.CancelWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async", + "title": "Dataform queryWorkflowInvocationActions Sample", + "origin": "API_DEFINITION", + "description": " Returns WorkflowInvocationActions in a given WorkflowInvocation.", + "canonical": true, + "file": "dataform.query_workflow_invocation_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryWorkflowInvocationActions", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryWorkflowInvocationActions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1alpha2.DataformClient" + }, + "method": { + "shortName": "QueryWorkflowInvocationActions", + "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryWorkflowInvocationActions", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1alpha2.Dataform" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v1alpha2/src/index.ts b/owl-bot-staging/v1alpha2/src/index.ts new file mode 100644 index 0000000..84ba790 --- /dev/null +++ b/owl-bot-staging/v1alpha2/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1alpha2 from './v1alpha2'; +const DataformClient = v1alpha2.DataformClient; +type DataformClient = v1alpha2.DataformClient; +export {v1alpha2, DataformClient}; +export default {v1alpha2, DataformClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts new file mode 100644 index 0000000..d5e4619 --- /dev/null +++ b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts @@ -0,0 +1,4387 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; + +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1alpha2/dataform_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './dataform_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Dataform is a service to develop, create, document, test, and update curated + * tables in BigQuery. + * @class + * @memberof v1alpha2 + */ +export class DataformClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + dataformStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataformClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataformClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new IamClient(this._gaxGrpc, opts); + + this.locationsClient = new LocationsClient(this._gaxGrpc, opts); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + compilationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + repositoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}' + ), + workflowInvocationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}' + ), + workspacePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRepositories: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'repositories'), + listWorkspaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workspaces'), + queryDirectoryContents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'directoryEntries'), + listCompilationResults: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResults'), + queryCompilationResultActions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResultActions'), + listWorkflowInvocations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocations'), + queryWorkflowInvocationActions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocationActions') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataform.v1alpha2.Dataform', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.dataformStub) { + return this.dataformStub; + } + + // Put together the "service stub" for + // google.cloud.dataform.v1alpha2.Dataform. + this.dataformStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataform.v1alpha2.Dataform') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataform.v1alpha2.Dataform, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const dataformStubMethods = + ['listRepositories', 'getRepository', 'createRepository', 'updateRepository', 'deleteRepository', 'fetchRemoteBranches', 'listWorkspaces', 'getWorkspace', 'createWorkspace', 'deleteWorkspace', 'installNpmPackages', 'pullGitCommits', 'pushGitCommits', 'fetchFileGitStatuses', 'fetchGitAheadBehind', 'commitWorkspaceChanges', 'resetWorkspaceChanges', 'fetchFileDiff', 'queryDirectoryContents', 'makeDirectory', 'removeDirectory', 'moveDirectory', 'readFile', 'removeFile', 'moveFile', 'writeFile', 'listCompilationResults', 'getCompilationResult', 'createCompilationResult', 'queryCompilationResultActions', 'listWorkflowInvocations', 'getWorkflowInvocation', 'createWorkflowInvocation', 'deleteWorkflowInvocation', 'cancelWorkflowInvocation', 'queryWorkflowInvocationActions']; + for (const methodName of dataformStubMethods) { + const callPromise = this.dataformStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataformStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Fetches a single Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The repository's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.get_repository.js + * region_tag:dataform_v1alpha2_generated_Dataform_GetRepository_async + */ + getRepository( + request?: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|undefined, {}|undefined + ]>; + getRepository( + request: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, + {}|null|undefined>): void; + getRepository( + request: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, + {}|null|undefined>): void; + getRepository( + request?: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getRepository(request, options, callback); + } +/** + * Creates a new Repository in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to create the repository. Must be in the format + * `projects/* /locations/*`. + * @param {google.cloud.dataform.v1alpha2.Repository} request.repository + * Required. The repository to create. + * @param {string} request.repositoryId + * Required. The ID to use for the repository, which will become the final component of + * the repository's resource name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.create_repository.js + * region_tag:dataform_v1alpha2_generated_Dataform_CreateRepository_async + */ + createRepository( + request?: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|undefined, {}|undefined + ]>; + createRepository( + request: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + createRepository( + request: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + createRepository( + request?: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createRepository(request, options, callback); + } +/** + * Updates a single Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Specifies the fields to be updated in the repository. If left unset, + * all fields will be updated. + * @param {google.cloud.dataform.v1alpha2.Repository} request.repository + * Required. The repository to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.update_repository.js + * region_tag:dataform_v1alpha2_generated_Dataform_UpdateRepository_async + */ + updateRepository( + request?: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|undefined, {}|undefined + ]>; + updateRepository( + request: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + updateRepository( + request: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + updateRepository( + request?: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository, + protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'repository.name': request.repository!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateRepository(request, options, callback); + } +/** + * Deletes a single Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The repository's name. + * @param {boolean} request.force + * 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.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.delete_repository.js + * region_tag:dataform_v1alpha2_generated_Dataform_DeleteRepository_async + */ + deleteRepository( + request?: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|undefined, {}|undefined + ]>; + deleteRepository( + request: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>): void; + deleteRepository( + request: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>): void; + deleteRepository( + request?: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteRepository(request, options, callback); + } +/** + * Fetches a Repository's remote branches. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The repository's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchRemoteBranchesResponse]{@link google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.fetch_remote_branches.js + * region_tag:dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async + */ + fetchRemoteBranches( + request?: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|undefined, {}|undefined + ]>; + fetchRemoteBranches( + request: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>): void; + fetchRemoteBranches( + request: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>): void; + fetchRemoteBranches( + request?: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchRemoteBranches(request, options, callback); + } +/** + * Fetches a single Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.get_workspace.js + * region_tag:dataform_v1alpha2_generated_Dataform_GetWorkspace_async + */ + getWorkspace( + request?: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|undefined, {}|undefined + ]>; + getWorkspace( + request: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + getWorkspace( + request: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + getWorkspace( + request?: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkspace(request, options, callback); + } +/** + * Creates a new Workspace in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to create the workspace. Must be in the format + * `projects/* /locations/* /repositories/*`. + * @param {google.cloud.dataform.v1alpha2.Workspace} request.workspace + * Required. The workspace to create. + * @param {string} request.workspaceId + * Required. The ID to use for the workspace, which will become the final component of + * the workspace's resource name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.create_workspace.js + * region_tag:dataform_v1alpha2_generated_Dataform_CreateWorkspace_async + */ + createWorkspace( + request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|undefined, {}|undefined + ]>; + createWorkspace( + request: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + createWorkspace( + request: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + createWorkspace( + request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkspace, + protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkspace(request, options, callback); + } +/** + * Deletes a single Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.delete_workspace.js + * region_tag:dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async + */ + deleteWorkspace( + request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|undefined, {}|undefined + ]>; + deleteWorkspace( + request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkspace( + request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkspace( + request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkspace(request, options, callback); + } +/** + * Installs dependency NPM packages (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InstallNpmPackagesResponse]{@link google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.install_npm_packages.js + * region_tag:dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async + */ + installNpmPackages( + request?: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|undefined, {}|undefined + ]>; + installNpmPackages( + request: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>): void; + installNpmPackages( + request: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>): void; + installNpmPackages( + request?: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.installNpmPackages(request, options, callback); + } +/** + * Pulls Git commits from the Repository's remote into a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string} [request.remoteBranch] + * 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. + * @param {google.cloud.dataform.v1alpha2.CommitAuthor} request.author + * Required. The author of any merge commit which may be created as a result of merging + * fetched Git commits into this workspace. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.pull_git_commits.js + * region_tag:dataform_v1alpha2_generated_Dataform_PullGitCommits_async + */ + pullGitCommits( + request?: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|undefined, {}|undefined + ]>; + pullGitCommits( + request: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pullGitCommits( + request: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pullGitCommits( + request?: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pullGitCommits(request, options, callback); + } +/** + * Pushes Git commits from a Workspace to the Repository's remote. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string} [request.remoteBranch] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.push_git_commits.js + * region_tag:dataform_v1alpha2_generated_Dataform_PushGitCommits_async + */ + pushGitCommits( + request?: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|undefined, {}|undefined + ]>; + pushGitCommits( + request: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pushGitCommits( + request: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pushGitCommits( + request?: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pushGitCommits(request, options, callback); + } +/** + * Fetches Git statuses for the files in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchFileGitStatusesResponse]{@link google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js + * region_tag:dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async + */ + fetchFileGitStatuses( + request?: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|undefined, {}|undefined + ]>; + fetchFileGitStatuses( + request: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>): void; + fetchFileGitStatuses( + request: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>): void; + fetchFileGitStatuses( + request?: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchFileGitStatuses(request, options, callback); + } +/** + * Fetches Git ahead/behind against a remote branch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string} [request.remoteBranch] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchGitAheadBehindResponse]{@link google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js + * region_tag:dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async + */ + fetchGitAheadBehind( + request?: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|undefined, {}|undefined + ]>; + fetchGitAheadBehind( + request: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>): void; + fetchGitAheadBehind( + request: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>): void; + fetchGitAheadBehind( + request?: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchGitAheadBehind(request, options, callback); + } +/** + * Applies a Git commit for uncommitted files in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {google.cloud.dataform.v1alpha2.CommitAuthor} request.author + * Required. The commit's author. + * @param {string} [request.commitMessage] + * Optional. The commit's message. + * @param {string[]} [request.paths] + * Optional. Full file paths to commit including filename, rooted at workspace root. If + * left empty, all files will be committed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.commit_workspace_changes.js + * region_tag:dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async + */ + commitWorkspaceChanges( + request?: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|undefined, {}|undefined + ]>; + commitWorkspaceChanges( + request: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + commitWorkspaceChanges( + request: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + commitWorkspaceChanges( + request?: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.commitWorkspaceChanges(request, options, callback); + } +/** + * Performs a Git reset for uncommitted files in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string[]} [request.paths] + * 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. + * @param {boolean} [request.clean] + * Optional. If set to true, untracked files will be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.reset_workspace_changes.js + * region_tag:dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async + */ + resetWorkspaceChanges( + request?: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|undefined, {}|undefined + ]>; + resetWorkspaceChanges( + request: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + resetWorkspaceChanges( + request: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + resetWorkspaceChanges( + request?: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.resetWorkspaceChanges(request, options, callback); + } +/** + * Fetches Git diff for an uncommitted file in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchFileDiffResponse]{@link google.cloud.dataform.v1alpha2.FetchFileDiffResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.fetch_file_diff.js + * region_tag:dataform_v1alpha2_generated_Dataform_FetchFileDiff_async + */ + fetchFileDiff( + request?: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|undefined, {}|undefined + ]>; + fetchFileDiff( + request: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>): void; + fetchFileDiff( + request: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>): void; + fetchFileDiff( + request?: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.fetchFileDiff(request, options, callback); + } +/** + * Creates a directory inside a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The directory's full path including directory name, relative to the + * workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MakeDirectoryResponse]{@link google.cloud.dataform.v1alpha2.MakeDirectoryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.make_directory.js + * region_tag:dataform_v1alpha2_generated_Dataform_MakeDirectory_async + */ + makeDirectory( + request?: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|undefined, {}|undefined + ]>; + makeDirectory( + request: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>): void; + makeDirectory( + request: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>): void; + makeDirectory( + request?: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.makeDirectory(request, options, callback); + } +/** + * Deletes a directory (inside a Workspace) and all of its contents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The directory's full path including directory name, relative to the + * workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.remove_directory.js + * region_tag:dataform_v1alpha2_generated_Dataform_RemoveDirectory_async + */ + removeDirectory( + request?: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|undefined, {}|undefined + ]>; + removeDirectory( + request: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + removeDirectory( + request: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + removeDirectory( + request?: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.removeDirectory(request, options, callback); + } +/** + * Moves a directory (inside a Workspace), and all of its contents, to a new + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The directory's full path including directory name, relative to the + * workspace root. + * @param {string} request.newPath + * Required. The new path for the directory including directory name, rooted at + * workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MoveDirectoryResponse]{@link google.cloud.dataform.v1alpha2.MoveDirectoryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.move_directory.js + * region_tag:dataform_v1alpha2_generated_Dataform_MoveDirectory_async + */ + moveDirectory( + request?: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|undefined, {}|undefined + ]>; + moveDirectory( + request: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + moveDirectory( + request: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + moveDirectory( + request?: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.moveDirectory(request, options, callback); + } +/** + * Returns the contents of a file (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReadFileResponse]{@link google.cloud.dataform.v1alpha2.ReadFileResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.read_file.js + * region_tag:dataform_v1alpha2_generated_Dataform_ReadFile_async + */ + readFile( + request?: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IReadFileResponse, + protos.google.cloud.dataform.v1alpha2.IReadFileRequest|undefined, {}|undefined + ]>; + readFile( + request: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IReadFileResponse, + protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, + {}|null|undefined>): void; + readFile( + request: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IReadFileResponse, + protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, + {}|null|undefined>): void; + readFile( + request?: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IReadFileResponse, + protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IReadFileResponse, + protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IReadFileResponse, + protos.google.cloud.dataform.v1alpha2.IReadFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.readFile(request, options, callback); + } +/** + * Deletes a file (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.remove_file.js + * region_tag:dataform_v1alpha2_generated_Dataform_RemoveFile_async + */ + removeFile( + request?: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|undefined, {}|undefined + ]>; + removeFile( + request: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, + {}|null|undefined>): void; + removeFile( + request: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, + {}|null|undefined>): void; + removeFile( + request?: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.removeFile(request, options, callback); + } +/** + * Moves a file (inside a Workspace) to a new location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {string} request.newPath + * Required. The file's new path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MoveFileResponse]{@link google.cloud.dataform.v1alpha2.MoveFileResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.move_file.js + * region_tag:dataform_v1alpha2_generated_Dataform_MoveFile_async + */ + moveFile( + request?: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, + protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|undefined, {}|undefined + ]>; + moveFile( + request: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, + protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, + {}|null|undefined>): void; + moveFile( + request: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, + protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, + {}|null|undefined>): void; + moveFile( + request?: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, + protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, + protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, + protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.moveFile(request, options, callback); + } +/** + * Writes to a file (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file. + * @param {Buffer} request.contents + * Required. The file's contents. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteFileResponse]{@link google.cloud.dataform.v1alpha2.WriteFileResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.write_file.js + * region_tag:dataform_v1alpha2_generated_Dataform_WriteFile_async + */ + writeFile( + request?: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, + protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|undefined, {}|undefined + ]>; + writeFile( + request: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, + protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, + {}|null|undefined>): void; + writeFile( + request: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, + protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, + {}|null|undefined>): void; + writeFile( + request?: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, + protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, + protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, + protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.writeFile(request, options, callback); + } +/** + * Fetches a single CompilationResult. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.get_compilation_result.js + * region_tag:dataform_v1alpha2_generated_Dataform_GetCompilationResult_async + */ + getCompilationResult( + request?: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|undefined, {}|undefined + ]>; + getCompilationResult( + request: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + getCompilationResult( + request: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + getCompilationResult( + request?: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getCompilationResult(request, options, callback); + } +/** + * Creates a new CompilationResult in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to create the compilation result. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {google.cloud.dataform.v1alpha2.CompilationResult} request.compilationResult + * Required. The compilation result to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.create_compilation_result.js + * region_tag:dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async + */ + createCompilationResult( + request?: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|undefined, {}|undefined + ]>; + createCompilationResult( + request: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + createCompilationResult( + request: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + createCompilationResult( + request?: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResult, + protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCompilationResult(request, options, callback); + } +/** + * Fetches a single WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.get_workflow_invocation.js + * region_tag:dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async + */ + getWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|undefined, {}|undefined + ]>; + getWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + getWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + getWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkflowInvocation(request, options, callback); + } +/** + * Creates a new WorkflowInvocation in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. + * @param {google.cloud.dataform.v1alpha2.WorkflowInvocation} request.workflowInvocation + * Required. The workflow invocation resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.create_workflow_invocation.js + * region_tag:dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async + */ + createWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|undefined, {}|undefined + ]>; + createWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + createWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, + callback: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + createWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, + protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkflowInvocation(request, options, callback); + } +/** + * Deletes a single WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.delete_workflow_invocation.js + * region_tag:dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async + */ + deleteWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|undefined, {}|undefined + ]>; + deleteWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkflowInvocation(request, options, callback); + } +/** + * Requests cancellation of a running WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js + * region_tag:dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async + */ + cancelWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|undefined, {}|undefined + ]>; + cancelWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + cancelWorkflowInvocation( + request: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + cancelWorkflowInvocation( + request?: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelWorkflowInvocation(request, options, callback); + } + + /** + * Lists Repositories in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRepositoriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRepositories( + request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository[], + protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest|null, + protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse + ]>; + listRepositories( + request: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IRepository>): void; + listRepositories( + request: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IRepository>): void; + listRepositories( + request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IRepository>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IRepository>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IRepository[], + protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest|null, + protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listRepositories(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRepositoriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRepositoriesStream( + request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listRepositories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRepositories.createStream( + this.innerApiCalls.listRepositories as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRepositories`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.list_repositories.js + * region_tag:dataform_v1alpha2_generated_Dataform_ListRepositories_async + */ + listRepositoriesAsync( + request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listRepositories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRepositories.asyncIterate( + this.innerApiCalls['listRepositories'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Workspaces in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkspacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkspaces( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkspace[], + protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest|null, + protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse + ]>; + listWorkspaces( + request: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkspace>): void; + listWorkspaces( + request: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkspace>): void; + listWorkspaces( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkspace>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkspace>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkspace[], + protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest|null, + protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkspaces(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkspacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkspacesStream( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkspaces.createStream( + this.innerApiCalls.listWorkspaces as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listWorkspaces`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.list_workspaces.js + * region_tag:dataform_v1alpha2_generated_Dataform_ListWorkspaces_async + */ + listWorkspacesAsync( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkspaces.asyncIterate( + this.innerApiCalls['listWorkspaces'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns the contents of a given Workspace directory. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} [request.path] + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + * @param {number} [request.pageSize] + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DirectoryEntry]{@link google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `queryDirectoryContentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryDirectoryContents( + request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[], + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest|null, + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse + ]>; + queryDirectoryContents( + request: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>): void; + queryDirectoryContents( + request: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>): void; + queryDirectoryContents( + request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[], + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest|null, + protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.queryDirectoryContents(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} [request.path] + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + * @param {number} [request.pageSize] + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DirectoryEntry]{@link google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `queryDirectoryContentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryDirectoryContentsStream( + request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + const defaultCallSettings = this._defaults['queryDirectoryContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryDirectoryContents.createStream( + this.innerApiCalls.queryDirectoryContents as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryDirectoryContents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} [request.path] + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + * @param {number} [request.pageSize] + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DirectoryEntry]{@link google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.query_directory_contents.js + * region_tag:dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async + */ + queryDirectoryContentsAsync( + request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + const defaultCallSettings = this._defaults['queryDirectoryContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryDirectoryContents.asyncIterate( + this.innerApiCalls['queryDirectoryContents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CompilationResults in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCompilationResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompilationResults( + request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResult[], + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest|null, + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse + ]>; + listCompilationResults( + request: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResult>): void; + listCompilationResults( + request: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResult>): void; + listCompilationResults( + request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResult>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResult>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResult[], + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest|null, + protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCompilationResults(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCompilationResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompilationResultsStream( + request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCompilationResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompilationResults.createStream( + this.innerApiCalls.listCompilationResults as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCompilationResults`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.list_compilation_results.js + * region_tag:dataform_v1alpha2_generated_Dataform_ListCompilationResults_async + */ + listCompilationResultsAsync( + request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCompilationResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompilationResults.asyncIterate( + this.innerApiCalls['listCompilationResults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns CompilationResultActions in a given CompilationResult. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.filter] + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CompilationResultAction]{@link google.cloud.dataform.v1alpha2.CompilationResultAction}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `queryCompilationResultActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryCompilationResultActions( + request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[], + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest|null, + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse + ]>; + queryCompilationResultActions( + request: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>): void; + queryCompilationResultActions( + request: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>): void; + queryCompilationResultActions( + request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[], + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest|null, + protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.queryCompilationResultActions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.filter] + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CompilationResultAction]{@link google.cloud.dataform.v1alpha2.CompilationResultAction} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `queryCompilationResultActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryCompilationResultActionsStream( + request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryCompilationResultActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryCompilationResultActions.createStream( + this.innerApiCalls.queryCompilationResultActions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryCompilationResultActions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.filter] + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CompilationResultAction]{@link google.cloud.dataform.v1alpha2.CompilationResultAction}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.query_compilation_result_actions.js + * region_tag:dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async + */ + queryCompilationResultActionsAsync( + request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryCompilationResultActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryCompilationResultActions.asyncIterate( + this.innerApiCalls['queryCompilationResultActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists WorkflowInvocations in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkflowInvocationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkflowInvocations( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[], + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest|null, + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse + ]>; + listWorkflowInvocations( + request: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>): void; + listWorkflowInvocations( + request: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>): void; + listWorkflowInvocations( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[], + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest|null, + protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkflowInvocations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkflowInvocationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkflowInvocationsStream( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkflowInvocations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkflowInvocations.createStream( + this.innerApiCalls.listWorkflowInvocations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listWorkflowInvocations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.list_workflow_invocations.js + * region_tag:dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async + */ + listWorkflowInvocationsAsync( + request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkflowInvocations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkflowInvocations.asyncIterate( + this.innerApiCalls['listWorkflowInvocations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns WorkflowInvocationActions in a given WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [WorkflowInvocationAction]{@link google.cloud.dataform.v1alpha2.WorkflowInvocationAction}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `queryWorkflowInvocationActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryWorkflowInvocationActions( + request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[], + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest|null, + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse + ]>; + queryWorkflowInvocationActions( + request: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>): void; + queryWorkflowInvocationActions( + request: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>): void; + queryWorkflowInvocationActions( + request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>): + Promise<[ + protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[], + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest|null, + protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.queryWorkflowInvocationActions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [WorkflowInvocationAction]{@link google.cloud.dataform.v1alpha2.WorkflowInvocationAction} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `queryWorkflowInvocationActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryWorkflowInvocationActionsStream( + request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryWorkflowInvocationActions.createStream( + this.innerApiCalls.queryWorkflowInvocationActions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryWorkflowInvocationActions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [WorkflowInvocationAction]{@link google.cloud.dataform.v1alpha2.WorkflowInvocationAction}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js + * region_tag:dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async + */ + queryWorkflowInvocationActionsAsync( + request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryWorkflowInvocationActions.asyncIterate( + this.innerApiCalls['queryWorkflowInvocationActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * 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 {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * 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). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * 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 {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * 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). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified compilationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @param {string} compilation_result + * @returns {string} Resource name string. + */ + compilationResultPath(project:string,location:string,repository:string,compilationResult:string) { + return this.pathTemplates.compilationResultPathTemplate.render({ + project: project, + location: location, + repository: repository, + compilation_result: compilationResult, + }); + } + + /** + * Parse the project from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).project; + } + + /** + * Parse the location from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).location; + } + + /** + * Parse the repository from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).repository; + } + + /** + * Parse the compilation_result from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the compilation_result. + */ + matchCompilationResultFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).compilation_result; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified repository resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @returns {string} Resource name string. + */ + repositoryPath(project:string,location:string,repository:string) { + return this.pathTemplates.repositoryPathTemplate.render({ + project: project, + location: location, + repository: repository, + }); + } + + /** + * Parse the project from Repository resource. + * + * @param {string} repositoryName + * A fully-qualified path representing Repository resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRepositoryName(repositoryName: string) { + return this.pathTemplates.repositoryPathTemplate.match(repositoryName).project; + } + + /** + * Parse the location from Repository resource. + * + * @param {string} repositoryName + * A fully-qualified path representing Repository resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRepositoryName(repositoryName: string) { + return this.pathTemplates.repositoryPathTemplate.match(repositoryName).location; + } + + /** + * Parse the repository from Repository resource. + * + * @param {string} repositoryName + * A fully-qualified path representing Repository resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromRepositoryName(repositoryName: string) { + return this.pathTemplates.repositoryPathTemplate.match(repositoryName).repository; + } + + /** + * Return a fully-qualified workflowInvocation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @param {string} workflow_invocation + * @returns {string} Resource name string. + */ + workflowInvocationPath(project:string,location:string,repository:string,workflowInvocation:string) { + return this.pathTemplates.workflowInvocationPathTemplate.render({ + project: project, + location: location, + repository: repository, + workflow_invocation: workflowInvocation, + }); + } + + /** + * Parse the project from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).project; + } + + /** + * Parse the location from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).location; + } + + /** + * Parse the repository from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).repository; + } + + /** + * Parse the workflow_invocation from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the workflow_invocation. + */ + matchWorkflowInvocationFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).workflow_invocation; + } + + /** + * Return a fully-qualified workspace resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @param {string} workspace + * @returns {string} Resource name string. + */ + workspacePath(project:string,location:string,repository:string,workspace:string) { + return this.pathTemplates.workspacePathTemplate.render({ + project: project, + location: location, + repository: repository, + workspace: workspace, + }); + } + + /** + * Parse the project from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).project; + } + + /** + * Parse the location from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).location; + } + + /** + * Parse the repository from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).repository; + } + + /** + * Parse the workspace from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the workspace. + */ + matchWorkspaceFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).workspace; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.dataformStub && !this._terminated) { + return this.dataformStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json new file mode 100644 index 0000000..b52dc9c --- /dev/null +++ b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json @@ -0,0 +1,170 @@ +{ + "interfaces": { + "google.cloud.dataform.v1alpha2.Dataform": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListRepositories": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchRemoteBranches": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkspaces": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkspace": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateWorkspace": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkspace": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InstallNpmPackages": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PullGitCommits": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PushGitCommits": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchFileGitStatuses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchGitAheadBehind": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CommitWorkspaceChanges": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResetWorkspaceChanges": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchFileDiff": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryDirectoryContents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MakeDirectory": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveDirectory": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveDirectory": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "WriteFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCompilationResults": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCompilationResult": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCompilationResult": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryCompilationResultActions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkflowInvocations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryWorkflowInvocationActions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json new file mode 100644 index 0000000..78309dc --- /dev/null +++ b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/dataform/v1alpha2/dataform.proto" +] diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json b/owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json new file mode 100644 index 0000000..d0c680b --- /dev/null +++ b/owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json @@ -0,0 +1,411 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.dataform.v1alpha2", + "libraryPackage": "@google-cloud/dataform", + "services": { + "Dataform": { + "clients": { + "grpc": { + "libraryClient": "DataformClient", + "rpcs": { + "GetRepository": { + "methods": [ + "getRepository" + ] + }, + "CreateRepository": { + "methods": [ + "createRepository" + ] + }, + "UpdateRepository": { + "methods": [ + "updateRepository" + ] + }, + "DeleteRepository": { + "methods": [ + "deleteRepository" + ] + }, + "FetchRemoteBranches": { + "methods": [ + "fetchRemoteBranches" + ] + }, + "GetWorkspace": { + "methods": [ + "getWorkspace" + ] + }, + "CreateWorkspace": { + "methods": [ + "createWorkspace" + ] + }, + "DeleteWorkspace": { + "methods": [ + "deleteWorkspace" + ] + }, + "InstallNpmPackages": { + "methods": [ + "installNpmPackages" + ] + }, + "PullGitCommits": { + "methods": [ + "pullGitCommits" + ] + }, + "PushGitCommits": { + "methods": [ + "pushGitCommits" + ] + }, + "FetchFileGitStatuses": { + "methods": [ + "fetchFileGitStatuses" + ] + }, + "FetchGitAheadBehind": { + "methods": [ + "fetchGitAheadBehind" + ] + }, + "CommitWorkspaceChanges": { + "methods": [ + "commitWorkspaceChanges" + ] + }, + "ResetWorkspaceChanges": { + "methods": [ + "resetWorkspaceChanges" + ] + }, + "FetchFileDiff": { + "methods": [ + "fetchFileDiff" + ] + }, + "MakeDirectory": { + "methods": [ + "makeDirectory" + ] + }, + "RemoveDirectory": { + "methods": [ + "removeDirectory" + ] + }, + "MoveDirectory": { + "methods": [ + "moveDirectory" + ] + }, + "ReadFile": { + "methods": [ + "readFile" + ] + }, + "RemoveFile": { + "methods": [ + "removeFile" + ] + }, + "MoveFile": { + "methods": [ + "moveFile" + ] + }, + "WriteFile": { + "methods": [ + "writeFile" + ] + }, + "GetCompilationResult": { + "methods": [ + "getCompilationResult" + ] + }, + "CreateCompilationResult": { + "methods": [ + "createCompilationResult" + ] + }, + "GetWorkflowInvocation": { + "methods": [ + "getWorkflowInvocation" + ] + }, + "CreateWorkflowInvocation": { + "methods": [ + "createWorkflowInvocation" + ] + }, + "DeleteWorkflowInvocation": { + "methods": [ + "deleteWorkflowInvocation" + ] + }, + "CancelWorkflowInvocation": { + "methods": [ + "cancelWorkflowInvocation" + ] + }, + "ListRepositories": { + "methods": [ + "listRepositories", + "listRepositoriesStream", + "listRepositoriesAsync" + ] + }, + "ListWorkspaces": { + "methods": [ + "listWorkspaces", + "listWorkspacesStream", + "listWorkspacesAsync" + ] + }, + "QueryDirectoryContents": { + "methods": [ + "queryDirectoryContents", + "queryDirectoryContentsStream", + "queryDirectoryContentsAsync" + ] + }, + "ListCompilationResults": { + "methods": [ + "listCompilationResults", + "listCompilationResultsStream", + "listCompilationResultsAsync" + ] + }, + "QueryCompilationResultActions": { + "methods": [ + "queryCompilationResultActions", + "queryCompilationResultActionsStream", + "queryCompilationResultActionsAsync" + ] + }, + "ListWorkflowInvocations": { + "methods": [ + "listWorkflowInvocations", + "listWorkflowInvocationsStream", + "listWorkflowInvocationsAsync" + ] + }, + "QueryWorkflowInvocationActions": { + "methods": [ + "queryWorkflowInvocationActions", + "queryWorkflowInvocationActionsStream", + "queryWorkflowInvocationActionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataformClient", + "rpcs": { + "GetRepository": { + "methods": [ + "getRepository" + ] + }, + "CreateRepository": { + "methods": [ + "createRepository" + ] + }, + "UpdateRepository": { + "methods": [ + "updateRepository" + ] + }, + "DeleteRepository": { + "methods": [ + "deleteRepository" + ] + }, + "FetchRemoteBranches": { + "methods": [ + "fetchRemoteBranches" + ] + }, + "GetWorkspace": { + "methods": [ + "getWorkspace" + ] + }, + "CreateWorkspace": { + "methods": [ + "createWorkspace" + ] + }, + "DeleteWorkspace": { + "methods": [ + "deleteWorkspace" + ] + }, + "InstallNpmPackages": { + "methods": [ + "installNpmPackages" + ] + }, + "PullGitCommits": { + "methods": [ + "pullGitCommits" + ] + }, + "PushGitCommits": { + "methods": [ + "pushGitCommits" + ] + }, + "FetchFileGitStatuses": { + "methods": [ + "fetchFileGitStatuses" + ] + }, + "FetchGitAheadBehind": { + "methods": [ + "fetchGitAheadBehind" + ] + }, + "CommitWorkspaceChanges": { + "methods": [ + "commitWorkspaceChanges" + ] + }, + "ResetWorkspaceChanges": { + "methods": [ + "resetWorkspaceChanges" + ] + }, + "FetchFileDiff": { + "methods": [ + "fetchFileDiff" + ] + }, + "MakeDirectory": { + "methods": [ + "makeDirectory" + ] + }, + "RemoveDirectory": { + "methods": [ + "removeDirectory" + ] + }, + "MoveDirectory": { + "methods": [ + "moveDirectory" + ] + }, + "ReadFile": { + "methods": [ + "readFile" + ] + }, + "RemoveFile": { + "methods": [ + "removeFile" + ] + }, + "MoveFile": { + "methods": [ + "moveFile" + ] + }, + "WriteFile": { + "methods": [ + "writeFile" + ] + }, + "GetCompilationResult": { + "methods": [ + "getCompilationResult" + ] + }, + "CreateCompilationResult": { + "methods": [ + "createCompilationResult" + ] + }, + "GetWorkflowInvocation": { + "methods": [ + "getWorkflowInvocation" + ] + }, + "CreateWorkflowInvocation": { + "methods": [ + "createWorkflowInvocation" + ] + }, + "DeleteWorkflowInvocation": { + "methods": [ + "deleteWorkflowInvocation" + ] + }, + "CancelWorkflowInvocation": { + "methods": [ + "cancelWorkflowInvocation" + ] + }, + "ListRepositories": { + "methods": [ + "listRepositories", + "listRepositoriesStream", + "listRepositoriesAsync" + ] + }, + "ListWorkspaces": { + "methods": [ + "listWorkspaces", + "listWorkspacesStream", + "listWorkspacesAsync" + ] + }, + "QueryDirectoryContents": { + "methods": [ + "queryDirectoryContents", + "queryDirectoryContentsStream", + "queryDirectoryContentsAsync" + ] + }, + "ListCompilationResults": { + "methods": [ + "listCompilationResults", + "listCompilationResultsStream", + "listCompilationResultsAsync" + ] + }, + "QueryCompilationResultActions": { + "methods": [ + "queryCompilationResultActions", + "queryCompilationResultActionsStream", + "queryCompilationResultActionsAsync" + ] + }, + "ListWorkflowInvocations": { + "methods": [ + "listWorkflowInvocations", + "listWorkflowInvocationsStream", + "listWorkflowInvocationsAsync" + ] + }, + "QueryWorkflowInvocationActions": { + "methods": [ + "queryWorkflowInvocationActions", + "queryWorkflowInvocationActionsStream", + "queryWorkflowInvocationActionsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/index.ts b/owl-bot-staging/v1alpha2/src/v1alpha2/index.ts new file mode 100644 index 0000000..a1e4487 --- /dev/null +++ b/owl-bot-staging/v1alpha2/src/v1alpha2/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataformClient} from './dataform_client'; diff --git a/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js new file mode 100644 index 0000000..5955dff --- /dev/null +++ b/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dataform = require('@google-cloud/dataform'); + +function main() { + const dataformClient = new dataform.DataformClient(); +} + +main(); diff --git a/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts new file mode 100644 index 0000000..3f49bdd --- /dev/null +++ b/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataformClient} from '@google-cloud/dataform'; + +// check that the client class type name can be used +function doStuffWithDataformClient(client: DataformClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataformClient = new DataformClient(); + doStuffWithDataformClient(dataformClient); +} + +main(); diff --git a/owl-bot-staging/v1alpha2/system-test/install.ts b/owl-bot-staging/v1alpha2/system-test/install.ts new file mode 100644 index 0000000..557a575 --- /dev/null +++ b/owl-bot-staging/v1alpha2/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts b/owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts new file mode 100644 index 0000000..b2edea7 --- /dev/null +++ b/owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts @@ -0,0 +1,5251 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as dataformModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha2.DataformClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = dataformModule.v1alpha2.DataformClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = dataformModule.v1alpha2.DataformClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = dataformModule.v1alpha2.DataformClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new dataformModule.v1alpha2.DataformClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new dataformModule.v1alpha2.DataformClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + await client.initialize(); + assert(client.dataformStub); + }); + + it('has close method for the initialized client', done => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataformStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getRepository', () => { + it('invokes getRepository without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); + client.innerApiCalls.getRepository = stubSimpleCall(expectedResponse); + const [response] = await client.getRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getRepository without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); + client.innerApiCalls.getRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRepository( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getRepository with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRepository(request), expectedError); + assert((client.innerApiCalls.getRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getRepository with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRepository(request), expectedError); + }); + }); + + describe('createRepository', () => { + it('invokes createRepository without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); + client.innerApiCalls.createRepository = stubSimpleCall(expectedResponse); + const [response] = await client.createRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createRepository without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); + client.innerApiCalls.createRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRepository( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createRepository with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createRepository(request), expectedError); + assert((client.innerApiCalls.createRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createRepository with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createRepository(request), expectedError); + }); + }); + + describe('updateRepository', () => { + it('invokes updateRepository without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedHeaderRequestParams = "repository.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); + client.innerApiCalls.updateRepository = stubSimpleCall(expectedResponse); + const [response] = await client.updateRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateRepository without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedHeaderRequestParams = "repository.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); + client.innerApiCalls.updateRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRepository( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateRepository with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedHeaderRequestParams = "repository.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateRepository(request), expectedError); + assert((client.innerApiCalls.updateRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateRepository with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateRepository(request), expectedError); + }); + }); + + describe('deleteRepository', () => { + it('invokes deleteRepository without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteRepository = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteRepository without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRepository( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteRepository with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteRepository(request), expectedError); + assert((client.innerApiCalls.deleteRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteRepository with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteRepository(request), expectedError); + }); + }); + + describe('fetchRemoteBranches', () => { + it('invokes fetchRemoteBranches without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse()); + client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(expectedResponse); + const [response] = await client.fetchRemoteBranches(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchRemoteBranches without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse()); + client.innerApiCalls.fetchRemoteBranches = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchRemoteBranches( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchRemoteBranches with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchRemoteBranches(request), expectedError); + assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchRemoteBranches with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchRemoteBranches(request), expectedError); + }); + }); + + describe('getWorkspace', () => { + it('invokes getWorkspace without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); + client.innerApiCalls.getWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkspace without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); + client.innerApiCalls.getWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkspace( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkspace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getWorkspace with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getWorkspace(request), expectedError); + assert((client.innerApiCalls.getWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkspace with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkspace(request), expectedError); + }); + }); + + describe('createWorkspace', () => { + it('invokes createWorkspace without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); + client.innerApiCalls.createWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.createWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkspace without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); + client.innerApiCalls.createWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkspace( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkspace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createWorkspace with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createWorkspace(request), expectedError); + assert((client.innerApiCalls.createWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkspace with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createWorkspace(request), expectedError); + }); + }); + + describe('deleteWorkspace', () => { + it('invokes deleteWorkspace without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkspace without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkspace( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteWorkspace with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteWorkspace(request), expectedError); + assert((client.innerApiCalls.deleteWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkspace with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkspace(request), expectedError); + }); + }); + + describe('installNpmPackages', () => { + it('invokes installNpmPackages without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse()); + client.innerApiCalls.installNpmPackages = stubSimpleCall(expectedResponse); + const [response] = await client.installNpmPackages(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.installNpmPackages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes installNpmPackages without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse()); + client.innerApiCalls.installNpmPackages = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.installNpmPackages( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.installNpmPackages as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes installNpmPackages with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.installNpmPackages = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.installNpmPackages(request), expectedError); + assert((client.innerApiCalls.installNpmPackages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes installNpmPackages with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.installNpmPackages(request), expectedError); + }); + }); + + describe('pullGitCommits', () => { + it('invokes pullGitCommits without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pullGitCommits = stubSimpleCall(expectedResponse); + const [response] = await client.pullGitCommits(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pullGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pullGitCommits without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pullGitCommits = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pullGitCommits( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pullGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pullGitCommits with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pullGitCommits = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pullGitCommits(request), expectedError); + assert((client.innerApiCalls.pullGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pullGitCommits with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pullGitCommits(request), expectedError); + }); + }); + + describe('pushGitCommits', () => { + it('invokes pushGitCommits without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pushGitCommits = stubSimpleCall(expectedResponse); + const [response] = await client.pushGitCommits(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pushGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pushGitCommits without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pushGitCommits = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pushGitCommits( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pushGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pushGitCommits with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pushGitCommits = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pushGitCommits(request), expectedError); + assert((client.innerApiCalls.pushGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pushGitCommits with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pushGitCommits(request), expectedError); + }); + }); + + describe('fetchFileGitStatuses', () => { + it('invokes fetchFileGitStatuses without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse()); + client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(expectedResponse); + const [response] = await client.fetchFileGitStatuses(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileGitStatuses without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse()); + client.innerApiCalls.fetchFileGitStatuses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchFileGitStatuses( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchFileGitStatuses with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchFileGitStatuses(request), expectedError); + assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileGitStatuses with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchFileGitStatuses(request), expectedError); + }); + }); + + describe('fetchGitAheadBehind', () => { + it('invokes fetchGitAheadBehind without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse()); + client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(expectedResponse); + const [response] = await client.fetchGitAheadBehind(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchGitAheadBehind without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse()); + client.innerApiCalls.fetchGitAheadBehind = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchGitAheadBehind( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchGitAheadBehind with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchGitAheadBehind(request), expectedError); + assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchGitAheadBehind with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchGitAheadBehind(request), expectedError); + }); + }); + + describe('commitWorkspaceChanges', () => { + it('invokes commitWorkspaceChanges without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(expectedResponse); + const [response] = await client.commitWorkspaceChanges(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes commitWorkspaceChanges without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.commitWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commitWorkspaceChanges( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes commitWorkspaceChanges with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.commitWorkspaceChanges(request), expectedError); + assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes commitWorkspaceChanges with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.commitWorkspaceChanges(request), expectedError); + }); + }); + + describe('resetWorkspaceChanges', () => { + it('invokes resetWorkspaceChanges without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(expectedResponse); + const [response] = await client.resetWorkspaceChanges(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resetWorkspaceChanges without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resetWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resetWorkspaceChanges( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes resetWorkspaceChanges with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resetWorkspaceChanges(request), expectedError); + assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resetWorkspaceChanges with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resetWorkspaceChanges(request), expectedError); + }); + }); + + describe('fetchFileDiff', () => { + it('invokes fetchFileDiff without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffResponse()); + client.innerApiCalls.fetchFileDiff = stubSimpleCall(expectedResponse); + const [response] = await client.fetchFileDiff(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileDiff as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileDiff without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffResponse()); + client.innerApiCalls.fetchFileDiff = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchFileDiff( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileDiff as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchFileDiff with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchFileDiff = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchFileDiff(request), expectedError); + assert((client.innerApiCalls.fetchFileDiff as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileDiff with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchFileDiff(request), expectedError); + }); + }); + + describe('makeDirectory', () => { + it('invokes makeDirectory without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryResponse()); + client.innerApiCalls.makeDirectory = stubSimpleCall(expectedResponse); + const [response] = await client.makeDirectory(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.makeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes makeDirectory without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryResponse()); + client.innerApiCalls.makeDirectory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.makeDirectory( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.makeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes makeDirectory with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.makeDirectory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.makeDirectory(request), expectedError); + assert((client.innerApiCalls.makeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes makeDirectory with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.makeDirectory(request), expectedError); + }); + }); + + describe('removeDirectory', () => { + it('invokes removeDirectory without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeDirectory = stubSimpleCall(expectedResponse); + const [response] = await client.removeDirectory(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeDirectory without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeDirectory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDirectory( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeDirectory with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDirectory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeDirectory(request), expectedError); + assert((client.innerApiCalls.removeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeDirectory with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeDirectory(request), expectedError); + }); + }); + + describe('moveDirectory', () => { + it('invokes moveDirectory without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryResponse()); + client.innerApiCalls.moveDirectory = stubSimpleCall(expectedResponse); + const [response] = await client.moveDirectory(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveDirectory without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryResponse()); + client.innerApiCalls.moveDirectory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveDirectory( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes moveDirectory with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveDirectory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.moveDirectory(request), expectedError); + assert((client.innerApiCalls.moveDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveDirectory with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moveDirectory(request), expectedError); + }); + }); + + describe('readFile', () => { + it('invokes readFile without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileResponse()); + client.innerApiCalls.readFile = stubSimpleCall(expectedResponse); + const [response] = await client.readFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFile without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileResponse()); + client.innerApiCalls.readFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readFile( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IReadFileResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes readFile with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readFile(request), expectedError); + assert((client.innerApiCalls.readFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFile with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readFile(request), expectedError); + }); + }); + + describe('removeFile', () => { + it('invokes removeFile without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeFile = stubSimpleCall(expectedResponse); + const [response] = await client.removeFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeFile without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeFile( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeFile with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeFile(request), expectedError); + assert((client.innerApiCalls.removeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeFile with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeFile(request), expectedError); + }); + }); + + describe('moveFile', () => { + it('invokes moveFile without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileResponse()); + client.innerApiCalls.moveFile = stubSimpleCall(expectedResponse); + const [response] = await client.moveFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveFile without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileResponse()); + client.innerApiCalls.moveFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveFile( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IMoveFileResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes moveFile with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.moveFile(request), expectedError); + assert((client.innerApiCalls.moveFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveFile with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moveFile(request), expectedError); + }); + }); + + describe('writeFile', () => { + it('invokes writeFile without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileResponse()); + client.innerApiCalls.writeFile = stubSimpleCall(expectedResponse); + const [response] = await client.writeFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeFile without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileResponse()); + client.innerApiCalls.writeFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeFile( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWriteFileResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes writeFile with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.writeFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeFile(request), expectedError); + assert((client.innerApiCalls.writeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeFile with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeFile(request), expectedError); + }); + }); + + describe('getCompilationResult', () => { + it('invokes getCompilationResult without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); + client.innerApiCalls.getCompilationResult = stubSimpleCall(expectedResponse); + const [response] = await client.getCompilationResult(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCompilationResult without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); + client.innerApiCalls.getCompilationResult = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCompilationResult( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResult|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getCompilationResult with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCompilationResult = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCompilationResult(request), expectedError); + assert((client.innerApiCalls.getCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCompilationResult with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCompilationResult(request), expectedError); + }); + }); + + describe('createCompilationResult', () => { + it('invokes createCompilationResult without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); + client.innerApiCalls.createCompilationResult = stubSimpleCall(expectedResponse); + const [response] = await client.createCompilationResult(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCompilationResult without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); + client.innerApiCalls.createCompilationResult = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCompilationResult( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResult|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createCompilationResult with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCompilationResult = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCompilationResult(request), expectedError); + assert((client.innerApiCalls.createCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCompilationResult with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCompilationResult(request), expectedError); + }); + }); + + describe('getWorkflowInvocation', () => { + it('invokes getWorkflowInvocation without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); + client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); + client.innerApiCalls.getWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getWorkflowInvocation with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkflowInvocation(request), expectedError); + }); + }); + + describe('createWorkflowInvocation', () => { + it('invokes createWorkflowInvocation without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); + client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.createWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); + client.innerApiCalls.createWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createWorkflowInvocation with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createWorkflowInvocation(request), expectedError); + }); + }); + + describe('deleteWorkflowInvocation', () => { + it('invokes deleteWorkflowInvocation without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteWorkflowInvocation with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); + }); + }); + + describe('cancelWorkflowInvocation', () => { + it('invokes cancelWorkflowInvocation without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.cancelWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelWorkflowInvocation with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); + }); + }); + + describe('listRepositories', () => { + it('invokes listRepositories without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + ]; + client.innerApiCalls.listRepositories = stubSimpleCall(expectedResponse); + const [response] = await client.listRepositories(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listRepositories as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listRepositories without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + ]; + client.innerApiCalls.listRepositories = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRepositories( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listRepositories as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listRepositories with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRepositories = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRepositories(request), expectedError); + assert((client.innerApiCalls.listRepositories as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listRepositoriesStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + ]; + client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRepositoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.Repository[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Repository) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); + assert.strictEqual( + (client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listRepositoriesStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRepositoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.Repository[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Repository) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); + assert.strictEqual( + (client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRepositories without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), + ]; + client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.IRepository[] = []; + const iterable = client.listRepositoriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRepositories with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRepositoriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.IRepository[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listWorkspaces', () => { + it('invokes listWorkspaces without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + ]; + client.innerApiCalls.listWorkspaces = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkspaces(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkspaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkspaces without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + ]; + client.innerApiCalls.listWorkspaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkspaces( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkspace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkspaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listWorkspaces with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkspaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listWorkspaces(request), expectedError); + assert((client.innerApiCalls.listWorkspaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkspacesStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + ]; + client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.Workspace[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Workspace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkspacesStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.Workspace[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Workspace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkspaces without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), + ]; + client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.IWorkspace[] = []; + const iterable = client.listWorkspacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkspaces with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkspacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.IWorkspace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('queryDirectoryContents', () => { + it('invokes queryDirectoryContents without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.innerApiCalls.queryDirectoryContents = stubSimpleCall(expectedResponse); + const [response] = await client.queryDirectoryContents(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryDirectoryContents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryDirectoryContents without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.innerApiCalls.queryDirectoryContents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryDirectoryContents( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryDirectoryContents as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryDirectoryContents with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryDirectoryContents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryDirectoryContents(request), expectedError); + assert((client.innerApiCalls.queryDirectoryContents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryDirectoryContentsStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryDirectoryContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes queryDirectoryContentsStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedError = new Error('expected'); + client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryDirectoryContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryDirectoryContents without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; + const iterable = client.queryDirectoryContentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryDirectoryContents with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace=";const expectedError = new Error('expected'); + client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryDirectoryContentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCompilationResults', () => { + it('invokes listCompilationResults without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + ]; + client.innerApiCalls.listCompilationResults = stubSimpleCall(expectedResponse); + const [response] = await client.listCompilationResults(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCompilationResults as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCompilationResults without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + ]; + client.innerApiCalls.listCompilationResults = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCompilationResults( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCompilationResults as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listCompilationResults with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCompilationResults = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCompilationResults(request), expectedError); + assert((client.innerApiCalls.listCompilationResults as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCompilationResultsStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + ]; + client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCompilationResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.CompilationResult[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listCompilationResultsStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCompilationResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.CompilationResult[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCompilationResults without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), + ]; + client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResult[] = []; + const iterable = client.listCompilationResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCompilationResults with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCompilationResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('queryCompilationResultActions', () => { + it('invokes queryCompilationResultActions without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + ]; + client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(expectedResponse); + const [response] = await client.queryCompilationResultActions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryCompilationResultActions without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + ]; + client.innerApiCalls.queryCompilationResultActions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryCompilationResultActions( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryCompilationResultActions with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryCompilationResultActions(request), expectedError); + assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryCompilationResultActionsStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + ]; + client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryCompilationResultActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.CompilationResultAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResultAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes queryCompilationResultActionsStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedError = new Error('expected'); + client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryCompilationResultActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.CompilationResultAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResultAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryCompilationResultActions without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), + ]; + client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[] = []; + const iterable = client.queryCompilationResultActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryCompilationResultActions with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); + client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryCompilationResultActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listWorkflowInvocations', () => { + it('invokes listWorkflowInvocations without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + ]; + client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkflowInvocations(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkflowInvocations without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + ]; + client.innerApiCalls.listWorkflowInvocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkflowInvocations( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listWorkflowInvocations with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listWorkflowInvocations(request), expectedError); + assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkflowInvocationsStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + ]; + client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listWorkflowInvocationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkflowInvocationsStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkflowInvocationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkflowInvocations without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), + ]; + client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[] = []; + const iterable = client.listWorkflowInvocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkflowInvocations with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkflowInvocationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('queryWorkflowInvocationActions', () => { + it('invokes queryWorkflowInvocationActions without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + ]; + client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(expectedResponse); + const [response] = await client.queryWorkflowInvocationActions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryWorkflowInvocationActions without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + ]; + client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryWorkflowInvocationActions( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryWorkflowInvocationActions with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryWorkflowInvocationActions(request), expectedError); + assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryWorkflowInvocationActionsStream without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + ]; + client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryWorkflowInvocationActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes queryWorkflowInvocationActionsStream with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedError = new Error('expected'); + client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryWorkflowInvocationActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryWorkflowInvocationActions without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), + ]; + client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[] = []; + const iterable = client.queryWorkflowInvocationActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryWorkflowInvocationActions with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); + client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryWorkflowInvocationActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('compilationResult', () => { + const fakePath = "/rendered/path/compilationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + compilation_result: "compilationResultValue", + }; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.compilationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.compilationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('compilationResultPath', () => { + const result = client.compilationResultPath("projectValue", "locationValue", "repositoryValue", "compilationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.compilationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCompilationResultName', () => { + const result = client.matchProjectFromCompilationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCompilationResultName', () => { + const result = client.matchLocationFromCompilationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromCompilationResultName', () => { + const result = client.matchRepositoryFromCompilationResultName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCompilationResultFromCompilationResultName', () => { + const result = client.matchCompilationResultFromCompilationResultName(fakePath); + assert.strictEqual(result, "compilationResultValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('repository', () => { + const fakePath = "/rendered/path/repository"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + }; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.repositoryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.repositoryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('repositoryPath', () => { + const result = client.repositoryPath("projectValue", "locationValue", "repositoryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.repositoryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRepositoryName', () => { + const result = client.matchProjectFromRepositoryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRepositoryName', () => { + const result = client.matchLocationFromRepositoryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromRepositoryName', () => { + const result = client.matchRepositoryFromRepositoryName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('workflowInvocation', () => { + const fakePath = "/rendered/path/workflowInvocation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + workflow_invocation: "workflowInvocationValue", + }; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workflowInvocationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workflowInvocationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workflowInvocationPath', () => { + const result = client.workflowInvocationPath("projectValue", "locationValue", "repositoryValue", "workflowInvocationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workflowInvocationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkflowInvocationName', () => { + const result = client.matchProjectFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkflowInvocationName', () => { + const result = client.matchLocationFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromWorkflowInvocationName', () => { + const result = client.matchRepositoryFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowInvocationFromWorkflowInvocationName', () => { + const result = client.matchWorkflowInvocationFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "workflowInvocationValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('workspace', () => { + const fakePath = "/rendered/path/workspace"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + workspace: "workspaceValue", + }; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workspacePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workspacePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workspacePath', () => { + const result = client.workspacePath("projectValue", "locationValue", "repositoryValue", "workspaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workspacePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkspaceName', () => { + const result = client.matchProjectFromWorkspaceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkspaceName', () => { + const result = client.matchLocationFromWorkspaceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromWorkspaceName', () => { + const result = client.matchRepositoryFromWorkspaceName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkspaceFromWorkspaceName', () => { + const result = client.matchWorkspaceFromWorkspaceName(fakePath); + assert.strictEqual(result, "workspaceValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1alpha2/tsconfig.json b/owl-bot-staging/v1alpha2/tsconfig.json new file mode 100644 index 0000000..c78f1c8 --- /dev/null +++ b/owl-bot-staging/v1alpha2/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1alpha2/webpack.config.js b/owl-bot-staging/v1alpha2/webpack.config.js new file mode 100644 index 0000000..b2259ed --- /dev/null +++ b/owl-bot-staging/v1alpha2/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Dataform', + filename: './dataform.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/v1beta1/.eslintignore b/owl-bot-staging/v1beta1/.eslintignore new file mode 100644 index 0000000..cfc348e --- /dev/null +++ b/owl-bot-staging/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/v1beta1/.eslintrc.json b/owl-bot-staging/v1beta1/.eslintrc.json new file mode 100644 index 0000000..7821534 --- /dev/null +++ b/owl-bot-staging/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1beta1/.gitignore b/owl-bot-staging/v1beta1/.gitignore new file mode 100644 index 0000000..5d32b23 --- /dev/null +++ b/owl-bot-staging/v1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1beta1/.jsdoc.js b/owl-bot-staging/v1beta1/.jsdoc.js new file mode 100644 index 0000000..166ea79 --- /dev/null +++ b/owl-bot-staging/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2022 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/dataform', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1beta1/.mocharc.js b/owl-bot-staging/v1beta1/.mocharc.js new file mode 100644 index 0000000..481c522 --- /dev/null +++ b/owl-bot-staging/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1beta1/.prettierrc.js b/owl-bot-staging/v1beta1/.prettierrc.js new file mode 100644 index 0000000..494e147 --- /dev/null +++ b/owl-bot-staging/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1beta1/README.md b/owl-bot-staging/v1beta1/README.md new file mode 100644 index 0000000..cd744d1 --- /dev/null +++ b/owl-bot-staging/v1beta1/README.md @@ -0,0 +1 @@ +Dataform: Nodejs Client diff --git a/owl-bot-staging/v1beta1/linkinator.config.json b/owl-bot-staging/v1beta1/linkinator.config.json new file mode 100644 index 0000000..befd23c --- /dev/null +++ b/owl-bot-staging/v1beta1/linkinator.config.json @@ -0,0 +1,16 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" + ], + "silent": true, + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 +} diff --git a/owl-bot-staging/v1beta1/package.json b/owl-bot-staging/v1beta1/package.json new file mode 100644 index 0000000..8b0851c --- /dev/null +++ b/owl-bot-staging/v1beta1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/dataform", + "version": "0.1.0", + "description": "Dataform client for Node.js", + "repository": "googleapis/nodejs-dataform", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google dataform", + "dataform", + "dataform" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^3.2.0" + }, + "devDependencies": { + "@types/mocha": "^9.1.1", + "@types/node": "^16.11.50", + "@types/sinon": "^10.0.13", + "c8": "^7.12.0", + "gts": "^3.1.0", + "jsdoc": "^3.6.11", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.2", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^8.4.0", + "typescript": "^4.7.4", + "webpack": "^4.46.0", + "webpack-cli": "^4.10.0" + }, + "engines": { + "node": ">=v12" + } +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto b/owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto new file mode 100644 index 0000000..57d43c3 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto @@ -0,0 +1,1629 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/type/interval.proto"; + +option csharp_namespace = "Google.Cloud.Dataform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dataform/v1beta1;dataform"; +option java_multiple_files = true; +option java_outer_classname = "DataformProto"; +option java_package = "com.google.cloud.dataform.v1beta1"; +option php_namespace = "Google\\Cloud\\Dataform\\V1beta1"; +option ruby_package = "Google::Cloud::Dataform::V1beta1"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{version}" +}; + +// Dataform is a service to develop, create, document, test, and update curated +// tables in BigQuery. +service Dataform { + option (google.api.default_host) = "dataform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Repositories in a given project and location. + rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/repositories" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single Repository. + rpc GetRepository(GetRepositoryRequest) returns (Repository) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Repository in a given project and location. + rpc CreateRepository(CreateRepositoryRequest) returns (Repository) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/repositories" + body: "repository" + }; + option (google.api.method_signature) = "parent,repository,repository_id"; + } + + // Updates a single Repository. + rpc UpdateRepository(UpdateRepositoryRequest) returns (Repository) { + option (google.api.http) = { + patch: "/v1beta1/{repository.name=projects/*/locations/*/repositories/*}" + body: "repository" + }; + option (google.api.method_signature) = "repository,update_mask"; + } + + // Deletes a single Repository. + rpc DeleteRepository(DeleteRepositoryRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/repositories/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Fetches a Repository's remote branches. + rpc FetchRemoteBranches(FetchRemoteBranchesRequest) returns (FetchRemoteBranchesResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:fetchRemoteBranches" + }; + } + + // Lists Workspaces in a given Repository. + rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single Workspace. + rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Workspace in a given Repository. + rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces" + body: "workspace" + }; + option (google.api.method_signature) = "parent,workspace,workspace_id"; + } + + // Deletes a single Workspace. + rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Installs dependency NPM packages (inside a Workspace). + rpc InstallNpmPackages(InstallNpmPackagesRequest) returns (InstallNpmPackagesResponse) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:installNpmPackages" + body: "*" + }; + } + + // Pulls Git commits from the Repository's remote into a Workspace. + rpc PullGitCommits(PullGitCommitsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:pull" + body: "*" + }; + } + + // Pushes Git commits from a Workspace to the Repository's remote. + rpc PushGitCommits(PushGitCommitsRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:push" + body: "*" + }; + } + + // Fetches Git statuses for the files in a Workspace. + rpc FetchFileGitStatuses(FetchFileGitStatusesRequest) returns (FetchFileGitStatusesResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileGitStatuses" + }; + } + + // Fetches Git ahead/behind against a remote branch. + rpc FetchGitAheadBehind(FetchGitAheadBehindRequest) returns (FetchGitAheadBehindResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind" + }; + } + + // Applies a Git commit for uncommitted files in a Workspace. + rpc CommitWorkspaceChanges(CommitWorkspaceChangesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:commit" + body: "*" + }; + } + + // Performs a Git reset for uncommitted files in a Workspace. + rpc ResetWorkspaceChanges(ResetWorkspaceChangesRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:reset" + body: "*" + }; + } + + // Fetches Git diff for an uncommitted file in a Workspace. + rpc FetchFileDiff(FetchFileDiffRequest) returns (FetchFileDiffResponse) { + option (google.api.http) = { + get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileDiff" + }; + } + + // Returns the contents of a given Workspace directory. + rpc QueryDirectoryContents(QueryDirectoryContentsRequest) returns (QueryDirectoryContentsResponse) { + option (google.api.http) = { + get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents" + }; + } + + // Creates a directory inside a Workspace. + rpc MakeDirectory(MakeDirectoryRequest) returns (MakeDirectoryResponse) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:makeDirectory" + body: "*" + }; + } + + // Deletes a directory (inside a Workspace) and all of its contents. + rpc RemoveDirectory(RemoveDirectoryRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeDirectory" + body: "*" + }; + } + + // Moves a directory (inside a Workspace), and all of its contents, to a new + // location. + rpc MoveDirectory(MoveDirectoryRequest) returns (MoveDirectoryResponse) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveDirectory" + body: "*" + }; + } + + // Returns the contents of a file (inside a Workspace). + rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) { + option (google.api.http) = { + get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile" + }; + } + + // Deletes a file (inside a Workspace). + rpc RemoveFile(RemoveFileRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeFile" + body: "*" + }; + } + + // Moves a file (inside a Workspace) to a new location. + rpc MoveFile(MoveFileRequest) returns (MoveFileResponse) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveFile" + body: "*" + }; + } + + // Writes to a file (inside a Workspace). + rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) { + option (google.api.http) = { + post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:writeFile" + body: "*" + }; + } + + // Lists CompilationResults in a given Repository. + rpc ListCompilationResults(ListCompilationResultsRequest) returns (ListCompilationResultsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single CompilationResult. + rpc GetCompilationResult(GetCompilationResultRequest) returns (CompilationResult) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new CompilationResult in a given project and location. + rpc CreateCompilationResult(CreateCompilationResultRequest) returns (CompilationResult) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults" + body: "compilation_result" + }; + option (google.api.method_signature) = "parent,compilation_result"; + } + + // Returns CompilationResultActions in a given CompilationResult. + rpc QueryCompilationResultActions(QueryCompilationResultActionsRequest) returns (QueryCompilationResultActionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}:query" + }; + } + + // Lists WorkflowInvocations in a given Repository. + rpc ListWorkflowInvocations(ListWorkflowInvocationsRequest) returns (ListWorkflowInvocationsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetches a single WorkflowInvocation. + rpc GetWorkflowInvocation(GetWorkflowInvocationRequest) returns (WorkflowInvocation) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new WorkflowInvocation in a given Repository. + rpc CreateWorkflowInvocation(CreateWorkflowInvocationRequest) returns (WorkflowInvocation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" + body: "workflow_invocation" + }; + option (google.api.method_signature) = "parent,workflow_invocation"; + } + + // Deletes a single WorkflowInvocation. + rpc DeleteWorkflowInvocation(DeleteWorkflowInvocationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Requests cancellation of a running WorkflowInvocation. + rpc CancelWorkflowInvocation(CancelWorkflowInvocationRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:cancel" + body: "*" + }; + } + + // Returns WorkflowInvocationActions in a given WorkflowInvocation. + rpc QueryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest) returns (QueryWorkflowInvocationActionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:query" + }; + } +} + +// Represents a Dataform Git repository. +message Repository { + option (google.api.resource) = { + type: "dataform.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/repositories/{repository}" + }; + + // Controls Git remote configuration for a repository. + message GitRemoteSettings { + // Indicates the status of a Git authentication token. + enum TokenStatus { + // Default value. This value is unused. + TOKEN_STATUS_UNSPECIFIED = 0; + + // The token could not be found in Secret Manager (or the Dataform + // Service Account did not have permission to access it). + NOT_FOUND = 1; + + // The token could not be used to authenticate against the Git remote. + INVALID = 2; + + // The token was used successfully to authenticate against the Git remote. + VALID = 3; + } + + // Required. The Git remote's URL. + string url = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Git remote's default branch name. + string default_branch = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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/*`. + string authentication_token_secret_version = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + + // Output only. Indicates the status of the Git access token. + TokenStatus token_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The repository's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. If set, configures this repository to be linked to a Git remote. + GitRemoteSettings git_remote_settings = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListRepositories` request message. +message ListRepositoriesRequest { + // Required. The location in which to list repositories. Must be in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Maximum number of repositories to return. The server may return fewer + // items than requested. If unspecified, the server will pick an appropriate + // default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter for the returned list. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListRepositories` response message. +message ListRepositoriesResponse { + // List of repositories. + repeated Repository repositories = 1; + + // A token which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetRepository` request message. +message GetRepositoryRequest { + // Required. The repository's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; +} + +// `CreateRepository` request message. +message CreateRepositoryRequest { + // Required. The location in which to create the repository. Must be in the format + // `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The repository to create. + Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the repository, which will become the final component of + // the repository's resource name. + string repository_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `UpdateRepository` request message. +message UpdateRepositoryRequest { + // Optional. Specifies the fields to be updated in the repository. If left unset, + // all fields will be updated. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The repository to update. + Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `DeleteRepository` request message. +message DeleteRepositoryRequest { + // Required. The repository's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // 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.) + bool force = 2; +} + +// `FetchRemoteBranches` request message. +message FetchRemoteBranchesRequest { + // Required. The repository's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; +} + +// `FetchRemoteBranches` response message. +message FetchRemoteBranchesResponse { + // The remote repository's branch names. + repeated string branches = 1; +} + +// Represents a Dataform Git workspace. +message Workspace { + option (google.api.resource) = { + type: "dataform.googleapis.com/Workspace" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}" + }; + + // Output only. The workspace's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `ListWorkspaces` request message. +message ListWorkspacesRequest { + // Required. The repository in which to list workspaces. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Optional. Maximum number of workspaces to return. The server may return fewer + // items than requested. If unspecified, the server will pick an appropriate + // default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter for the returned list. + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListWorkspaces` response message. +message ListWorkspacesResponse { + // List of workspaces. + repeated Workspace workspaces = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetWorkspace` request message. +message GetWorkspaceRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// `CreateWorkspace` request message. +message CreateWorkspaceRequest { + // Required. The repository in which to create the workspace. Must be in the format + // `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Required. The workspace to create. + Workspace workspace = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the workspace, which will become the final component of + // the workspace's resource name. + string workspace_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `DeleteWorkspace` request message. +message DeleteWorkspaceRequest { + // Required. The workspace resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// Represents the author of a Git commit. +message CommitAuthor { + // Required. The commit author's name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The commit author's email address. + string email_address = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `PullGitCommits` request message. +message PullGitCommitsRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The author of any merge commit which may be created as a result of merging + // fetched Git commits into this workspace. + CommitAuthor author = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `PushGitCommits` request message. +message PushGitCommitsRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `FetchFileGitStatuses` request message. +message FetchFileGitStatusesRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// `FetchFileGitStatuses` response message. +message FetchFileGitStatusesResponse { + // Represents the Git state of a file with uncommitted changes. + message UncommittedFileChange { + // Indicates the status of an uncommitted file change. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The file has been newly added. + ADDED = 1; + + // The file has been deleted. + DELETED = 2; + + // The file has been modified. + MODIFIED = 3; + + // The file contains merge conflicts. + HAS_CONFLICTS = 4; + } + + // The file's full path including filename, relative to the workspace root. + string path = 1; + + // Indicates the status of the file. + State state = 2; + } + + // A list of all files which have uncommitted Git changes. There will only be + // a single entry for any given file. + repeated UncommittedFileChange uncommitted_file_changes = 1; +} + +// `FetchGitAheadBehind` request message. +message FetchGitAheadBehindRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// `FetchGitAheadBehind` response message. +message FetchGitAheadBehindResponse { + // The number of commits in the remote branch that are not in the workspace. + int32 commits_ahead = 1; + + // The number of commits in the workspace that are not in the remote branch. + int32 commits_behind = 2; +} + +// `CommitWorkspaceChanges` request message. +message CommitWorkspaceChangesRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The commit's author. + CommitAuthor author = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The commit's message. + string commit_message = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full file paths to commit including filename, rooted at workspace root. If + // left empty, all files will be committed. + repeated string paths = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ResetWorkspaceChanges` request message. +message ResetWorkspaceChangesRequest { + // Required. The workspace's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // 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. + repeated string paths = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, untracked files will be deleted. + bool clean = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `FetchFileDiff` request message. +message FetchFileDiffRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `FetchFileDiff` response message. +message FetchFileDiffResponse { + // The raw formatted Git diff for the file. + string formatted_diff = 1; +} + +// `QueryDirectoryContents` request message. +message QueryDirectoryContentsRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Optional. The directory's full path including directory name, relative to the + // workspace root. If left unset, the workspace root is used. + string path = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of paths to return. The server may return fewer + // items than requested. If unspecified, the server will pick an appropriate + // default. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// `QueryDirectoryContents` response message. +message QueryDirectoryContentsResponse { + // Represents a single entry in a workspace directory. + message DirectoryEntry { + oneof entry { + // A file in the directory. + string file = 1; + + // A child directory in the directory. + string directory = 2; + } + } + + // List of entries in the directory. + repeated DirectoryEntry directory_entries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// `MakeDirectory` request message. +message MakeDirectoryRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The directory's full path including directory name, relative to the + // workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `MakeDirectory` response message. +message MakeDirectoryResponse { + +} + +// `RemoveDirectory` request message. +message RemoveDirectoryRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The directory's full path including directory name, relative to the + // workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveDirectory` request message. +message MoveDirectoryRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The directory's full path including directory name, relative to the + // workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new path for the directory including directory name, rooted at + // workspace root. + string new_path = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveDirectory` response message. +message MoveDirectoryResponse { + +} + +// `ReadFile` request message. +message ReadFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `ReadFile` response message. +message ReadFileResponse { + // The file's contents. + bytes file_contents = 1; +} + +// `RemoveFile` request message. +message RemoveFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveFile` request message. +message MoveFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file's full path including filename, relative to the workspace root. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The file's new path including filename, relative to the workspace root. + string new_path = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `MoveFile` response message. +message MoveFileResponse { + +} + +// `WriteFile` request message. +message WriteFileRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + + // Required. The file. + string path = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The file's contents. + bytes contents = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// `WriteFile` response message. +message WriteFileResponse { + +} + +// `InstallNpmPackages` request message. +message InstallNpmPackagesRequest { + // Required. The workspace's name. + string workspace = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; +} + +// `InstallNpmPackages` response message. +message InstallNpmPackagesResponse { + +} + +// Represents the result of compiling a Dataform project. +message CompilationResult { + option (google.api.resource) = { + type: "dataform.googleapis.com/CompilationResult" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}" + }; + + // Configures various aspects of Dataform code compilation. + message CodeCompilationConfig { + // Optional. The default database (Google Cloud project ID). + string default_database = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default schema (BigQuery dataset ID). + string default_schema = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string default_location = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The default schema (BigQuery dataset ID) for assertions. + string assertion_schema = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User-defined variables that are made available to project code during + // compilation. + map vars = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The suffix that should be appended to all database (Google Cloud project + // ID) names. + string database_suffix = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The suffix that should be appended to all schema (BigQuery dataset ID) + // names. + string schema_suffix = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prefix that should be prepended to all table names. + string table_prefix = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // An error encountered when attempting to compile a Dataform project. + message CompilationError { + // Output only. The error's top level message. + string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error's full stack trace. + string stack = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The path of the file where this error occurred, if available, relative to + // the project root. + string path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The identifier of the action where this error occurred, if available. + Target action_target = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The compilation result's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + oneof source { + // 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` + string git_commitish = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The name of the workspace to compile. Must be in the format + // `projects/*/locations/*/repositories/*/workspaces/*`. + string workspace = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Workspace" + } + ]; + } + + // Immutable. If set, fields of `code_compilation_overrides` override the default + // compilation settings that are specified in dataform.json. + CodeCompilationConfig code_compilation_config = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The version of `@dataform/core` that was used for compilation. + string dataform_core_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Errors encountered during project compilation. + repeated CompilationError compilation_errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `ListCompilationResults` request message. +message ListCompilationResultsRequest { + // Required. The repository in which to list compilation results. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListCompilationResults` response message. +message ListCompilationResultsResponse { + // List of compilation results. + repeated CompilationResult compilation_results = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetCompilationResult` request message. +message GetCompilationResultRequest { + // Required. The compilation result's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/CompilationResult" + } + ]; +} + +// `CreateCompilationResult` request message. +message CreateCompilationResultRequest { + // Required. The repository in which to create the compilation result. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Required. The compilation result to create. + CompilationResult compilation_result = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents an action identifier. If the action writes output, the output +// will be written to the referenced database object. +message Target { + // The action's database (Google Cloud project ID) . + string database = 1; + + // The action's schema (BigQuery dataset ID), within `database`. + string schema = 2; + + // The action's name, within `database` and `schema`. + string name = 3; +} + +// Describes a relation and its columns. +message RelationDescriptor { + // Describes a column. + message ColumnDescriptor { + // The identifier for the column. Each entry in `path` represents one level + // of nesting. + repeated string path = 1; + + // A textual description of the column. + string description = 2; + + // A list of BigQuery policy tags that will be applied to the column. + repeated string bigquery_policy_tags = 3; + } + + // A text description of the relation. + string description = 1; + + // A list of descriptions of columns within the relation. + repeated ColumnDescriptor columns = 2; + + // A set of BigQuery labels that should be applied to the relation. + map bigquery_labels = 3; +} + +// Represents a single Dataform action in a compilation result. +message CompilationResultAction { + // Represents a database relation. + message Relation { + // Indicates the type of this relation. + enum RelationType { + // Default value. This value is unused. + RELATION_TYPE_UNSPECIFIED = 0; + + // The relation is a table. + TABLE = 1; + + // The relation is a view. + VIEW = 2; + + // The relation is an incrementalized table. + INCREMENTAL_TABLE = 3; + + // The relation is a materialized view. + MATERIALIZED_VIEW = 4; + } + + // Contains settings for relations of type `INCREMENTAL_TABLE`. + message IncrementalTableConfig { + // The SELECT query which returns rows which should be inserted into the + // relation if it already exists and is not being refreshed. + string incremental_select_query = 1; + + // Whether this table should be protected from being refreshed. + bool refresh_disabled = 2; + + // 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. + repeated string unique_key_parts = 3; + + // A SQL expression conditional used to limit the set of existing rows + // considered for a merge operation (see `unique_key_parts` for more + // information). + string update_partition_filter = 4; + + // SQL statements to be executed before inserting new rows into the + // relation. + repeated string incremental_pre_operations = 5; + + // SQL statements to be executed after inserting new rows into the + // relation. + repeated string incremental_post_operations = 6; + } + + // A list of actions that this action depends on. + repeated Target dependency_targets = 1; + + // Whether this action is disabled (i.e. should not be run). + bool disabled = 2; + + // Arbitrary, user-defined tags on this action. + repeated string tags = 3; + + // Descriptor for the relation and its columns. + RelationDescriptor relation_descriptor = 4; + + // The type of this relation. + RelationType relation_type = 5; + + // The SELECT query which returns rows which this relation should contain. + string select_query = 6; + + // SQL statements to be executed before creating the relation. + repeated string pre_operations = 7; + + // SQL statements to be executed after creating the relation. + repeated string post_operations = 8; + + // Configures `INCREMENTAL_TABLE` settings for this relation. Only set if + // `relation_type` is `INCREMENTAL_TABLE`. + IncrementalTableConfig incremental_table_config = 9; + + // The SQL expression used to partition the relation. + string partition_expression = 10; + + // A list of columns or SQL expressions used to cluster the table. + repeated string cluster_expressions = 11; + + // Sets the partition expiration in days. + int32 partition_expiration_days = 12; + + // Specifies whether queries on this table must include a predicate filter + // that filters on the partitioning column. + bool require_partition_filter = 13; + + // 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. + map additional_options = 14; + } + + // Represents a list of arbitrary database operations. + message Operations { + // A list of actions that this action depends on. + repeated Target dependency_targets = 1; + + // Whether this action is disabled (i.e. should not be run). + bool disabled = 2; + + // Arbitrary, user-defined tags on this action. + repeated string tags = 3; + + // Descriptor for any output relation and its columns. Only set if + // `has_output` is true. + RelationDescriptor relation_descriptor = 6; + + // A list of arbitrary SQL statements that will be executed without + // alteration. + repeated string queries = 4; + + // Whether these operations produce an output relation. + bool has_output = 5; + } + + // Represents an assertion upon a SQL query which is required return zero + // rows. + message Assertion { + // A list of actions that this action depends on. + repeated Target dependency_targets = 1; + + // The parent action of this assertion. Only set if this assertion was + // automatically generated. + Target parent_action = 5; + + // Whether this action is disabled (i.e. should not be run). + bool disabled = 2; + + // Arbitrary, user-defined tags on this action. + repeated string tags = 3; + + // The SELECT query which must return zero rows in order for this assertion + // to succeed. + string select_query = 4; + + // Descriptor for the assertion's automatically-generated view and its + // columns. + RelationDescriptor relation_descriptor = 6; + } + + // Represents a relation which is not managed by Dataform but which may be + // referenced by Dataform actions. + message 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 relation_descriptor = 1; + } + + // This action's identifier. Unique within the compilation result. + Target target = 1; + + // The action's identifier if the project had been compiled without any + // overrides configured. Unique within the compilation result. + Target canonical_target = 2; + + // The full path including filename in which this action is located, relative + // to the workspace root. + string file_path = 3; + + oneof compiled_object { + // The database relation created/updated by this action. + Relation relation = 4; + + // The database operations executed by this action. + Operations operations = 5; + + // The assertion executed by this action. + Assertion assertion = 6; + + // The declaration declared by this action. + Declaration declaration = 7; + } +} + +// `QueryCompilationResultActions` request message. +message QueryCompilationResultActionsRequest { + // Required. The compilation result's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/CompilationResult" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional filter for the returned list. Filtering is only currently + // supported on the `file_path` field. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// `QueryCompilationResultActions` response message. +message QueryCompilationResultActionsResponse { + // List of compilation result actions. + repeated CompilationResultAction compilation_result_actions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Represents a single invocation of a compilation result. +message WorkflowInvocation { + option (google.api.resource) = { + type: "dataform.googleapis.com/WorkflowInvocation" + pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}" + }; + + // Includes various configuration options for this workflow invocation. + // If both `included_targets` and `included_tags` are unset, all actions + // will be included. + message InvocationConfig { + // Immutable. The set of action identifiers to include. + repeated Target included_targets = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The set of tags to include. + repeated string included_tags = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. When set to true, transitive dependencies of included actions will be + // executed. + bool transitive_dependencies_included = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. When set to true, transitive dependents of included actions will be + // executed. + bool transitive_dependents_included = 4 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. When set to true, any incremental tables will be fully refreshed. + bool fully_refresh_incremental_tables_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; + } + + // Represents the current state of a workflow invocation. + enum State { + // Default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The workflow invocation is currently running. + RUNNING = 1; + + // The workflow invocation succeeded. A terminal state. + SUCCEEDED = 2; + + // The workflow invocation was cancelled. A terminal state. + CANCELLED = 3; + + // The workflow invocation failed. A terminal state. + FAILED = 4; + + // The workflow invocation is being cancelled, but some actions are still + // running. + CANCELING = 5; + } + + // Output only. The workflow invocation's name. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The name of the compilation result to compile. Must be in the format + // `projects/*/locations/*/repositories/*/compilationResults/*`. + string compilation_result = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/CompilationResult" + } + ]; + + // Immutable. If left unset, a default InvocationConfig will be used. + InvocationConfig invocation_config = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. This workflow invocation's current state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This workflow invocation's timing details. + google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `ListWorkflowInvocations` request message. +message ListWorkflowInvocationsRequest { + // Required. The parent resource of the WorkflowInvocation type. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `ListWorkflowInvocations` response message. +message ListWorkflowInvocationsResponse { + // List of workflow invocations. + repeated WorkflowInvocation workflow_invocations = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations which could not be reached. + repeated string unreachable = 3; +} + +// `GetWorkflowInvocation` request message. +message GetWorkflowInvocationRequest { + // Required. The workflow invocation resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; +} + +// `CreateWorkflowInvocation` request message. +message CreateWorkflowInvocationRequest { + // Required. The repository in which to create the workflow invocation. Must be in the + // format `projects/*/locations/*/repositories/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/Repository" + } + ]; + + // Required. The workflow invocation resource to create. + WorkflowInvocation workflow_invocation = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `DeleteWorkflowInvocation` request message. +message DeleteWorkflowInvocationRequest { + // Required. The workflow invocation resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; +} + +// `CancelWorkflowInvocation` request message. +message CancelWorkflowInvocationRequest { + // Required. The workflow invocation resource's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; +} + +// Represents a single action in a workflow invocation. +message WorkflowInvocationAction { + // Represents the current state of an workflow invocation action. + enum State { + // The action has not yet been considered for invocation. + PENDING = 0; + + // The action is currently running. + RUNNING = 1; + + // Execution of the action was skipped because upstream dependencies did not + // all complete successfully. A terminal state. + SKIPPED = 2; + + // Execution of the action was disabled as per the configuration of the + // corresponding compilation result action. A terminal state. + DISABLED = 3; + + // The action succeeded. A terminal state. + SUCCEEDED = 4; + + // The action was cancelled. A terminal state. + CANCELLED = 5; + + // The action failed. A terminal state. + FAILED = 6; + } + + // Represents a workflow action that will run against BigQuery. + message BigQueryAction { + // Output only. The generated BigQuery SQL script that will be executed. + string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. This action's identifier. Unique within the workflow invocation. + Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The action's identifier if the project had been compiled without any + // overrides configured. Unique within the compilation result. + Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This action's current state. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If and only if action's state is FAILED a failure reason is set. + string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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. + google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The workflow action's bigquery action details. + BigQueryAction bigquery_action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `QueryWorkflowInvocationActions` request message. +message QueryWorkflowInvocationActionsRequest { + // Required. The workflow invocation's name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataform.googleapis.com/WorkflowInvocation" + } + ]; + + // 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. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// `QueryWorkflowInvocationActions` response message. +message QueryWorkflowInvocationActionsResponse { + // List of workflow invocation actions. + repeated WorkflowInvocationAction workflow_invocation_actions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js new file mode 100644 index 0000000..2028cb6 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCancelWorkflowInvocation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.cancelWorkflowInvocation(request); + console.log(response); + } + + callCancelWorkflowInvocation(); + // [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js new file mode 100644 index 0000000..01e533e --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, author) { + // [START dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * Required. The commit's author. + */ + // const author = {} + /** + * Optional. The commit's message. + */ + // const commitMessage = 'abc123' + /** + * Optional. Full file paths to commit including filename, rooted at workspace root. If + * left empty, all files will be committed. + */ + // const paths = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCommitWorkspaceChanges() { + // Construct request + const request = { + name, + author, + }; + + // Run request + const response = await dataformClient.commitWorkspaceChanges(request); + console.log(response); + } + + callCommitWorkspaceChanges(); + // [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js new file mode 100644 index 0000000..8826207 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, compilationResult) { + // [START dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to create the compilation result. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Required. The compilation result to create. + */ + // const compilationResult = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateCompilationResult() { + // Construct request + const request = { + parent, + compilationResult, + }; + + // Run request + const response = await dataformClient.createCompilationResult(request); + console.log(response); + } + + callCreateCompilationResult(); + // [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js new file mode 100644 index 0000000..b0d66cd --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, repository, repositoryId) { + // [START dataform_v1beta1_generated_Dataform_CreateRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location in which to create the repository. Must be in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Required. The repository to create. + */ + // const repository = {} + /** + * Required. The ID to use for the repository, which will become the final component of + * the repository's resource name. + */ + // const repositoryId = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateRepository() { + // Construct request + const request = { + parent, + repository, + repositoryId, + }; + + // Run request + const response = await dataformClient.createRepository(request); + console.log(response); + } + + callCreateRepository(); + // [END dataform_v1beta1_generated_Dataform_CreateRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js new file mode 100644 index 0000000..9108d48 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workflowInvocation) { + // [START dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to create the workflow invocation. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Required. The workflow invocation resource to create. + */ + // const workflowInvocation = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateWorkflowInvocation() { + // Construct request + const request = { + parent, + workflowInvocation, + }; + + // Run request + const response = await dataformClient.createWorkflowInvocation(request); + console.log(response); + } + + callCreateWorkflowInvocation(); + // [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js new file mode 100644 index 0000000..531becb --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workspace, workspaceId) { + // [START dataform_v1beta1_generated_Dataform_CreateWorkspace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to create the workspace. Must be in the format + * `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Required. The workspace to create. + */ + // const workspace = {} + /** + * Required. The ID to use for the workspace, which will become the final component of + * the workspace's resource name. + */ + // const workspaceId = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callCreateWorkspace() { + // Construct request + const request = { + parent, + workspace, + workspaceId, + }; + + // Run request + const response = await dataformClient.createWorkspace(request); + console.log(response); + } + + callCreateWorkspace(); + // [END dataform_v1beta1_generated_Dataform_CreateWorkspace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js new file mode 100644 index 0000000..ad2ad43 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_DeleteRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository's name. + */ + // const name = 'abc123' + /** + * 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.) + */ + // const force = true + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callDeleteRepository() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.deleteRepository(request); + console.log(response); + } + + callDeleteRepository(); + // [END dataform_v1beta1_generated_Dataform_DeleteRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js new file mode 100644 index 0000000..ab0aaac --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callDeleteWorkflowInvocation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.deleteWorkflowInvocation(request); + console.log(response); + } + + callDeleteWorkflowInvocation(); + // [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js new file mode 100644 index 0000000..5c0060d --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callDeleteWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.deleteWorkspace(request); + console.log(response); + } + + callDeleteWorkspace(); + // [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js new file mode 100644 index 0000000..2df2eb2 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1beta1_generated_Dataform_FetchFileDiff_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchFileDiff() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.fetchFileDiff(request); + console.log(response); + } + + callFetchFileDiff(); + // [END dataform_v1beta1_generated_Dataform_FetchFileDiff_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js new file mode 100644 index 0000000..03cfe21 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchFileGitStatuses() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.fetchFileGitStatuses(request); + console.log(response); + } + + callFetchFileGitStatuses(); + // [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js new file mode 100644 index 0000000..733dde9 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const remoteBranch = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchGitAheadBehind() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.fetchGitAheadBehind(request); + console.log(response); + } + + callFetchGitAheadBehind(); + // [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js new file mode 100644 index 0000000..43c3d2a --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callFetchRemoteBranches() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.fetchRemoteBranches(request); + console.log(response); + } + + callFetchRemoteBranches(); + // [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js new file mode 100644 index 0000000..ee22ddb --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_GetCompilationResult_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The compilation result's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetCompilationResult() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getCompilationResult(request); + console.log(response); + } + + callGetCompilationResult(); + // [END dataform_v1beta1_generated_Dataform_GetCompilationResult_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js new file mode 100644 index 0000000..071180c --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_GetRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetRepository() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getRepository(request); + console.log(response); + } + + callGetRepository(); + // [END dataform_v1beta1_generated_Dataform_GetRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js new file mode 100644 index 0000000..9e48759 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation resource's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetWorkflowInvocation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getWorkflowInvocation(request); + console.log(response); + } + + callGetWorkflowInvocation(); + // [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js new file mode 100644 index 0000000..6c22c2e --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_GetWorkspace_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callGetWorkspace() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.getWorkspace(request); + console.log(response); + } + + callGetWorkspace(); + // [END dataform_v1beta1_generated_Dataform_GetWorkspace_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js new file mode 100644 index 0000000..d8ecbf9 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace) { + // [START dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callInstallNpmPackages() { + // Construct request + const request = { + workspace, + }; + + // Run request + const response = await dataformClient.installNpmPackages(request); + console.log(response); + } + + callInstallNpmPackages(); + // [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js new file mode 100644 index 0000000..ec422dd --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1beta1_generated_Dataform_ListCompilationResults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListCompilationResults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listCompilationResultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCompilationResults(); + // [END dataform_v1beta1_generated_Dataform_ListCompilationResults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js new file mode 100644 index 0000000..279161f --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1beta1_generated_Dataform_ListRepositories_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * 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. + */ + // const orderBy = 'abc123' + /** + * Optional. Filter for the returned list. + */ + // const filter = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListRepositories() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listRepositoriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRepositories(); + // [END dataform_v1beta1_generated_Dataform_ListRepositories_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js new file mode 100644 index 0000000..e9194a1 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListWorkflowInvocations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listWorkflowInvocationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkflowInvocations(); + // [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js new file mode 100644 index 0000000..fbf8647 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START dataform_v1beta1_generated_Dataform_ListWorkspaces_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * 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. + */ + // const orderBy = 'abc123' + /** + * Optional. Filter for the returned list. + */ + // const filter = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callListWorkspaces() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await dataformClient.listWorkspacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkspaces(); + // [END dataform_v1beta1_generated_Dataform_ListWorkspaces_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js new file mode 100644 index 0000000..b352c7b --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1beta1_generated_Dataform_MakeDirectory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The directory's full path including directory name, relative to the + * workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callMakeDirectory() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.makeDirectory(request); + console.log(response); + } + + callMakeDirectory(); + // [END dataform_v1beta1_generated_Dataform_MakeDirectory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js new file mode 100644 index 0000000..ec43257 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path, newPath) { + // [START dataform_v1beta1_generated_Dataform_MoveDirectory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The directory's full path including directory name, relative to the + * workspace root. + */ + // const path = 'abc123' + /** + * Required. The new path for the directory including directory name, rooted at + * workspace root. + */ + // const newPath = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callMoveDirectory() { + // Construct request + const request = { + workspace, + path, + newPath, + }; + + // Run request + const response = await dataformClient.moveDirectory(request); + console.log(response); + } + + callMoveDirectory(); + // [END dataform_v1beta1_generated_Dataform_MoveDirectory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js new file mode 100644 index 0000000..c00db1f --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path, newPath) { + // [START dataform_v1beta1_generated_Dataform_MoveFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + /** + * Required. The file's new path including filename, relative to the workspace root. + */ + // const newPath = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callMoveFile() { + // Construct request + const request = { + workspace, + path, + newPath, + }; + + // Run request + const response = await dataformClient.moveFile(request); + console.log(response); + } + + callMoveFile(); + // [END dataform_v1beta1_generated_Dataform_MoveFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js new file mode 100644 index 0000000..18c8f38 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js @@ -0,0 +1,72 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, author) { + // [START dataform_v1beta1_generated_Dataform_PullGitCommits_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const remoteBranch = 'abc123' + /** + * Required. The author of any merge commit which may be created as a result of merging + * fetched Git commits into this workspace. + */ + // const author = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callPullGitCommits() { + // Construct request + const request = { + name, + author, + }; + + // Run request + const response = await dataformClient.pullGitCommits(request); + console.log(response); + } + + callPullGitCommits(); + // [END dataform_v1beta1_generated_Dataform_PullGitCommits_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js new file mode 100644 index 0000000..0863cf3 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_PushGitCommits_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const remoteBranch = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callPushGitCommits() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.pushGitCommits(request); + console.log(response); + } + + callPushGitCommits(); + // [END dataform_v1beta1_generated_Dataform_PushGitCommits_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js new file mode 100644 index 0000000..1690b94 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The compilation result's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + /** + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + */ + // const filter = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callQueryCompilationResultActions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await dataformClient.queryCompilationResultActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callQueryCompilationResultActions(); + // [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js new file mode 100644 index 0000000..c779211 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace) { + // [START dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + */ + // const path = 'abc123' + /** + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callQueryDirectoryContents() { + // Construct request + const request = { + workspace, + }; + + // Run request + const iterable = await dataformClient.queryDirectoryContentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callQueryDirectoryContents(); + // [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js new file mode 100644 index 0000000..9a7531e --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js @@ -0,0 +1,77 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workflow invocation's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const pageSize = 1234 + /** + * 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. + */ + // const pageToken = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callQueryWorkflowInvocationActions() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await dataformClient.queryWorkflowInvocationActionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callQueryWorkflowInvocationActions(); + // [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js new file mode 100644 index 0000000..61d5eeb --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1beta1_generated_Dataform_ReadFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callReadFile() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.readFile(request); + console.log(response); + } + + callReadFile(); + // [END dataform_v1beta1_generated_Dataform_ReadFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js new file mode 100644 index 0000000..c22c6a1 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js @@ -0,0 +1,67 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1beta1_generated_Dataform_RemoveDirectory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The directory's full path including directory name, relative to the + * workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callRemoveDirectory() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.removeDirectory(request); + console.log(response); + } + + callRemoveDirectory(); + // [END dataform_v1beta1_generated_Dataform_RemoveDirectory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js new file mode 100644 index 0000000..22a7529 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path) { + // [START dataform_v1beta1_generated_Dataform_RemoveFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file's full path including filename, relative to the workspace root. + */ + // const path = 'abc123' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callRemoveFile() { + // Construct request + const request = { + workspace, + path, + }; + + // Run request + const response = await dataformClient.removeFile(request); + console.log(response); + } + + callRemoveFile(); + // [END dataform_v1beta1_generated_Dataform_RemoveFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js new file mode 100644 index 0000000..e611fb1 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const name = 'abc123' + /** + * 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. + */ + // const paths = 'abc123' + /** + * Optional. If set to true, untracked files will be deleted. + */ + // const clean = true + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callResetWorkspaceChanges() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataformClient.resetWorkspaceChanges(request); + console.log(response); + } + + callResetWorkspaceChanges(); + // [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js new file mode 100644 index 0000000..ce879f0 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js @@ -0,0 +1,66 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(repository) { + // [START dataform_v1beta1_generated_Dataform_UpdateRepository_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Specifies the fields to be updated in the repository. If left unset, + * all fields will be updated. + */ + // const updateMask = {} + /** + * Required. The repository to update. + */ + // const repository = {} + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callUpdateRepository() { + // Construct request + const request = { + repository, + }; + + // Run request + const response = await dataformClient.updateRepository(request); + console.log(response); + } + + callUpdateRepository(); + // [END dataform_v1beta1_generated_Dataform_UpdateRepository_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js new file mode 100644 index 0000000..33502bd --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workspace, path, contents) { + // [START dataform_v1beta1_generated_Dataform_WriteFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The workspace's name. + */ + // const workspace = 'abc123' + /** + * Required. The file. + */ + // const path = 'abc123' + /** + * Required. The file's contents. + */ + // const contents = 'Buffer.from('string')' + + // Imports the Dataform library + const {DataformClient} = require('@google-cloud/dataform').v1beta1; + + // Instantiates a client + const dataformClient = new DataformClient(); + + async function callWriteFile() { + // Construct request + const request = { + workspace, + path, + contents, + }; + + // Run request + const response = await dataformClient.writeFile(request); + console.log(response); + } + + callWriteFile(); + // [END dataform_v1beta1_generated_Dataform_WriteFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json b/owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json new file mode 100644 index 0000000..38a4377 --- /dev/null +++ b/owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json @@ -0,0 +1,1647 @@ +{ + "clientLibrary": { + "name": "nodejs-dataform", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.dataform.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "dataform_v1beta1_generated_Dataform_ListRepositories_async", + "title": "Dataform listRepositories Sample", + "origin": "API_DEFINITION", + "description": " Lists Repositories in a given project and location.", + "canonical": true, + "file": "dataform.list_repositories.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRepositories", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.ListRepositoriesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "ListRepositories", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_GetRepository_async", + "title": "Dataform getRepository Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single Repository.", + "canonical": true, + "file": "dataform.get_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.Repository", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "GetRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_CreateRepository_async", + "title": "Dataform createRepository Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Repository in a given project and location.", + "canonical": true, + "file": "dataform.create_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "repository", + "type": ".google.cloud.dataform.v1beta1.Repository" + }, + { + "name": "repository_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.Repository", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "CreateRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_UpdateRepository_async", + "title": "Dataform updateRepository Sample", + "origin": "API_DEFINITION", + "description": " Updates a single Repository.", + "canonical": true, + "file": "dataform.update_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "repository", + "type": ".google.cloud.dataform.v1beta1.Repository" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.Repository", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "UpdateRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteRepository_async", + "title": "Dataform deleteRepository Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Repository.", + "canonical": true, + "file": "dataform.delete_repository.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "DeleteRepository", + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async", + "title": "Dataform fetchRemoteBranches Sample", + "origin": "API_DEFINITION", + "description": " Fetches a Repository's remote branches.", + "canonical": true, + "file": "dataform.fetch_remote_branches.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchRemoteBranches", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "FetchRemoteBranches", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkspaces_async", + "title": "Dataform listWorkspaces Sample", + "origin": "API_DEFINITION", + "description": " Lists Workspaces in a given Repository.", + "canonical": true, + "file": "dataform.list_workspaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkspaces", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.ListWorkspacesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "ListWorkspaces", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkspace_async", + "title": "Dataform getWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single Workspace.", + "canonical": true, + "file": "dataform.get_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkspace", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.Workspace", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "GetWorkspace", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkspace_async", + "title": "Dataform createWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Workspace in a given Repository.", + "canonical": true, + "file": "dataform.create_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkspace", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workspace", + "type": ".google.cloud.dataform.v1beta1.Workspace" + }, + { + "name": "workspace_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.Workspace", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "CreateWorkspace", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkspace_async", + "title": "Dataform deleteWorkspace Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Workspace.", + "canonical": true, + "file": "dataform.delete_workspace.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkspace", + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "DeleteWorkspace", + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_InstallNpmPackages_async", + "title": "Dataform installNpmPackages Sample", + "origin": "API_DEFINITION", + "description": " Installs dependency NPM packages (inside a Workspace).", + "canonical": true, + "file": "dataform.install_npm_packages.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InstallNpmPackages", + "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.InstallNpmPackagesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "InstallNpmPackages", + "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_PullGitCommits_async", + "title": "Dataform pullGitCommits Sample", + "origin": "API_DEFINITION", + "description": " Pulls Git commits from the Repository's remote into a Workspace.", + "canonical": true, + "file": "dataform.pull_git_commits.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PullGitCommits", + "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "remote_branch", + "type": "TYPE_STRING" + }, + { + "name": "author", + "type": ".google.cloud.dataform.v1beta1.CommitAuthor" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "PullGitCommits", + "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_PushGitCommits_async", + "title": "Dataform pushGitCommits Sample", + "origin": "API_DEFINITION", + "description": " Pushes Git commits from a Workspace to the Repository's remote.", + "canonical": true, + "file": "dataform.push_git_commits.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PushGitCommits", + "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "remote_branch", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "PushGitCommits", + "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async", + "title": "Dataform fetchFileGitStatuses Sample", + "origin": "API_DEFINITION", + "description": " Fetches Git statuses for the files in a Workspace.", + "canonical": true, + "file": "dataform.fetch_file_git_statuses.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchFileGitStatuses", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "FetchFileGitStatuses", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async", + "title": "Dataform fetchGitAheadBehind Sample", + "origin": "API_DEFINITION", + "description": " Fetches Git ahead/behind against a remote branch.", + "canonical": true, + "file": "dataform.fetch_git_ahead_behind.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchGitAheadBehind", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "remote_branch", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "FetchGitAheadBehind", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async", + "title": "Dataform commitWorkspaceChanges Sample", + "origin": "API_DEFINITION", + "description": " Applies a Git commit for uncommitted files in a Workspace.", + "canonical": true, + "file": "dataform.commit_workspace_changes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CommitWorkspaceChanges", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "author", + "type": ".google.cloud.dataform.v1beta1.CommitAuthor" + }, + { + "name": "commit_message", + "type": "TYPE_STRING" + }, + { + "name": "paths", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "CommitWorkspaceChanges", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async", + "title": "Dataform resetWorkspaceChanges Sample", + "origin": "API_DEFINITION", + "description": " Performs a Git reset for uncommitted files in a Workspace.", + "canonical": true, + "file": "dataform.reset_workspace_changes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResetWorkspaceChanges", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "paths", + "type": "TYPE_STRING[]" + }, + { + "name": "clean", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "ResetWorkspaceChanges", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileDiff_async", + "title": "Dataform fetchFileDiff Sample", + "origin": "API_DEFINITION", + "description": " Fetches Git diff for an uncommitted file in a Workspace.", + "canonical": true, + "file": "dataform.fetch_file_diff.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchFileDiff", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.FetchFileDiffResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "FetchFileDiff", + "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async", + "title": "Dataform queryDirectoryContents Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a given Workspace directory.", + "canonical": true, + "file": "dataform.query_directory_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryDirectoryContents", + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "QueryDirectoryContents", + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_MakeDirectory_async", + "title": "Dataform makeDirectory Sample", + "origin": "API_DEFINITION", + "description": " Creates a directory inside a Workspace.", + "canonical": true, + "file": "dataform.make_directory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MakeDirectory", + "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.MakeDirectoryResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "MakeDirectory", + "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_RemoveDirectory_async", + "title": "Dataform removeDirectory Sample", + "origin": "API_DEFINITION", + "description": " Deletes a directory (inside a Workspace) and all of its contents.", + "canonical": true, + "file": "dataform.remove_directory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveDirectory", + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "RemoveDirectory", + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_MoveDirectory_async", + "title": "Dataform moveDirectory Sample", + "origin": "API_DEFINITION", + "description": " Moves a directory (inside a Workspace), and all of its contents, to a new location.", + "canonical": true, + "file": "dataform.move_directory.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveDirectory", + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "new_path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.MoveDirectoryResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "MoveDirectory", + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_ReadFile_async", + "title": "Dataform readFile Sample", + "origin": "API_DEFINITION", + "description": " Returns the contents of a file (inside a Workspace).", + "canonical": true, + "file": "dataform.read_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReadFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.ReadFileResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "ReadFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_RemoveFile_async", + "title": "Dataform removeFile Sample", + "origin": "API_DEFINITION", + "description": " Deletes a file (inside a Workspace).", + "canonical": true, + "file": "dataform.remove_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "RemoveFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_MoveFile_async", + "title": "Dataform moveFile Sample", + "origin": "API_DEFINITION", + "description": " Moves a file (inside a Workspace) to a new location.", + "canonical": true, + "file": "dataform.move_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "MoveFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "new_path", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.MoveFileResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "MoveFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_WriteFile_async", + "title": "Dataform writeFile Sample", + "origin": "API_DEFINITION", + "description": " Writes to a file (inside a Workspace).", + "canonical": true, + "file": "dataform.write_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "WriteFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", + "async": true, + "parameters": [ + { + "name": "workspace", + "type": "TYPE_STRING" + }, + { + "name": "path", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.WriteFileResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "WriteFile", + "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_ListCompilationResults_async", + "title": "Dataform listCompilationResults Sample", + "origin": "API_DEFINITION", + "description": " Lists CompilationResults in a given Repository.", + "canonical": true, + "file": "dataform.list_compilation_results.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCompilationResults", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.ListCompilationResultsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "ListCompilationResults", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_GetCompilationResult_async", + "title": "Dataform getCompilationResult Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single CompilationResult.", + "canonical": true, + "file": "dataform.get_compilation_result.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCompilationResult", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.CompilationResult", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "GetCompilationResult", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_CreateCompilationResult_async", + "title": "Dataform createCompilationResult Sample", + "origin": "API_DEFINITION", + "description": " Creates a new CompilationResult in a given project and location.", + "canonical": true, + "file": "dataform.create_compilation_result.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCompilationResult", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "compilation_result", + "type": ".google.cloud.dataform.v1beta1.CompilationResult" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.CompilationResult", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "CreateCompilationResult", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async", + "title": "Dataform queryCompilationResultActions Sample", + "origin": "API_DEFINITION", + "description": " Returns CompilationResultActions in a given CompilationResult.", + "canonical": true, + "file": "dataform.query_compilation_result_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryCompilationResultActions", + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.QueryCompilationResultActionsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "QueryCompilationResultActions", + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async", + "title": "Dataform listWorkflowInvocations Sample", + "origin": "API_DEFINITION", + "description": " Lists WorkflowInvocations in a given Repository.", + "canonical": true, + "file": "dataform.list_workflow_invocations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkflowInvocations", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.ListWorkflowInvocationsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "ListWorkflowInvocations", + "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async", + "title": "Dataform getWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Fetches a single WorkflowInvocation.", + "canonical": true, + "file": "dataform.get_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.WorkflowInvocation", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "GetWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async", + "title": "Dataform createWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Creates a new WorkflowInvocation in a given Repository.", + "canonical": true, + "file": "dataform.create_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workflow_invocation", + "type": ".google.cloud.dataform.v1beta1.WorkflowInvocation" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.WorkflowInvocation", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "CreateWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async", + "title": "Dataform deleteWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single WorkflowInvocation.", + "canonical": true, + "file": "dataform.delete_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "DeleteWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async", + "title": "Dataform cancelWorkflowInvocation Sample", + "origin": "API_DEFINITION", + "description": " Requests cancellation of a running WorkflowInvocation.", + "canonical": true, + "file": "dataform.cancel_workflow_invocation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "CancelWorkflowInvocation", + "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + }, + { + "regionTag": "dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async", + "title": "Dataform queryWorkflowInvocationActions Sample", + "origin": "API_DEFINITION", + "description": " Returns WorkflowInvocationActions in a given WorkflowInvocation.", + "canonical": true, + "file": "dataform.query_workflow_invocation_actions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryWorkflowInvocationActions", + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsResponse", + "client": { + "shortName": "DataformClient", + "fullName": "google.cloud.dataform.v1beta1.DataformClient" + }, + "method": { + "shortName": "QueryWorkflowInvocationActions", + "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", + "service": { + "shortName": "Dataform", + "fullName": "google.cloud.dataform.v1beta1.Dataform" + } + } + } + } + ] +} diff --git a/owl-bot-staging/v1beta1/src/index.ts b/owl-bot-staging/v1beta1/src/index.ts new file mode 100644 index 0000000..3f26c5b --- /dev/null +++ b/owl-bot-staging/v1beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const DataformClient = v1beta1.DataformClient; +type DataformClient = v1beta1.DataformClient; +export {v1beta1, DataformClient}; +export default {v1beta1, DataformClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts new file mode 100644 index 0000000..2460ede --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts @@ -0,0 +1,4388 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; + +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/dataform_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './dataform_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Dataform is a service to develop, create, document, test, and update curated + * tables in BigQuery. + * @class + * @memberof v1beta1 + */ +export class DataformClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + dataformStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataformClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataformClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new IamClient(this._gaxGrpc, opts); + + this.locationsClient = new LocationsClient(this._gaxGrpc, opts); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + compilationResultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + repositoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}' + ), + workflowInvocationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}' + ), + workspacePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listRepositories: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'repositories'), + listWorkspaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workspaces'), + queryDirectoryContents: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'directoryEntries'), + listCompilationResults: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResults'), + queryCompilationResultActions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResultActions'), + listWorkflowInvocations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocations'), + queryWorkflowInvocationActions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocationActions') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataform.v1beta1.Dataform', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = gax.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.dataformStub) { + return this.dataformStub; + } + + // Put together the "service stub" for + // google.cloud.dataform.v1beta1.Dataform. + this.dataformStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataform.v1beta1.Dataform') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataform.v1beta1.Dataform, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const dataformStubMethods = + ['listRepositories', 'getRepository', 'createRepository', 'updateRepository', 'deleteRepository', 'fetchRemoteBranches', 'listWorkspaces', 'getWorkspace', 'createWorkspace', 'deleteWorkspace', 'installNpmPackages', 'pullGitCommits', 'pushGitCommits', 'fetchFileGitStatuses', 'fetchGitAheadBehind', 'commitWorkspaceChanges', 'resetWorkspaceChanges', 'fetchFileDiff', 'queryDirectoryContents', 'makeDirectory', 'removeDirectory', 'moveDirectory', 'readFile', 'removeFile', 'moveFile', 'writeFile', 'listCompilationResults', 'getCompilationResult', 'createCompilationResult', 'queryCompilationResultActions', 'listWorkflowInvocations', 'getWorkflowInvocation', 'createWorkflowInvocation', 'deleteWorkflowInvocation', 'cancelWorkflowInvocation', 'queryWorkflowInvocationActions']; + for (const methodName of dataformStubMethods) { + const callPromise = this.dataformStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dataformStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dataform.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dataform.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Fetches a single Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The repository's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.get_repository.js + * region_tag:dataform_v1beta1_generated_Dataform_GetRepository_async + */ + getRepository( + request?: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|undefined, {}|undefined + ]>; + getRepository( + request: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, + {}|null|undefined>): void; + getRepository( + request: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, + {}|null|undefined>): void; + getRepository( + request?: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getRepository(request, options, callback); + } +/** + * Creates a new Repository in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to create the repository. Must be in the format + * `projects/* /locations/*`. + * @param {google.cloud.dataform.v1beta1.Repository} request.repository + * Required. The repository to create. + * @param {string} request.repositoryId + * Required. The ID to use for the repository, which will become the final component of + * the repository's resource name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.create_repository.js + * region_tag:dataform_v1beta1_generated_Dataform_CreateRepository_async + */ + createRepository( + request?: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|undefined, {}|undefined + ]>; + createRepository( + request: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + createRepository( + request: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + createRepository( + request?: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createRepository(request, options, callback); + } +/** + * Updates a single Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Specifies the fields to be updated in the repository. If left unset, + * all fields will be updated. + * @param {google.cloud.dataform.v1beta1.Repository} request.repository + * Required. The repository to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.update_repository.js + * region_tag:dataform_v1beta1_generated_Dataform_UpdateRepository_async + */ + updateRepository( + request?: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|undefined, {}|undefined + ]>; + updateRepository( + request: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + updateRepository( + request: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>): void; + updateRepository( + request?: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository, + protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'repository.name': request.repository!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateRepository(request, options, callback); + } +/** + * Deletes a single Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The repository's name. + * @param {boolean} request.force + * 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.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.delete_repository.js + * region_tag:dataform_v1beta1_generated_Dataform_DeleteRepository_async + */ + deleteRepository( + request?: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|undefined, {}|undefined + ]>; + deleteRepository( + request: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>): void; + deleteRepository( + request: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>): void; + deleteRepository( + request?: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteRepository(request, options, callback); + } +/** + * Fetches a Repository's remote branches. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The repository's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchRemoteBranchesResponse]{@link google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.fetch_remote_branches.js + * region_tag:dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async + */ + fetchRemoteBranches( + request?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|undefined, {}|undefined + ]>; + fetchRemoteBranches( + request: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>): void; + fetchRemoteBranches( + request: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>): void; + fetchRemoteBranches( + request?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, + protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchRemoteBranches(request, options, callback); + } +/** + * Fetches a single Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.get_workspace.js + * region_tag:dataform_v1beta1_generated_Dataform_GetWorkspace_async + */ + getWorkspace( + request?: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|undefined, {}|undefined + ]>; + getWorkspace( + request: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + getWorkspace( + request: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + getWorkspace( + request?: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkspace(request, options, callback); + } +/** + * Creates a new Workspace in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to create the workspace. Must be in the format + * `projects/* /locations/* /repositories/*`. + * @param {google.cloud.dataform.v1beta1.Workspace} request.workspace + * Required. The workspace to create. + * @param {string} request.workspaceId + * Required. The ID to use for the workspace, which will become the final component of + * the workspace's resource name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.create_workspace.js + * region_tag:dataform_v1beta1_generated_Dataform_CreateWorkspace_async + */ + createWorkspace( + request?: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|undefined, {}|undefined + ]>; + createWorkspace( + request: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + createWorkspace( + request: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + createWorkspace( + request?: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkspace, + protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkspace(request, options, callback); + } +/** + * Deletes a single Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.delete_workspace.js + * region_tag:dataform_v1beta1_generated_Dataform_DeleteWorkspace_async + */ + deleteWorkspace( + request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|undefined, {}|undefined + ]>; + deleteWorkspace( + request: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkspace( + request: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkspace( + request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkspace(request, options, callback); + } +/** + * Installs dependency NPM packages (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InstallNpmPackagesResponse]{@link google.cloud.dataform.v1beta1.InstallNpmPackagesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.install_npm_packages.js + * region_tag:dataform_v1beta1_generated_Dataform_InstallNpmPackages_async + */ + installNpmPackages( + request?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|undefined, {}|undefined + ]>; + installNpmPackages( + request: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>): void; + installNpmPackages( + request: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>): void; + installNpmPackages( + request?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, + protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.installNpmPackages(request, options, callback); + } +/** + * Pulls Git commits from the Repository's remote into a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string} [request.remoteBranch] + * 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. + * @param {google.cloud.dataform.v1beta1.CommitAuthor} request.author + * Required. The author of any merge commit which may be created as a result of merging + * fetched Git commits into this workspace. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.pull_git_commits.js + * region_tag:dataform_v1beta1_generated_Dataform_PullGitCommits_async + */ + pullGitCommits( + request?: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|undefined, {}|undefined + ]>; + pullGitCommits( + request: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pullGitCommits( + request: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pullGitCommits( + request?: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pullGitCommits(request, options, callback); + } +/** + * Pushes Git commits from a Workspace to the Repository's remote. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string} [request.remoteBranch] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.push_git_commits.js + * region_tag:dataform_v1beta1_generated_Dataform_PushGitCommits_async + */ + pushGitCommits( + request?: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|undefined, {}|undefined + ]>; + pushGitCommits( + request: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pushGitCommits( + request: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>): void; + pushGitCommits( + request?: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.pushGitCommits(request, options, callback); + } +/** + * Fetches Git statuses for the files in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchFileGitStatusesResponse]{@link google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.fetch_file_git_statuses.js + * region_tag:dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async + */ + fetchFileGitStatuses( + request?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|undefined, {}|undefined + ]>; + fetchFileGitStatuses( + request: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>): void; + fetchFileGitStatuses( + request: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>): void; + fetchFileGitStatuses( + request?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchFileGitStatuses(request, options, callback); + } +/** + * Fetches Git ahead/behind against a remote branch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string} [request.remoteBranch] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchGitAheadBehindResponse]{@link google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js + * region_tag:dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async + */ + fetchGitAheadBehind( + request?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|undefined, {}|undefined + ]>; + fetchGitAheadBehind( + request: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>): void; + fetchGitAheadBehind( + request: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>): void; + fetchGitAheadBehind( + request?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, + protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchGitAheadBehind(request, options, callback); + } +/** + * Applies a Git commit for uncommitted files in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {google.cloud.dataform.v1beta1.CommitAuthor} request.author + * Required. The commit's author. + * @param {string} [request.commitMessage] + * Optional. The commit's message. + * @param {string[]} [request.paths] + * Optional. Full file paths to commit including filename, rooted at workspace root. If + * left empty, all files will be committed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.commit_workspace_changes.js + * region_tag:dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async + */ + commitWorkspaceChanges( + request?: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|undefined, {}|undefined + ]>; + commitWorkspaceChanges( + request: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + commitWorkspaceChanges( + request: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + commitWorkspaceChanges( + request?: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.commitWorkspaceChanges(request, options, callback); + } +/** + * Performs a Git reset for uncommitted files in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workspace's name. + * @param {string[]} [request.paths] + * 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. + * @param {boolean} [request.clean] + * Optional. If set to true, untracked files will be deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.reset_workspace_changes.js + * region_tag:dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async + */ + resetWorkspaceChanges( + request?: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|undefined, {}|undefined + ]>; + resetWorkspaceChanges( + request: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + resetWorkspaceChanges( + request: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): void; + resetWorkspaceChanges( + request?: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.resetWorkspaceChanges(request, options, callback); + } +/** + * Fetches Git diff for an uncommitted file in a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FetchFileDiffResponse]{@link google.cloud.dataform.v1beta1.FetchFileDiffResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.fetch_file_diff.js + * region_tag:dataform_v1beta1_generated_Dataform_FetchFileDiff_async + */ + fetchFileDiff( + request?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|undefined, {}|undefined + ]>; + fetchFileDiff( + request: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>): void; + fetchFileDiff( + request: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>): void; + fetchFileDiff( + request?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, + protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.fetchFileDiff(request, options, callback); + } +/** + * Creates a directory inside a Workspace. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The directory's full path including directory name, relative to the + * workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MakeDirectoryResponse]{@link google.cloud.dataform.v1beta1.MakeDirectoryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.make_directory.js + * region_tag:dataform_v1beta1_generated_Dataform_MakeDirectory_async + */ + makeDirectory( + request?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|undefined, {}|undefined + ]>; + makeDirectory( + request: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>): void; + makeDirectory( + request: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>): void; + makeDirectory( + request?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.makeDirectory(request, options, callback); + } +/** + * Deletes a directory (inside a Workspace) and all of its contents. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The directory's full path including directory name, relative to the + * workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.remove_directory.js + * region_tag:dataform_v1beta1_generated_Dataform_RemoveDirectory_async + */ + removeDirectory( + request?: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|undefined, {}|undefined + ]>; + removeDirectory( + request: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + removeDirectory( + request: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + removeDirectory( + request?: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.removeDirectory(request, options, callback); + } +/** + * Moves a directory (inside a Workspace), and all of its contents, to a new + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The directory's full path including directory name, relative to the + * workspace root. + * @param {string} request.newPath + * Required. The new path for the directory including directory name, rooted at + * workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MoveDirectoryResponse]{@link google.cloud.dataform.v1beta1.MoveDirectoryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.move_directory.js + * region_tag:dataform_v1beta1_generated_Dataform_MoveDirectory_async + */ + moveDirectory( + request?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|undefined, {}|undefined + ]>; + moveDirectory( + request: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + moveDirectory( + request: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>): void; + moveDirectory( + request?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, + protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.moveDirectory(request, options, callback); + } +/** + * Returns the contents of a file (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ReadFileResponse]{@link google.cloud.dataform.v1beta1.ReadFileResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.read_file.js + * region_tag:dataform_v1beta1_generated_Dataform_ReadFile_async + */ + readFile( + request?: protos.google.cloud.dataform.v1beta1.IReadFileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IReadFileResponse, + protos.google.cloud.dataform.v1beta1.IReadFileRequest|undefined, {}|undefined + ]>; + readFile( + request: protos.google.cloud.dataform.v1beta1.IReadFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IReadFileResponse, + protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, + {}|null|undefined>): void; + readFile( + request: protos.google.cloud.dataform.v1beta1.IReadFileRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IReadFileResponse, + protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, + {}|null|undefined>): void; + readFile( + request?: protos.google.cloud.dataform.v1beta1.IReadFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IReadFileResponse, + protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IReadFileResponse, + protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IReadFileResponse, + protos.google.cloud.dataform.v1beta1.IReadFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.readFile(request, options, callback); + } +/** + * Deletes a file (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.remove_file.js + * region_tag:dataform_v1beta1_generated_Dataform_RemoveFile_async + */ + removeFile( + request?: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|undefined, {}|undefined + ]>; + removeFile( + request: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, + {}|null|undefined>): void; + removeFile( + request: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, + {}|null|undefined>): void; + removeFile( + request?: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.removeFile(request, options, callback); + } +/** + * Moves a file (inside a Workspace) to a new location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file's full path including filename, relative to the workspace root. + * @param {string} request.newPath + * Required. The file's new path including filename, relative to the workspace root. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [MoveFileResponse]{@link google.cloud.dataform.v1beta1.MoveFileResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.move_file.js + * region_tag:dataform_v1beta1_generated_Dataform_MoveFile_async + */ + moveFile( + request?: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IMoveFileResponse, + protos.google.cloud.dataform.v1beta1.IMoveFileRequest|undefined, {}|undefined + ]>; + moveFile( + request: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IMoveFileResponse, + protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, + {}|null|undefined>): void; + moveFile( + request: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IMoveFileResponse, + protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, + {}|null|undefined>): void; + moveFile( + request?: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IMoveFileResponse, + protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IMoveFileResponse, + protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IMoveFileResponse, + protos.google.cloud.dataform.v1beta1.IMoveFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.moveFile(request, options, callback); + } +/** + * Writes to a file (inside a Workspace). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} request.path + * Required. The file. + * @param {Buffer} request.contents + * Required. The file's contents. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WriteFileResponse]{@link google.cloud.dataform.v1beta1.WriteFileResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.write_file.js + * region_tag:dataform_v1beta1_generated_Dataform_WriteFile_async + */ + writeFile( + request?: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWriteFileResponse, + protos.google.cloud.dataform.v1beta1.IWriteFileRequest|undefined, {}|undefined + ]>; + writeFile( + request: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWriteFileResponse, + protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, + {}|null|undefined>): void; + writeFile( + request: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWriteFileResponse, + protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, + {}|null|undefined>): void; + writeFile( + request?: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IWriteFileResponse, + protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IWriteFileResponse, + protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWriteFileResponse, + protos.google.cloud.dataform.v1beta1.IWriteFileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.writeFile(request, options, callback); + } +/** + * Fetches a single CompilationResult. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.get_compilation_result.js + * region_tag:dataform_v1beta1_generated_Dataform_GetCompilationResult_async + */ + getCompilationResult( + request?: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|undefined, {}|undefined + ]>; + getCompilationResult( + request: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + getCompilationResult( + request: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + getCompilationResult( + request?: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getCompilationResult(request, options, callback); + } +/** + * Creates a new CompilationResult in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to create the compilation result. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {google.cloud.dataform.v1beta1.CompilationResult} request.compilationResult + * Required. The compilation result to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.create_compilation_result.js + * region_tag:dataform_v1beta1_generated_Dataform_CreateCompilationResult_async + */ + createCompilationResult( + request?: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|undefined, {}|undefined + ]>; + createCompilationResult( + request: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + createCompilationResult( + request: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>): void; + createCompilationResult( + request?: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResult, + protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCompilationResult(request, options, callback); + } +/** + * Fetches a single WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.get_workflow_invocation.js + * region_tag:dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async + */ + getWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|undefined, {}|undefined + ]>; + getWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + getWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + getWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getWorkflowInvocation(request, options, callback); + } +/** + * Creates a new WorkflowInvocation in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to create the workflow invocation. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {google.cloud.dataform.v1beta1.WorkflowInvocation} request.workflowInvocation + * Required. The workflow invocation resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.create_workflow_invocation.js + * region_tag:dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async + */ + createWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|undefined, {}|undefined + ]>; + createWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + createWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, + callback: Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + createWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, + protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createWorkflowInvocation(request, options, callback); + } +/** + * Deletes a single WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.delete_workflow_invocation.js + * region_tag:dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async + */ + deleteWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|undefined, {}|undefined + ]>; + deleteWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkflowInvocation(request, options, callback); + } +/** + * Requests cancellation of a running WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation resource's name. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.cancel_workflow_invocation.js + * region_tag:dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async + */ + cancelWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|undefined, {}|undefined + ]>; + cancelWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + cancelWorkflowInvocation( + request: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): void; + cancelWorkflowInvocation( + request?: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.cancelWorkflowInvocation(request, options, callback); + } + + /** + * Lists Repositories in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Repository]{@link google.cloud.dataform.v1beta1.Repository}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRepositoriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRepositories( + request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository[], + protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest|null, + protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse + ]>; + listRepositories( + request: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IRepository>): void; + listRepositories( + request: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IRepository>): void; + listRepositories( + request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IRepository>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IRepository>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IRepository[], + protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest|null, + protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listRepositories(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRepositoriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listRepositoriesStream( + request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listRepositories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRepositories.createStream( + this.innerApiCalls.listRepositories as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listRepositories`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location in which to list repositories. Must be in the format + * `projects/* /locations/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of repositories to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Repository]{@link google.cloud.dataform.v1beta1.Repository}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.list_repositories.js + * region_tag:dataform_v1beta1_generated_Dataform_ListRepositories_async + */ + listRepositoriesAsync( + request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listRepositories']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRepositories.asyncIterate( + this.innerApiCalls['listRepositories'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Workspaces in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkspacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkspaces( + request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkspace[], + protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest|null, + protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse + ]>; + listWorkspaces( + request: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkspace>): void; + listWorkspaces( + request: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkspace>): void; + listWorkspaces( + request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkspace>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkspace>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkspace[], + protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest|null, + protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkspaces(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Workspace]{@link google.cloud.dataform.v1beta1.Workspace} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkspacesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkspacesStream( + request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkspaces.createStream( + this.innerApiCalls.listWorkspaces as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listWorkspaces`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list workspaces. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * Optional. Maximum number of workspaces to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.orderBy] + * 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. + * @param {string} [request.filter] + * Optional. Filter for the returned list. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.list_workspaces.js + * region_tag:dataform_v1beta1_generated_Dataform_ListWorkspaces_async + */ + listWorkspacesAsync( + request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkspaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkspaces.asyncIterate( + this.innerApiCalls['listWorkspaces'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns the contents of a given Workspace directory. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} [request.path] + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + * @param {number} [request.pageSize] + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DirectoryEntry]{@link google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `queryDirectoryContentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryDirectoryContents( + request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[], + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest|null, + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse + ]>; + queryDirectoryContents( + request: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>): void; + queryDirectoryContents( + request: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>): void; + queryDirectoryContents( + request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>): + Promise<[ + protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[], + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest|null, + protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + this.initialize(); + return this.innerApiCalls.queryDirectoryContents(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} [request.path] + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + * @param {number} [request.pageSize] + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [DirectoryEntry]{@link google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `queryDirectoryContentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryDirectoryContentsStream( + request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + const defaultCallSettings = this._defaults['queryDirectoryContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryDirectoryContents.createStream( + this.innerApiCalls.queryDirectoryContents as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryDirectoryContents`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.workspace + * Required. The workspace's name. + * @param {string} [request.path] + * Optional. The directory's full path including directory name, relative to the + * workspace root. If left unset, the workspace root is used. + * @param {number} [request.pageSize] + * Optional. Maximum number of paths to return. The server may return fewer + * items than requested. If unspecified, the server will pick an appropriate + * default. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [DirectoryEntry]{@link google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.query_directory_contents.js + * region_tag:dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async + */ + queryDirectoryContentsAsync( + request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'workspace': request.workspace || '', + }); + const defaultCallSettings = this._defaults['queryDirectoryContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryDirectoryContents.asyncIterate( + this.innerApiCalls['queryDirectoryContents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists CompilationResults in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCompilationResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompilationResults( + request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResult[], + protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest|null, + protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse + ]>; + listCompilationResults( + request: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResult>): void; + listCompilationResults( + request: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResult>): void; + listCompilationResults( + request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResult>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResult>): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResult[], + protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest|null, + protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCompilationResults(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCompilationResultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCompilationResultsStream( + request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCompilationResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompilationResults.createStream( + this.innerApiCalls.listCompilationResults as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listCompilationResults`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The repository in which to list compilation results. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.list_compilation_results.js + * region_tag:dataform_v1beta1_generated_Dataform_ListCompilationResults_async + */ + listCompilationResultsAsync( + request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listCompilationResults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCompilationResults.asyncIterate( + this.innerApiCalls['listCompilationResults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns CompilationResultActions in a given CompilationResult. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.filter] + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CompilationResultAction]{@link google.cloud.dataform.v1beta1.CompilationResultAction}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `queryCompilationResultActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryCompilationResultActions( + request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResultAction[], + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest|null, + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse + ]>; + queryCompilationResultActions( + request: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResultAction>): void; + queryCompilationResultActions( + request: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResultAction>): void; + queryCompilationResultActions( + request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResultAction>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.ICompilationResultAction>): + Promise<[ + protos.google.cloud.dataform.v1beta1.ICompilationResultAction[], + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest|null, + protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.queryCompilationResultActions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.filter] + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CompilationResultAction]{@link google.cloud.dataform.v1beta1.CompilationResultAction} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `queryCompilationResultActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryCompilationResultActionsStream( + request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryCompilationResultActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryCompilationResultActions.createStream( + this.innerApiCalls.queryCompilationResultActions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryCompilationResultActions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The compilation result's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {string} [request.filter] + * Optional. Optional filter for the returned list. Filtering is only currently + * supported on the `file_path` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CompilationResultAction]{@link google.cloud.dataform.v1beta1.CompilationResultAction}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.query_compilation_result_actions.js + * region_tag:dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async + */ + queryCompilationResultActionsAsync( + request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryCompilationResultActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryCompilationResultActions.asyncIterate( + this.innerApiCalls['queryCompilationResultActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists WorkflowInvocations in a given Repository. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listWorkflowInvocationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkflowInvocations( + request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[], + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest|null, + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse + ]>; + listWorkflowInvocations( + request: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>): void; + listWorkflowInvocations( + request: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>): void; + listWorkflowInvocations( + request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[], + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest|null, + protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkflowInvocations(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listWorkflowInvocationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkflowInvocationsStream( + request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkflowInvocations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkflowInvocations.createStream( + this.innerApiCalls.listWorkflowInvocations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listWorkflowInvocations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the WorkflowInvocation type. Must be in the + * format `projects/* /locations/* /repositories/*`. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.list_workflow_invocations.js + * region_tag:dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async + */ + listWorkflowInvocationsAsync( + request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listWorkflowInvocations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkflowInvocations.asyncIterate( + this.innerApiCalls['listWorkflowInvocations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns WorkflowInvocationActions in a given WorkflowInvocation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [WorkflowInvocationAction]{@link google.cloud.dataform.v1beta1.WorkflowInvocationAction}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `queryWorkflowInvocationActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryWorkflowInvocationActions( + request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[], + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest|null, + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse + ]>; + queryWorkflowInvocationActions( + request: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>): void; + queryWorkflowInvocationActions( + request: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>): void; + queryWorkflowInvocationActions( + request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>, + callback?: PaginationCallback< + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, + protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>): + Promise<[ + protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[], + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest|null, + protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.queryWorkflowInvocationActions(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [WorkflowInvocationAction]{@link google.cloud.dataform.v1beta1.WorkflowInvocationAction} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `queryWorkflowInvocationActionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + queryWorkflowInvocationActionsStream( + request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryWorkflowInvocationActions.createStream( + this.innerApiCalls.queryWorkflowInvocationActions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `queryWorkflowInvocationActions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The workflow invocation's name. + * @param {number} [request.pageSize] + * 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. + * @param {string} [request.pageToken] + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [WorkflowInvocationAction]{@link google.cloud.dataform.v1beta1.WorkflowInvocationAction}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js + * region_tag:dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async + */ + queryWorkflowInvocationActionsAsync( + request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.queryWorkflowInvocationActions.asyncIterate( + this.innerApiCalls['queryWorkflowInvocationActions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * 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 {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * 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). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * 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 {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * 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). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified compilationResult resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @param {string} compilation_result + * @returns {string} Resource name string. + */ + compilationResultPath(project:string,location:string,repository:string,compilationResult:string) { + return this.pathTemplates.compilationResultPathTemplate.render({ + project: project, + location: location, + repository: repository, + compilation_result: compilationResult, + }); + } + + /** + * Parse the project from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).project; + } + + /** + * Parse the location from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).location; + } + + /** + * Parse the repository from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).repository; + } + + /** + * Parse the compilation_result from CompilationResult resource. + * + * @param {string} compilationResultName + * A fully-qualified path representing CompilationResult resource. + * @returns {string} A string representing the compilation_result. + */ + matchCompilationResultFromCompilationResultName(compilationResultName: string) { + return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).compilation_result; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified repository resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @returns {string} Resource name string. + */ + repositoryPath(project:string,location:string,repository:string) { + return this.pathTemplates.repositoryPathTemplate.render({ + project: project, + location: location, + repository: repository, + }); + } + + /** + * Parse the project from Repository resource. + * + * @param {string} repositoryName + * A fully-qualified path representing Repository resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRepositoryName(repositoryName: string) { + return this.pathTemplates.repositoryPathTemplate.match(repositoryName).project; + } + + /** + * Parse the location from Repository resource. + * + * @param {string} repositoryName + * A fully-qualified path representing Repository resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRepositoryName(repositoryName: string) { + return this.pathTemplates.repositoryPathTemplate.match(repositoryName).location; + } + + /** + * Parse the repository from Repository resource. + * + * @param {string} repositoryName + * A fully-qualified path representing Repository resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromRepositoryName(repositoryName: string) { + return this.pathTemplates.repositoryPathTemplate.match(repositoryName).repository; + } + + /** + * Return a fully-qualified workflowInvocation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @param {string} workflow_invocation + * @returns {string} Resource name string. + */ + workflowInvocationPath(project:string,location:string,repository:string,workflowInvocation:string) { + return this.pathTemplates.workflowInvocationPathTemplate.render({ + project: project, + location: location, + repository: repository, + workflow_invocation: workflowInvocation, + }); + } + + /** + * Parse the project from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).project; + } + + /** + * Parse the location from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).location; + } + + /** + * Parse the repository from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).repository; + } + + /** + * Parse the workflow_invocation from WorkflowInvocation resource. + * + * @param {string} workflowInvocationName + * A fully-qualified path representing WorkflowInvocation resource. + * @returns {string} A string representing the workflow_invocation. + */ + matchWorkflowInvocationFromWorkflowInvocationName(workflowInvocationName: string) { + return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).workflow_invocation; + } + + /** + * Return a fully-qualified workspace resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} repository + * @param {string} workspace + * @returns {string} Resource name string. + */ + workspacePath(project:string,location:string,repository:string,workspace:string) { + return this.pathTemplates.workspacePathTemplate.render({ + project: project, + location: location, + repository: repository, + workspace: workspace, + }); + } + + /** + * Parse the project from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).project; + } + + /** + * Parse the location from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).location; + } + + /** + * Parse the repository from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the repository. + */ + matchRepositoryFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).repository; + } + + /** + * Parse the workspace from Workspace resource. + * + * @param {string} workspaceName + * A fully-qualified path representing Workspace resource. + * @returns {string} A string representing the workspace. + */ + matchWorkspaceFromWorkspaceName(workspaceName: string) { + return this.pathTemplates.workspacePathTemplate.match(workspaceName).workspace; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.dataformStub && !this._terminated) { + return this.dataformStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json new file mode 100644 index 0000000..6e61613 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json @@ -0,0 +1,170 @@ +{ + "interfaces": { + "google.cloud.dataform.v1beta1.Dataform": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListRepositories": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRepository": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchRemoteBranches": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkspaces": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkspace": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateWorkspace": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkspace": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InstallNpmPackages": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PullGitCommits": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PushGitCommits": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchFileGitStatuses": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchGitAheadBehind": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CommitWorkspaceChanges": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResetWorkspaceChanges": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchFileDiff": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryDirectoryContents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MakeDirectory": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveDirectory": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveDirectory": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ReadFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "WriteFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCompilationResults": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCompilationResult": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateCompilationResult": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryCompilationResultActions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListWorkflowInvocations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CancelWorkflowInvocation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryWorkflowInvocationActions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json new file mode 100644 index 0000000..8e9b5e1 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/dataform/v1beta1/dataform.proto" +] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 0000000..72fc33e --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,411 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.dataform.v1beta1", + "libraryPackage": "@google-cloud/dataform", + "services": { + "Dataform": { + "clients": { + "grpc": { + "libraryClient": "DataformClient", + "rpcs": { + "GetRepository": { + "methods": [ + "getRepository" + ] + }, + "CreateRepository": { + "methods": [ + "createRepository" + ] + }, + "UpdateRepository": { + "methods": [ + "updateRepository" + ] + }, + "DeleteRepository": { + "methods": [ + "deleteRepository" + ] + }, + "FetchRemoteBranches": { + "methods": [ + "fetchRemoteBranches" + ] + }, + "GetWorkspace": { + "methods": [ + "getWorkspace" + ] + }, + "CreateWorkspace": { + "methods": [ + "createWorkspace" + ] + }, + "DeleteWorkspace": { + "methods": [ + "deleteWorkspace" + ] + }, + "InstallNpmPackages": { + "methods": [ + "installNpmPackages" + ] + }, + "PullGitCommits": { + "methods": [ + "pullGitCommits" + ] + }, + "PushGitCommits": { + "methods": [ + "pushGitCommits" + ] + }, + "FetchFileGitStatuses": { + "methods": [ + "fetchFileGitStatuses" + ] + }, + "FetchGitAheadBehind": { + "methods": [ + "fetchGitAheadBehind" + ] + }, + "CommitWorkspaceChanges": { + "methods": [ + "commitWorkspaceChanges" + ] + }, + "ResetWorkspaceChanges": { + "methods": [ + "resetWorkspaceChanges" + ] + }, + "FetchFileDiff": { + "methods": [ + "fetchFileDiff" + ] + }, + "MakeDirectory": { + "methods": [ + "makeDirectory" + ] + }, + "RemoveDirectory": { + "methods": [ + "removeDirectory" + ] + }, + "MoveDirectory": { + "methods": [ + "moveDirectory" + ] + }, + "ReadFile": { + "methods": [ + "readFile" + ] + }, + "RemoveFile": { + "methods": [ + "removeFile" + ] + }, + "MoveFile": { + "methods": [ + "moveFile" + ] + }, + "WriteFile": { + "methods": [ + "writeFile" + ] + }, + "GetCompilationResult": { + "methods": [ + "getCompilationResult" + ] + }, + "CreateCompilationResult": { + "methods": [ + "createCompilationResult" + ] + }, + "GetWorkflowInvocation": { + "methods": [ + "getWorkflowInvocation" + ] + }, + "CreateWorkflowInvocation": { + "methods": [ + "createWorkflowInvocation" + ] + }, + "DeleteWorkflowInvocation": { + "methods": [ + "deleteWorkflowInvocation" + ] + }, + "CancelWorkflowInvocation": { + "methods": [ + "cancelWorkflowInvocation" + ] + }, + "ListRepositories": { + "methods": [ + "listRepositories", + "listRepositoriesStream", + "listRepositoriesAsync" + ] + }, + "ListWorkspaces": { + "methods": [ + "listWorkspaces", + "listWorkspacesStream", + "listWorkspacesAsync" + ] + }, + "QueryDirectoryContents": { + "methods": [ + "queryDirectoryContents", + "queryDirectoryContentsStream", + "queryDirectoryContentsAsync" + ] + }, + "ListCompilationResults": { + "methods": [ + "listCompilationResults", + "listCompilationResultsStream", + "listCompilationResultsAsync" + ] + }, + "QueryCompilationResultActions": { + "methods": [ + "queryCompilationResultActions", + "queryCompilationResultActionsStream", + "queryCompilationResultActionsAsync" + ] + }, + "ListWorkflowInvocations": { + "methods": [ + "listWorkflowInvocations", + "listWorkflowInvocationsStream", + "listWorkflowInvocationsAsync" + ] + }, + "QueryWorkflowInvocationActions": { + "methods": [ + "queryWorkflowInvocationActions", + "queryWorkflowInvocationActionsStream", + "queryWorkflowInvocationActionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataformClient", + "rpcs": { + "GetRepository": { + "methods": [ + "getRepository" + ] + }, + "CreateRepository": { + "methods": [ + "createRepository" + ] + }, + "UpdateRepository": { + "methods": [ + "updateRepository" + ] + }, + "DeleteRepository": { + "methods": [ + "deleteRepository" + ] + }, + "FetchRemoteBranches": { + "methods": [ + "fetchRemoteBranches" + ] + }, + "GetWorkspace": { + "methods": [ + "getWorkspace" + ] + }, + "CreateWorkspace": { + "methods": [ + "createWorkspace" + ] + }, + "DeleteWorkspace": { + "methods": [ + "deleteWorkspace" + ] + }, + "InstallNpmPackages": { + "methods": [ + "installNpmPackages" + ] + }, + "PullGitCommits": { + "methods": [ + "pullGitCommits" + ] + }, + "PushGitCommits": { + "methods": [ + "pushGitCommits" + ] + }, + "FetchFileGitStatuses": { + "methods": [ + "fetchFileGitStatuses" + ] + }, + "FetchGitAheadBehind": { + "methods": [ + "fetchGitAheadBehind" + ] + }, + "CommitWorkspaceChanges": { + "methods": [ + "commitWorkspaceChanges" + ] + }, + "ResetWorkspaceChanges": { + "methods": [ + "resetWorkspaceChanges" + ] + }, + "FetchFileDiff": { + "methods": [ + "fetchFileDiff" + ] + }, + "MakeDirectory": { + "methods": [ + "makeDirectory" + ] + }, + "RemoveDirectory": { + "methods": [ + "removeDirectory" + ] + }, + "MoveDirectory": { + "methods": [ + "moveDirectory" + ] + }, + "ReadFile": { + "methods": [ + "readFile" + ] + }, + "RemoveFile": { + "methods": [ + "removeFile" + ] + }, + "MoveFile": { + "methods": [ + "moveFile" + ] + }, + "WriteFile": { + "methods": [ + "writeFile" + ] + }, + "GetCompilationResult": { + "methods": [ + "getCompilationResult" + ] + }, + "CreateCompilationResult": { + "methods": [ + "createCompilationResult" + ] + }, + "GetWorkflowInvocation": { + "methods": [ + "getWorkflowInvocation" + ] + }, + "CreateWorkflowInvocation": { + "methods": [ + "createWorkflowInvocation" + ] + }, + "DeleteWorkflowInvocation": { + "methods": [ + "deleteWorkflowInvocation" + ] + }, + "CancelWorkflowInvocation": { + "methods": [ + "cancelWorkflowInvocation" + ] + }, + "ListRepositories": { + "methods": [ + "listRepositories", + "listRepositoriesStream", + "listRepositoriesAsync" + ] + }, + "ListWorkspaces": { + "methods": [ + "listWorkspaces", + "listWorkspacesStream", + "listWorkspacesAsync" + ] + }, + "QueryDirectoryContents": { + "methods": [ + "queryDirectoryContents", + "queryDirectoryContentsStream", + "queryDirectoryContentsAsync" + ] + }, + "ListCompilationResults": { + "methods": [ + "listCompilationResults", + "listCompilationResultsStream", + "listCompilationResultsAsync" + ] + }, + "QueryCompilationResultActions": { + "methods": [ + "queryCompilationResultActions", + "queryCompilationResultActionsStream", + "queryCompilationResultActionsAsync" + ] + }, + "ListWorkflowInvocations": { + "methods": [ + "listWorkflowInvocations", + "listWorkflowInvocationsStream", + "listWorkflowInvocationsAsync" + ] + }, + "QueryWorkflowInvocationActions": { + "methods": [ + "queryWorkflowInvocationActions", + "queryWorkflowInvocationActionsStream", + "queryWorkflowInvocationActionsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/v1beta1/src/v1beta1/index.ts new file mode 100644 index 0000000..a1e4487 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataformClient} from './dataform_client'; diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 0000000..5955dff --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const dataform = require('@google-cloud/dataform'); + +function main() { + const dataformClient = new dataform.DataformClient(); +} + +main(); diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 0000000..3f49bdd --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataformClient} from '@google-cloud/dataform'; + +// check that the client class type name can be used +function doStuffWithDataformClient(client: DataformClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataformClient = new DataformClient(); + doStuffWithDataformClient(dataformClient); +} + +main(); diff --git a/owl-bot-staging/v1beta1/system-test/install.ts b/owl-bot-staging/v1beta1/system-test/install.ts new file mode 100644 index 0000000..557a575 --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts new file mode 100644 index 0000000..8254cc4 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts @@ -0,0 +1,5251 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as dataformModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1beta1.DataformClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = dataformModule.v1beta1.DataformClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = dataformModule.v1beta1.DataformClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = dataformModule.v1beta1.DataformClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new dataformModule.v1beta1.DataformClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new dataformModule.v1beta1.DataformClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + await client.initialize(); + assert(client.dataformStub); + }); + + it('has close method for the initialized client', done => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataformStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getRepository', () => { + it('invokes getRepository without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); + client.innerApiCalls.getRepository = stubSimpleCall(expectedResponse); + const [response] = await client.getRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getRepository without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); + client.innerApiCalls.getRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRepository( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getRepository with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRepository(request), expectedError); + assert((client.innerApiCalls.getRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getRepository with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRepository(request), expectedError); + }); + }); + + describe('createRepository', () => { + it('invokes createRepository without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); + client.innerApiCalls.createRepository = stubSimpleCall(expectedResponse); + const [response] = await client.createRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createRepository without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); + client.innerApiCalls.createRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRepository( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createRepository with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createRepository(request), expectedError); + assert((client.innerApiCalls.createRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createRepository with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createRepository(request), expectedError); + }); + }); + + describe('updateRepository', () => { + it('invokes updateRepository without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedHeaderRequestParams = "repository.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); + client.innerApiCalls.updateRepository = stubSimpleCall(expectedResponse); + const [response] = await client.updateRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateRepository without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedHeaderRequestParams = "repository.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); + client.innerApiCalls.updateRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRepository( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateRepository with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedHeaderRequestParams = "repository.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateRepository(request), expectedError); + assert((client.innerApiCalls.updateRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateRepository with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); + request.repository = {}; + request.repository.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateRepository(request), expectedError); + }); + }); + + describe('deleteRepository', () => { + it('invokes deleteRepository without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteRepository = stubSimpleCall(expectedResponse); + const [response] = await client.deleteRepository(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteRepository without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteRepository = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRepository( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteRepository with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRepository = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteRepository(request), expectedError); + assert((client.innerApiCalls.deleteRepository as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteRepository with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteRepository(request), expectedError); + }); + }); + + describe('fetchRemoteBranches', () => { + it('invokes fetchRemoteBranches without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse()); + client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(expectedResponse); + const [response] = await client.fetchRemoteBranches(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchRemoteBranches without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse()); + client.innerApiCalls.fetchRemoteBranches = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchRemoteBranches( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchRemoteBranches with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchRemoteBranches(request), expectedError); + assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchRemoteBranches with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchRemoteBranches(request), expectedError); + }); + }); + + describe('getWorkspace', () => { + it('invokes getWorkspace without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); + client.innerApiCalls.getWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkspace without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); + client.innerApiCalls.getWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkspace( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkspace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getWorkspace with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getWorkspace(request), expectedError); + assert((client.innerApiCalls.getWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkspace with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkspace(request), expectedError); + }); + }); + + describe('createWorkspace', () => { + it('invokes createWorkspace without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); + client.innerApiCalls.createWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.createWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkspace without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); + client.innerApiCalls.createWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkspace( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkspace|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createWorkspace with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createWorkspace(request), expectedError); + assert((client.innerApiCalls.createWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkspace with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createWorkspace(request), expectedError); + }); + }); + + describe('deleteWorkspace', () => { + it('invokes deleteWorkspace without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkspace = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkspace(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkspace without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkspace = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkspace( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteWorkspace with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkspace = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteWorkspace(request), expectedError); + assert((client.innerApiCalls.deleteWorkspace as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkspace with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkspace(request), expectedError); + }); + }); + + describe('installNpmPackages', () => { + it('invokes installNpmPackages without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesResponse()); + client.innerApiCalls.installNpmPackages = stubSimpleCall(expectedResponse); + const [response] = await client.installNpmPackages(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.installNpmPackages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes installNpmPackages without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesResponse()); + client.innerApiCalls.installNpmPackages = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.installNpmPackages( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.installNpmPackages as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes installNpmPackages with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.installNpmPackages = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.installNpmPackages(request), expectedError); + assert((client.innerApiCalls.installNpmPackages as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes installNpmPackages with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.installNpmPackages(request), expectedError); + }); + }); + + describe('pullGitCommits', () => { + it('invokes pullGitCommits without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pullGitCommits = stubSimpleCall(expectedResponse); + const [response] = await client.pullGitCommits(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pullGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pullGitCommits without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pullGitCommits = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pullGitCommits( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pullGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pullGitCommits with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pullGitCommits = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pullGitCommits(request), expectedError); + assert((client.innerApiCalls.pullGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pullGitCommits with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pullGitCommits(request), expectedError); + }); + }); + + describe('pushGitCommits', () => { + it('invokes pushGitCommits without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pushGitCommits = stubSimpleCall(expectedResponse); + const [response] = await client.pushGitCommits(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pushGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pushGitCommits without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.pushGitCommits = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.pushGitCommits( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.pushGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes pushGitCommits with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.pushGitCommits = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.pushGitCommits(request), expectedError); + assert((client.innerApiCalls.pushGitCommits as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes pushGitCommits with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.pushGitCommits(request), expectedError); + }); + }); + + describe('fetchFileGitStatuses', () => { + it('invokes fetchFileGitStatuses without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse()); + client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(expectedResponse); + const [response] = await client.fetchFileGitStatuses(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileGitStatuses without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse()); + client.innerApiCalls.fetchFileGitStatuses = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchFileGitStatuses( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchFileGitStatuses with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchFileGitStatuses(request), expectedError); + assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileGitStatuses with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchFileGitStatuses(request), expectedError); + }); + }); + + describe('fetchGitAheadBehind', () => { + it('invokes fetchGitAheadBehind without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse()); + client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(expectedResponse); + const [response] = await client.fetchGitAheadBehind(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchGitAheadBehind without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse()); + client.innerApiCalls.fetchGitAheadBehind = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchGitAheadBehind( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchGitAheadBehind with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchGitAheadBehind(request), expectedError); + assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchGitAheadBehind with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchGitAheadBehind(request), expectedError); + }); + }); + + describe('commitWorkspaceChanges', () => { + it('invokes commitWorkspaceChanges without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(expectedResponse); + const [response] = await client.commitWorkspaceChanges(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes commitWorkspaceChanges without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.commitWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commitWorkspaceChanges( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes commitWorkspaceChanges with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.commitWorkspaceChanges(request), expectedError); + assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes commitWorkspaceChanges with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.commitWorkspaceChanges(request), expectedError); + }); + }); + + describe('resetWorkspaceChanges', () => { + it('invokes resetWorkspaceChanges without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(expectedResponse); + const [response] = await client.resetWorkspaceChanges(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resetWorkspaceChanges without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.resetWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resetWorkspaceChanges( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes resetWorkspaceChanges with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resetWorkspaceChanges(request), expectedError); + assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes resetWorkspaceChanges with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.resetWorkspaceChanges(request), expectedError); + }); + }); + + describe('fetchFileDiff', () => { + it('invokes fetchFileDiff without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffResponse()); + client.innerApiCalls.fetchFileDiff = stubSimpleCall(expectedResponse); + const [response] = await client.fetchFileDiff(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileDiff as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileDiff without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffResponse()); + client.innerApiCalls.fetchFileDiff = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchFileDiff( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.fetchFileDiff as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes fetchFileDiff with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchFileDiff = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchFileDiff(request), expectedError); + assert((client.innerApiCalls.fetchFileDiff as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes fetchFileDiff with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchFileDiff(request), expectedError); + }); + }); + + describe('makeDirectory', () => { + it('invokes makeDirectory without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryResponse()); + client.innerApiCalls.makeDirectory = stubSimpleCall(expectedResponse); + const [response] = await client.makeDirectory(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.makeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes makeDirectory without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryResponse()); + client.innerApiCalls.makeDirectory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.makeDirectory( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.makeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes makeDirectory with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.makeDirectory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.makeDirectory(request), expectedError); + assert((client.innerApiCalls.makeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes makeDirectory with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.makeDirectory(request), expectedError); + }); + }); + + describe('removeDirectory', () => { + it('invokes removeDirectory without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeDirectory = stubSimpleCall(expectedResponse); + const [response] = await client.removeDirectory(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeDirectory without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeDirectory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDirectory( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeDirectory with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDirectory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeDirectory(request), expectedError); + assert((client.innerApiCalls.removeDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeDirectory with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeDirectory(request), expectedError); + }); + }); + + describe('moveDirectory', () => { + it('invokes moveDirectory without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryResponse()); + client.innerApiCalls.moveDirectory = stubSimpleCall(expectedResponse); + const [response] = await client.moveDirectory(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveDirectory without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryResponse()); + client.innerApiCalls.moveDirectory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveDirectory( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes moveDirectory with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveDirectory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.moveDirectory(request), expectedError); + assert((client.innerApiCalls.moveDirectory as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveDirectory with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moveDirectory(request), expectedError); + }); + }); + + describe('readFile', () => { + it('invokes readFile without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileResponse()); + client.innerApiCalls.readFile = stubSimpleCall(expectedResponse); + const [response] = await client.readFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFile without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileResponse()); + client.innerApiCalls.readFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.readFile( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IReadFileResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.readFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes readFile with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.readFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.readFile(request), expectedError); + assert((client.innerApiCalls.readFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes readFile with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.readFile(request), expectedError); + }); + }); + + describe('removeFile', () => { + it('invokes removeFile without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeFile = stubSimpleCall(expectedResponse); + const [response] = await client.removeFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeFile without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.removeFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeFile( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeFile with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeFile(request), expectedError); + assert((client.innerApiCalls.removeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeFile with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeFile(request), expectedError); + }); + }); + + describe('moveFile', () => { + it('invokes moveFile without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileResponse()); + client.innerApiCalls.moveFile = stubSimpleCall(expectedResponse); + const [response] = await client.moveFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveFile without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileResponse()); + client.innerApiCalls.moveFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveFile( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IMoveFileResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.moveFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes moveFile with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.moveFile(request), expectedError); + assert((client.innerApiCalls.moveFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes moveFile with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.moveFile(request), expectedError); + }); + }); + + describe('writeFile', () => { + it('invokes writeFile without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileResponse()); + client.innerApiCalls.writeFile = stubSimpleCall(expectedResponse); + const [response] = await client.writeFile(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeFile without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileResponse()); + client.innerApiCalls.writeFile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.writeFile( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWriteFileResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.writeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes writeFile with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.writeFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.writeFile(request), expectedError); + assert((client.innerApiCalls.writeFile as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes writeFile with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); + request.workspace = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.writeFile(request), expectedError); + }); + }); + + describe('getCompilationResult', () => { + it('invokes getCompilationResult without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); + client.innerApiCalls.getCompilationResult = stubSimpleCall(expectedResponse); + const [response] = await client.getCompilationResult(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCompilationResult without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); + client.innerApiCalls.getCompilationResult = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCompilationResult( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResult|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getCompilationResult with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getCompilationResult = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCompilationResult(request), expectedError); + assert((client.innerApiCalls.getCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getCompilationResult with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCompilationResult(request), expectedError); + }); + }); + + describe('createCompilationResult', () => { + it('invokes createCompilationResult without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); + client.innerApiCalls.createCompilationResult = stubSimpleCall(expectedResponse); + const [response] = await client.createCompilationResult(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCompilationResult without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); + client.innerApiCalls.createCompilationResult = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCompilationResult( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResult|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createCompilationResult with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCompilationResult = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createCompilationResult(request), expectedError); + assert((client.innerApiCalls.createCompilationResult as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createCompilationResult with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCompilationResult(request), expectedError); + }); + }); + + describe('getWorkflowInvocation', () => { + it('invokes getWorkflowInvocation without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); + client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); + client.innerApiCalls.getWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getWorkflowInvocation with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkflowInvocation(request), expectedError); + }); + }); + + describe('createWorkflowInvocation', () => { + it('invokes createWorkflowInvocation without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); + client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.createWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); + client.innerApiCalls.createWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createWorkflowInvocation with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); + request.parent = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createWorkflowInvocation(request), expectedError); + }); + }); + + describe('deleteWorkflowInvocation', () => { + it('invokes deleteWorkflowInvocation without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteWorkflowInvocation with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); + }); + }); + + describe('cancelWorkflowInvocation', () => { + it('invokes cancelWorkflowInvocation without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(expectedResponse); + const [response] = await client.cancelWorkflowInvocation(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelWorkflowInvocation without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); + client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelWorkflowInvocation( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes cancelWorkflowInvocation with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); + assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes cancelWorkflowInvocation with closed client', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); + request.name = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); + }); + }); + + describe('listRepositories', () => { + it('invokes listRepositories without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + ]; + client.innerApiCalls.listRepositories = stubSimpleCall(expectedResponse); + const [response] = await client.listRepositories(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listRepositories as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listRepositories without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + ]; + client.innerApiCalls.listRepositories = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRepositories( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listRepositories as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listRepositories with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRepositories = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listRepositories(request), expectedError); + assert((client.innerApiCalls.listRepositories as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listRepositoriesStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + ]; + client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listRepositoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.Repository[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Repository) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); + assert.strictEqual( + (client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listRepositoriesStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listRepositoriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.Repository[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Repository) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); + assert.strictEqual( + (client.descriptors.page.listRepositories.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRepositories without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), + ]; + client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.IRepository[] = []; + const iterable = client.listRepositoriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listRepositories with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRepositoriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.IRepository[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listRepositories.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listWorkspaces', () => { + it('invokes listWorkspaces without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + ]; + client.innerApiCalls.listWorkspaces = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkspaces(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkspaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkspaces without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + ]; + client.innerApiCalls.listWorkspaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkspaces( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkspace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkspaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listWorkspaces with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkspaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listWorkspaces(request), expectedError); + assert((client.innerApiCalls.listWorkspaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkspacesStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + ]; + client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.Workspace[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Workspace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkspacesStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkspacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.Workspace[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Workspace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkspaces without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), + ]; + client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.IWorkspace[] = []; + const iterable = client.listWorkspacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkspaces with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkspacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.IWorkspace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('queryDirectoryContents', () => { + it('invokes queryDirectoryContents without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.innerApiCalls.queryDirectoryContents = stubSimpleCall(expectedResponse); + const [response] = await client.queryDirectoryContents(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryDirectoryContents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryDirectoryContents without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.innerApiCalls.queryDirectoryContents = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryDirectoryContents( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryDirectoryContents as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryDirectoryContents with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryDirectoryContents = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryDirectoryContents(request), expectedError); + assert((client.innerApiCalls.queryDirectoryContents as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryDirectoryContentsStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryDirectoryContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes queryDirectoryContentsStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedError = new Error('expected'); + client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryDirectoryContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryDirectoryContents without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), + ]; + client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; + const iterable = client.queryDirectoryContentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryDirectoryContents with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); + request.workspace = ''; + const expectedHeaderRequestParams = "workspace=";const expectedError = new Error('expected'); + client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryDirectoryContentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCompilationResults', () => { + it('invokes listCompilationResults without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + ]; + client.innerApiCalls.listCompilationResults = stubSimpleCall(expectedResponse); + const [response] = await client.listCompilationResults(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCompilationResults as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCompilationResults without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + ]; + client.innerApiCalls.listCompilationResults = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCompilationResults( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listCompilationResults as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listCompilationResults with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCompilationResults = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listCompilationResults(request), expectedError); + assert((client.innerApiCalls.listCompilationResults as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listCompilationResultsStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + ]; + client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listCompilationResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.CompilationResult[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listCompilationResultsStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listCompilationResultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.CompilationResult[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCompilationResults without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), + ]; + client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.ICompilationResult[] = []; + const iterable = client.listCompilationResultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCompilationResults with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listCompilationResultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.ICompilationResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('queryCompilationResultActions', () => { + it('invokes queryCompilationResultActions without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + ]; + client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(expectedResponse); + const [response] = await client.queryCompilationResultActions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryCompilationResultActions without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + ]; + client.innerApiCalls.queryCompilationResultActions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryCompilationResultActions( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryCompilationResultActions with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryCompilationResultActions(request), expectedError); + assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryCompilationResultActionsStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + ]; + client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryCompilationResultActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.CompilationResultAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResultAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes queryCompilationResultActionsStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedError = new Error('expected'); + client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryCompilationResultActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.CompilationResultAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResultAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryCompilationResultActions without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), + ]; + client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[] = []; + const iterable = client.queryCompilationResultActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryCompilationResultActions with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); + client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryCompilationResultActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listWorkflowInvocations', () => { + it('invokes listWorkflowInvocations without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + ]; + client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkflowInvocations(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkflowInvocations without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + ]; + client.innerApiCalls.listWorkflowInvocations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkflowInvocations( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listWorkflowInvocations with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listWorkflowInvocations(request), expectedError); + assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listWorkflowInvocationsStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + ]; + client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listWorkflowInvocationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocation[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listWorkflowInvocationsStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkflowInvocationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocation[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkflowInvocations without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), + ]; + client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[] = []; + const iterable = client.listWorkflowInvocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listWorkflowInvocations with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkflowInvocationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('queryWorkflowInvocationActions', () => { + it('invokes queryWorkflowInvocationActions without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + ]; + client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(expectedResponse); + const [response] = await client.queryWorkflowInvocationActions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryWorkflowInvocationActions without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + ]; + client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryWorkflowInvocationActions( + request, + (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes queryWorkflowInvocationActions with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryWorkflowInvocationActions(request), expectedError); + assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes queryWorkflowInvocationActionsStream without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + ]; + client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.queryWorkflowInvocationActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes queryWorkflowInvocationActionsStream with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedError = new Error('expected'); + client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.queryWorkflowInvocationActionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction[] = []; + stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryWorkflowInvocationActions without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), + ]; + client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[] = []; + const iterable = client.queryWorkflowInvocationActionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with queryWorkflowInvocationActions with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); + client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.queryWorkflowInvocationActionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('compilationResult', () => { + const fakePath = "/rendered/path/compilationResult"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + compilation_result: "compilationResultValue", + }; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.compilationResultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.compilationResultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('compilationResultPath', () => { + const result = client.compilationResultPath("projectValue", "locationValue", "repositoryValue", "compilationResultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.compilationResultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromCompilationResultName', () => { + const result = client.matchProjectFromCompilationResultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromCompilationResultName', () => { + const result = client.matchLocationFromCompilationResultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromCompilationResultName', () => { + const result = client.matchRepositoryFromCompilationResultName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchCompilationResultFromCompilationResultName', () => { + const result = client.matchCompilationResultFromCompilationResultName(fakePath); + assert.strictEqual(result, "compilationResultValue"); + assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('repository', () => { + const fakePath = "/rendered/path/repository"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + }; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.repositoryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.repositoryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('repositoryPath', () => { + const result = client.repositoryPath("projectValue", "locationValue", "repositoryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.repositoryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRepositoryName', () => { + const result = client.matchProjectFromRepositoryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromRepositoryName', () => { + const result = client.matchLocationFromRepositoryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromRepositoryName', () => { + const result = client.matchRepositoryFromRepositoryName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('workflowInvocation', () => { + const fakePath = "/rendered/path/workflowInvocation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + workflow_invocation: "workflowInvocationValue", + }; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workflowInvocationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workflowInvocationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workflowInvocationPath', () => { + const result = client.workflowInvocationPath("projectValue", "locationValue", "repositoryValue", "workflowInvocationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workflowInvocationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkflowInvocationName', () => { + const result = client.matchProjectFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkflowInvocationName', () => { + const result = client.matchLocationFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromWorkflowInvocationName', () => { + const result = client.matchRepositoryFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowInvocationFromWorkflowInvocationName', () => { + const result = client.matchWorkflowInvocationFromWorkflowInvocationName(fakePath); + assert.strictEqual(result, "workflowInvocationValue"); + assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('workspace', () => { + const fakePath = "/rendered/path/workspace"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + repository: "repositoryValue", + workspace: "workspaceValue", + }; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workspacePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.workspacePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('workspacePath', () => { + const result = client.workspacePath("projectValue", "locationValue", "repositoryValue", "workspaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.workspacePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromWorkspaceName', () => { + const result = client.matchProjectFromWorkspaceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromWorkspaceName', () => { + const result = client.matchLocationFromWorkspaceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRepositoryFromWorkspaceName', () => { + const result = client.matchRepositoryFromWorkspaceName(fakePath); + assert.strictEqual(result, "repositoryValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkspaceFromWorkspaceName', () => { + const result = client.matchWorkspaceFromWorkspaceName(fakePath); + assert.strictEqual(result, "workspaceValue"); + assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/tsconfig.json b/owl-bot-staging/v1beta1/tsconfig.json new file mode 100644 index 0000000..c78f1c8 --- /dev/null +++ b/owl-bot-staging/v1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1beta1/webpack.config.js b/owl-bot-staging/v1beta1/webpack.config.js new file mode 100644 index 0000000..b2259ed --- /dev/null +++ b/owl-bot-staging/v1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'Dataform', + filename: './dataform.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 49d5fdb24c057a522d01cbd855fa605ccfde7394 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 20 Aug 2022 01:01:24 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- owl-bot-staging/v1alpha2/.eslintignore | 7 - owl-bot-staging/v1alpha2/.eslintrc.json | 3 - owl-bot-staging/v1alpha2/.gitignore | 14 - owl-bot-staging/v1alpha2/.jsdoc.js | 55 - owl-bot-staging/v1alpha2/.mocharc.js | 33 - owl-bot-staging/v1alpha2/.prettierrc.js | 22 - owl-bot-staging/v1alpha2/README.md | 1 - .../v1alpha2/linkinator.config.json | 16 - owl-bot-staging/v1alpha2/package.json | 64 - .../cloud/dataform/v1alpha2/dataform.proto | 1628 ----- .../dataform.cancel_workflow_invocation.js | 61 - .../dataform.commit_workspace_changes.js | 75 - .../dataform.create_compilation_result.js | 67 - .../v1alpha2/dataform.create_repository.js | 73 - .../dataform.create_workflow_invocation.js | 66 - .../v1alpha2/dataform.create_workspace.js | 73 - .../v1alpha2/dataform.delete_repository.js | 67 - .../dataform.delete_workflow_invocation.js | 61 - .../v1alpha2/dataform.delete_workspace.js | 61 - .../v1alpha2/dataform.fetch_file_diff.js | 66 - .../dataform.fetch_file_git_statuses.js | 61 - .../dataform.fetch_git_ahead_behind.js | 67 - .../dataform.fetch_remote_branches.js | 61 - .../dataform.get_compilation_result.js | 61 - .../v1alpha2/dataform.get_repository.js | 61 - .../dataform.get_workflow_invocation.js | 61 - .../v1alpha2/dataform.get_workspace.js | 61 - .../v1alpha2/dataform.install_npm_packages.js | 61 - .../dataform.list_compilation_results.js | 77 - .../v1alpha2/dataform.list_repositories.js | 87 - .../dataform.list_workflow_invocations.js | 77 - .../v1alpha2/dataform.list_workspaces.js | 87 - .../v1alpha2/dataform.make_directory.js | 67 - .../v1alpha2/dataform.move_directory.js | 73 - .../generated/v1alpha2/dataform.move_file.js | 71 - .../v1alpha2/dataform.pull_git_commits.js | 72 - .../v1alpha2/dataform.push_git_commits.js | 66 - ...taform.query_compilation_result_actions.js | 82 - .../dataform.query_directory_contents.js | 82 - ...aform.query_workflow_invocation_actions.js | 77 - .../generated/v1alpha2/dataform.read_file.js | 66 - .../v1alpha2/dataform.remove_directory.js | 67 - .../v1alpha2/dataform.remove_file.js | 66 - .../dataform.reset_workspace_changes.js | 70 - .../v1alpha2/dataform.update_repository.js | 66 - .../generated/v1alpha2/dataform.write_file.js | 71 - ...tadata.google.cloud.dataform.v1alpha2.json | 1647 ------ owl-bot-staging/v1alpha2/src/index.ts | 25 - .../v1alpha2/src/v1alpha2/dataform_client.ts | 4387 -------------- .../src/v1alpha2/dataform_client_config.json | 170 - .../src/v1alpha2/dataform_proto_list.json | 3 - .../v1alpha2/src/v1alpha2/gapic_metadata.json | 411 -- .../v1alpha2/src/v1alpha2/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1alpha2/system-test/install.ts | 49 - .../v1alpha2/test/gapic_dataform_v1alpha2.ts | 5251 ----------------- owl-bot-staging/v1alpha2/tsconfig.json | 19 - owl-bot-staging/v1alpha2/webpack.config.js | 64 - owl-bot-staging/v1beta1/.eslintignore | 7 - owl-bot-staging/v1beta1/.eslintrc.json | 3 - owl-bot-staging/v1beta1/.gitignore | 14 - owl-bot-staging/v1beta1/.jsdoc.js | 55 - owl-bot-staging/v1beta1/.mocharc.js | 33 - owl-bot-staging/v1beta1/.prettierrc.js | 22 - owl-bot-staging/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 16 - owl-bot-staging/v1beta1/package.json | 64 - .../cloud/dataform/v1beta1/dataform.proto | 1629 ----- .../dataform.cancel_workflow_invocation.js | 61 - .../dataform.commit_workspace_changes.js | 75 - .../dataform.create_compilation_result.js | 67 - .../v1beta1/dataform.create_repository.js | 73 - .../dataform.create_workflow_invocation.js | 67 - .../v1beta1/dataform.create_workspace.js | 73 - .../v1beta1/dataform.delete_repository.js | 67 - .../dataform.delete_workflow_invocation.js | 61 - .../v1beta1/dataform.delete_workspace.js | 61 - .../v1beta1/dataform.fetch_file_diff.js | 66 - .../dataform.fetch_file_git_statuses.js | 61 - .../dataform.fetch_git_ahead_behind.js | 67 - .../v1beta1/dataform.fetch_remote_branches.js | 61 - .../dataform.get_compilation_result.js | 61 - .../v1beta1/dataform.get_repository.js | 61 - .../dataform.get_workflow_invocation.js | 61 - .../v1beta1/dataform.get_workspace.js | 61 - .../v1beta1/dataform.install_npm_packages.js | 61 - .../dataform.list_compilation_results.js | 77 - .../v1beta1/dataform.list_repositories.js | 87 - .../dataform.list_workflow_invocations.js | 77 - .../v1beta1/dataform.list_workspaces.js | 87 - .../v1beta1/dataform.make_directory.js | 67 - .../v1beta1/dataform.move_directory.js | 73 - .../generated/v1beta1/dataform.move_file.js | 71 - .../v1beta1/dataform.pull_git_commits.js | 72 - .../v1beta1/dataform.push_git_commits.js | 66 - ...taform.query_compilation_result_actions.js | 82 - .../dataform.query_directory_contents.js | 82 - ...aform.query_workflow_invocation_actions.js | 77 - .../generated/v1beta1/dataform.read_file.js | 66 - .../v1beta1/dataform.remove_directory.js | 67 - .../generated/v1beta1/dataform.remove_file.js | 66 - .../dataform.reset_workspace_changes.js | 70 - .../v1beta1/dataform.update_repository.js | 66 - .../generated/v1beta1/dataform.write_file.js | 71 - ...etadata.google.cloud.dataform.v1beta1.json | 1647 ------ owl-bot-staging/v1beta1/src/index.ts | 25 - .../v1beta1/src/v1beta1/dataform_client.ts | 4388 -------------- .../src/v1beta1/dataform_client_config.json | 170 - .../src/v1beta1/dataform_proto_list.json | 3 - .../v1beta1/src/v1beta1/gapic_metadata.json | 411 -- owl-bot-staging/v1beta1/src/v1beta1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1beta1/system-test/install.ts | 49 - .../v1beta1/test/gapic_dataform_v1beta1.ts | 5251 ----------------- owl-bot-staging/v1beta1/tsconfig.json | 19 - owl-bot-staging/v1beta1/webpack.config.js | 64 - .../dataform.cancel_workflow_invocation.js | 3 + .../dataform.commit_workspace_changes.js | 3 + .../dataform.create_compilation_result.js | 3 + .../v1alpha2/dataform.create_repository.js | 3 + .../dataform.create_workflow_invocation.js | 3 + .../v1alpha2/dataform.create_workspace.js | 3 + .../v1alpha2/dataform.delete_repository.js | 3 + .../dataform.delete_workflow_invocation.js | 3 + .../v1alpha2/dataform.delete_workspace.js | 3 + .../v1alpha2/dataform.fetch_file_diff.js | 3 + .../dataform.fetch_file_git_statuses.js | 3 + .../dataform.fetch_git_ahead_behind.js | 3 + .../dataform.fetch_remote_branches.js | 3 + .../dataform.get_compilation_result.js | 3 + .../v1alpha2/dataform.get_repository.js | 3 + .../dataform.get_workflow_invocation.js | 3 + .../v1alpha2/dataform.get_workspace.js | 3 + .../v1alpha2/dataform.install_npm_packages.js | 3 + .../dataform.list_compilation_results.js | 3 + .../v1alpha2/dataform.list_repositories.js | 3 + .../dataform.list_workflow_invocations.js | 3 + .../v1alpha2/dataform.list_workspaces.js | 3 + .../v1alpha2/dataform.make_directory.js | 3 + .../v1alpha2/dataform.move_directory.js | 3 + .../generated/v1alpha2/dataform.move_file.js | 3 + .../v1alpha2/dataform.pull_git_commits.js | 3 + .../v1alpha2/dataform.push_git_commits.js | 3 + ...taform.query_compilation_result_actions.js | 3 + .../dataform.query_directory_contents.js | 3 + ...aform.query_workflow_invocation_actions.js | 3 + .../generated/v1alpha2/dataform.read_file.js | 3 + .../v1alpha2/dataform.remove_directory.js | 3 + .../v1alpha2/dataform.remove_file.js | 3 + .../dataform.reset_workspace_changes.js | 3 + .../v1alpha2/dataform.update_repository.js | 3 + .../generated/v1alpha2/dataform.write_file.js | 3 + ...tadata.google.cloud.dataform.v1alpha2.json | 72 +- .../dataform.cancel_workflow_invocation.js | 3 + .../dataform.commit_workspace_changes.js | 3 + .../dataform.create_compilation_result.js | 3 + .../v1beta1/dataform.create_repository.js | 3 + .../dataform.create_workflow_invocation.js | 3 + .../v1beta1/dataform.create_workspace.js | 3 + .../v1beta1/dataform.delete_repository.js | 3 + .../dataform.delete_workflow_invocation.js | 3 + .../v1beta1/dataform.delete_workspace.js | 3 + .../v1beta1/dataform.fetch_file_diff.js | 3 + .../dataform.fetch_file_git_statuses.js | 3 + .../dataform.fetch_git_ahead_behind.js | 3 + .../v1beta1/dataform.fetch_remote_branches.js | 3 + .../dataform.get_compilation_result.js | 3 + .../v1beta1/dataform.get_repository.js | 3 + .../dataform.get_workflow_invocation.js | 3 + .../v1beta1/dataform.get_workspace.js | 3 + .../v1beta1/dataform.install_npm_packages.js | 3 + .../dataform.list_compilation_results.js | 3 + .../v1beta1/dataform.list_repositories.js | 3 + .../dataform.list_workflow_invocations.js | 3 + .../v1beta1/dataform.list_workspaces.js | 3 + .../v1beta1/dataform.make_directory.js | 3 + .../v1beta1/dataform.move_directory.js | 3 + .../generated/v1beta1/dataform.move_file.js | 3 + .../v1beta1/dataform.pull_git_commits.js | 3 + .../v1beta1/dataform.push_git_commits.js | 3 + ...taform.query_compilation_result_actions.js | 3 + .../dataform.query_directory_contents.js | 3 + ...aform.query_workflow_invocation_actions.js | 3 + .../generated/v1beta1/dataform.read_file.js | 3 + .../v1beta1/dataform.remove_directory.js | 3 + .../generated/v1beta1/dataform.remove_file.js | 3 + .../dataform.reset_workspace_changes.js | 3 + .../v1beta1/dataform.update_repository.js | 3 + .../generated/v1beta1/dataform.write_file.js | 3 + ...etadata.google.cloud.dataform.v1beta1.json | 72 +- src/v1alpha2/dataform_client.ts | 32 +- src/v1beta1/dataform_client.ts | 32 +- test/gapic_dataform_v1alpha2.ts | 156 +- test/gapic_dataform_v1beta1.ts | 156 +- 196 files changed, 478 insertions(+), 33131 deletions(-) delete mode 100644 owl-bot-staging/v1alpha2/.eslintignore delete mode 100644 owl-bot-staging/v1alpha2/.eslintrc.json delete mode 100644 owl-bot-staging/v1alpha2/.gitignore delete mode 100644 owl-bot-staging/v1alpha2/.jsdoc.js delete mode 100644 owl-bot-staging/v1alpha2/.mocharc.js delete mode 100644 owl-bot-staging/v1alpha2/.prettierrc.js delete mode 100644 owl-bot-staging/v1alpha2/README.md delete mode 100644 owl-bot-staging/v1alpha2/linkinator.config.json delete mode 100644 owl-bot-staging/v1alpha2/package.json delete mode 100644 owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js delete mode 100644 owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json delete mode 100644 owl-bot-staging/v1alpha2/src/index.ts delete mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts delete mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json delete mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json delete mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json delete mode 100644 owl-bot-staging/v1alpha2/src/v1alpha2/index.ts delete mode 100644 owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1alpha2/system-test/install.ts delete mode 100644 owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts delete mode 100644 owl-bot-staging/v1alpha2/tsconfig.json delete mode 100644 owl-bot-staging/v1alpha2/webpack.config.js delete mode 100644 owl-bot-staging/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/v1beta1/.gitignore delete mode 100644 owl-bot-staging/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/v1beta1/README.md delete mode 100644 owl-bot-staging/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/v1beta1/package.json delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js delete mode 100644 owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json delete mode 100644 owl-bot-staging/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/v1beta1/webpack.config.js diff --git a/owl-bot-staging/v1alpha2/.eslintignore b/owl-bot-staging/v1alpha2/.eslintignore deleted file mode 100644 index cfc348e..0000000 --- a/owl-bot-staging/v1alpha2/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1alpha2/.eslintrc.json b/owl-bot-staging/v1alpha2/.eslintrc.json deleted file mode 100644 index 7821534..0000000 --- a/owl-bot-staging/v1alpha2/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1alpha2/.gitignore b/owl-bot-staging/v1alpha2/.gitignore deleted file mode 100644 index 5d32b23..0000000 --- a/owl-bot-staging/v1alpha2/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1alpha2/.jsdoc.js b/owl-bot-staging/v1alpha2/.jsdoc.js deleted file mode 100644 index 166ea79..0000000 --- a/owl-bot-staging/v1alpha2/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/dataform', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1alpha2/.mocharc.js b/owl-bot-staging/v1alpha2/.mocharc.js deleted file mode 100644 index 481c522..0000000 --- a/owl-bot-staging/v1alpha2/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1alpha2/.prettierrc.js b/owl-bot-staging/v1alpha2/.prettierrc.js deleted file mode 100644 index 494e147..0000000 --- a/owl-bot-staging/v1alpha2/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1alpha2/README.md b/owl-bot-staging/v1alpha2/README.md deleted file mode 100644 index cd744d1..0000000 --- a/owl-bot-staging/v1alpha2/README.md +++ /dev/null @@ -1 +0,0 @@ -Dataform: Nodejs Client diff --git a/owl-bot-staging/v1alpha2/linkinator.config.json b/owl-bot-staging/v1alpha2/linkinator.config.json deleted file mode 100644 index befd23c..0000000 --- a/owl-bot-staging/v1alpha2/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v1alpha2/package.json b/owl-bot-staging/v1alpha2/package.json deleted file mode 100644 index 8b0851c..0000000 --- a/owl-bot-staging/v1alpha2/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/dataform", - "version": "0.1.0", - "description": "Dataform client for Node.js", - "repository": "googleapis/nodejs-dataform", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google dataform", - "dataform", - "dataform" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.2.0" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.50", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.2", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.7.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto b/owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto deleted file mode 100644 index 771acdb..0000000 --- a/owl-bot-staging/v1alpha2/protos/google/cloud/dataform/v1alpha2/dataform.proto +++ /dev/null @@ -1,1628 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataform.v1alpha2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.Dataform.V1Alpha2"; -option go_package = "google.golang.org/genproto/googleapis/cloud/dataform/v1alpha2;dataform"; -option java_multiple_files = true; -option java_outer_classname = "DataformProto"; -option java_package = "com.google.cloud.dataform.v1alpha2"; -option php_namespace = "Google\\Cloud\\Dataform\\V1alpha2"; -option ruby_package = "Google::Cloud::Dataform::V1alpha2"; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/SecretVersion" - pattern: "projects/{project}/secrets/{secret}/versions/{version}" -}; - -// Dataform is a service to develop, create, document, test, and update curated -// tables in BigQuery. -service Dataform { - option (google.api.default_host) = "dataform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists Repositories in a given project and location. - rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) { - option (google.api.http) = { - get: "/v1alpha2/{parent=projects/*/locations/*}/repositories" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single Repository. - rpc GetRepository(GetRepositoryRequest) returns (Repository) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Repository in a given project and location. - rpc CreateRepository(CreateRepositoryRequest) returns (Repository) { - option (google.api.http) = { - post: "/v1alpha2/{parent=projects/*/locations/*}/repositories" - body: "repository" - }; - option (google.api.method_signature) = "parent,repository,repository_id"; - } - - // Updates a single Repository. - rpc UpdateRepository(UpdateRepositoryRequest) returns (Repository) { - option (google.api.http) = { - patch: "/v1alpha2/{repository.name=projects/*/locations/*/repositories/*}" - body: "repository" - }; - option (google.api.method_signature) = "repository,update_mask"; - } - - // Deletes a single Repository. - rpc DeleteRepository(DeleteRepositoryRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha2/{name=projects/*/locations/*/repositories/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Fetches a Repository's remote branches. - rpc FetchRemoteBranches(FetchRemoteBranchesRequest) returns (FetchRemoteBranchesResponse) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*}:fetchRemoteBranches" - }; - } - - // Lists Workspaces in a given Repository. - rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) { - option (google.api.http) = { - get: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workspaces" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single Workspace. - rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Workspace in a given Repository. - rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) { - option (google.api.http) = { - post: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workspaces" - body: "workspace" - }; - option (google.api.method_signature) = "parent,workspace,workspace_id"; - } - - // Deletes a single Workspace. - rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Installs dependency NPM packages (inside a Workspace). - rpc InstallNpmPackages(InstallNpmPackagesRequest) returns (InstallNpmPackagesResponse) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:installNpmPackages" - body: "*" - }; - } - - // Pulls Git commits from the Repository's remote into a Workspace. - rpc PullGitCommits(PullGitCommitsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:pull" - body: "*" - }; - } - - // Pushes Git commits from a Workspace to the Repository's remote. - rpc PushGitCommits(PushGitCommitsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:push" - body: "*" - }; - } - - // Fetches Git statuses for the files in a Workspace. - rpc FetchFileGitStatuses(FetchFileGitStatusesRequest) returns (FetchFileGitStatusesResponse) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileGitStatuses" - }; - } - - // Fetches Git ahead/behind against a remote branch. - rpc FetchGitAheadBehind(FetchGitAheadBehindRequest) returns (FetchGitAheadBehindResponse) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind" - }; - } - - // Applies a Git commit for uncommitted files in a Workspace. - rpc CommitWorkspaceChanges(CommitWorkspaceChangesRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:commit" - body: "*" - }; - } - - // Performs a Git reset for uncommitted files in a Workspace. - rpc ResetWorkspaceChanges(ResetWorkspaceChangesRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workspaces/*}:reset" - body: "*" - }; - } - - // Fetches Git diff for an uncommitted file in a Workspace. - rpc FetchFileDiff(FetchFileDiffRequest) returns (FetchFileDiffResponse) { - option (google.api.http) = { - get: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileDiff" - }; - } - - // Returns the contents of a given Workspace directory. - rpc QueryDirectoryContents(QueryDirectoryContentsRequest) returns (QueryDirectoryContentsResponse) { - option (google.api.http) = { - get: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents" - }; - } - - // Creates a directory inside a Workspace. - rpc MakeDirectory(MakeDirectoryRequest) returns (MakeDirectoryResponse) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:makeDirectory" - body: "*" - }; - } - - // Deletes a directory (inside a Workspace) and all of its contents. - rpc RemoveDirectory(RemoveDirectoryRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeDirectory" - body: "*" - }; - } - - // Moves a directory (inside a Workspace), and all of its contents, to a new - // location. - rpc MoveDirectory(MoveDirectoryRequest) returns (MoveDirectoryResponse) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveDirectory" - body: "*" - }; - } - - // Returns the contents of a file (inside a Workspace). - rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) { - option (google.api.http) = { - get: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile" - }; - } - - // Deletes a file (inside a Workspace). - rpc RemoveFile(RemoveFileRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeFile" - body: "*" - }; - } - - // Moves a file (inside a Workspace) to a new location. - rpc MoveFile(MoveFileRequest) returns (MoveFileResponse) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveFile" - body: "*" - }; - } - - // Writes to a file (inside a Workspace). - rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) { - option (google.api.http) = { - post: "/v1alpha2/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:writeFile" - body: "*" - }; - } - - // Lists CompilationResults in a given Repository. - rpc ListCompilationResults(ListCompilationResultsRequest) returns (ListCompilationResultsResponse) { - option (google.api.http) = { - get: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/compilationResults" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single CompilationResult. - rpc GetCompilationResult(GetCompilationResultRequest) returns (CompilationResult) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/compilationResults/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new CompilationResult in a given project and location. - rpc CreateCompilationResult(CreateCompilationResultRequest) returns (CompilationResult) { - option (google.api.http) = { - post: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/compilationResults" - body: "compilation_result" - }; - option (google.api.method_signature) = "parent,compilation_result"; - } - - // Returns CompilationResultActions in a given CompilationResult. - rpc QueryCompilationResultActions(QueryCompilationResultActionsRequest) returns (QueryCompilationResultActionsResponse) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/compilationResults/*}:query" - }; - } - - // Lists WorkflowInvocations in a given Repository. - rpc ListWorkflowInvocations(ListWorkflowInvocationsRequest) returns (ListWorkflowInvocationsResponse) { - option (google.api.http) = { - get: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single WorkflowInvocation. - rpc GetWorkflowInvocation(GetWorkflowInvocationRequest) returns (WorkflowInvocation) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new WorkflowInvocation in a given Repository. - rpc CreateWorkflowInvocation(CreateWorkflowInvocationRequest) returns (WorkflowInvocation) { - option (google.api.http) = { - post: "/v1alpha2/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" - body: "workflow_invocation" - }; - option (google.api.method_signature) = "parent,workflow_invocation"; - } - - // Deletes a single WorkflowInvocation. - rpc DeleteWorkflowInvocation(DeleteWorkflowInvocationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Requests cancellation of a running WorkflowInvocation. - rpc CancelWorkflowInvocation(CancelWorkflowInvocationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:cancel" - body: "*" - }; - } - - // Returns WorkflowInvocationActions in a given WorkflowInvocation. - rpc QueryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest) returns (QueryWorkflowInvocationActionsResponse) { - option (google.api.http) = { - get: "/v1alpha2/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:query" - }; - } -} - -// Represents a Dataform Git repository. -message Repository { - option (google.api.resource) = { - type: "dataform.googleapis.com/Repository" - pattern: "projects/{project}/locations/{location}/repositories/{repository}" - }; - - // Controls Git remote configuration for a repository. - message GitRemoteSettings { - // Indicates the status of a Git authentication token. - enum TokenStatus { - // Default value. This value is unused. - TOKEN_STATUS_UNSPECIFIED = 0; - - // The token could not be found in Secret Manager (or the Dataform - // Service Account did not have permission to access it). - NOT_FOUND = 1; - - // The token could not be used to authenticate against the Git remote. - INVALID = 2; - - // The token was used successfully to authenticate against the Git remote. - VALID = 3; - } - - // Required. The Git remote's URL. - string url = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Git remote's default branch name. - string default_branch = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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/*`. - string authentication_token_secret_version = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - } - ]; - - // Output only. Indicates the status of the Git access token. - TokenStatus token_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The repository's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. If set, configures this repository to be linked to a Git remote. - GitRemoteSettings git_remote_settings = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListRepositories` request message. -message ListRepositoriesRequest { - // Required. The location in which to list repositories. Must be in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Maximum number of repositories to return. The server may return fewer - // items than requested. If unspecified, the server will pick an appropriate - // default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter for the returned list. - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListRepositories` response message. -message ListRepositoriesResponse { - // List of repositories. - repeated Repository repositories = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetRepository` request message. -message GetRepositoryRequest { - // Required. The repository's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; -} - -// `CreateRepository` request message. -message CreateRepositoryRequest { - // Required. The location in which to create the repository. Must be in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The repository to create. - Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the repository, which will become the final component of - // the repository's resource name. - string repository_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `UpdateRepository` request message. -message UpdateRepositoryRequest { - // Optional. Specifies the fields to be updated in the repository. If left unset, - // all fields will be updated. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The repository to update. - Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `DeleteRepository` request message. -message DeleteRepositoryRequest { - // Required. The repository's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // 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.) - bool force = 2; -} - -// `FetchRemoteBranches` request message. -message FetchRemoteBranchesRequest { - // Required. The repository's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; -} - -// `FetchRemoteBranches` response message. -message FetchRemoteBranchesResponse { - // The remote repository's branch names. - repeated string branches = 1; -} - -// Represents a Dataform Git workspace. -message Workspace { - option (google.api.resource) = { - type: "dataform.googleapis.com/Workspace" - pattern: "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}" - }; - - // Output only. The workspace's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `ListWorkspaces` request message. -message ListWorkspacesRequest { - // Required. The repository in which to list workspaces. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Optional. Maximum number of workspaces to return. The server may return fewer - // items than requested. If unspecified, the server will pick an appropriate - // default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter for the returned list. - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListWorkspaces` response message. -message ListWorkspacesResponse { - // List of workspaces. - repeated Workspace workspaces = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetWorkspace` request message. -message GetWorkspaceRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// `CreateWorkspace` request message. -message CreateWorkspaceRequest { - // Required. The repository in which to create the workspace. Must be in the format - // `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Required. The workspace to create. - Workspace workspace = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the workspace, which will become the final component of - // the workspace's resource name. - string workspace_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `DeleteWorkspace` request message. -message DeleteWorkspaceRequest { - // Required. The workspace resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// Represents the author of a Git commit. -message CommitAuthor { - // Required. The commit author's name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The commit author's email address. - string email_address = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `PullGitCommits` request message. -message PullGitCommitsRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The author of any merge commit which may be created as a result of merging - // fetched Git commits into this workspace. - CommitAuthor author = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `PushGitCommits` request message. -message PushGitCommitsRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// `FetchFileGitStatuses` request message. -message FetchFileGitStatusesRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// `FetchFileGitStatuses` response message. -message FetchFileGitStatusesResponse { - // Represents the Git state of a file with uncommitted changes. - message UncommittedFileChange { - // Indicates the status of an uncommitted file change. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The file has been newly added. - ADDED = 1; - - // The file has been deleted. - DELETED = 2; - - // The file has been modified. - MODIFIED = 3; - - // The file contains merge conflicts. - HAS_CONFLICTS = 4; - } - - // The file's full path including filename, relative to the workspace root. - string path = 1; - - // Indicates the status of the file. - State state = 2; - } - - // A list of all files which have uncommitted Git changes. There will only be - // a single entry for any given file. - repeated UncommittedFileChange uncommitted_file_changes = 1; -} - -// `FetchGitAheadBehind` request message. -message FetchGitAheadBehindRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// `FetchGitAheadBehind` response message. -message FetchGitAheadBehindResponse { - // The number of commits in the remote branch that are not in the workspace. - int32 commits_ahead = 1; - - // The number of commits in the workspace that are not in the remote branch. - int32 commits_behind = 2; -} - -// `CommitWorkspaceChanges` request message. -message CommitWorkspaceChangesRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The commit's author. - CommitAuthor author = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The commit's message. - string commit_message = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Full file paths to commit including filename, rooted at workspace root. If - // left empty, all files will be committed. - repeated string paths = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ResetWorkspaceChanges` request message. -message ResetWorkspaceChangesRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - repeated string paths = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, untracked files will be deleted. - bool clean = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `FetchFileDiff` request message. -message FetchFileDiffRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `FetchFileDiff` response message. -message FetchFileDiffResponse { - // The raw formatted Git diff for the file. - string formatted_diff = 1; -} - -// `QueryDirectoryContents` request message. -message QueryDirectoryContentsRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Optional. The directory's full path including directory name, relative to the - // workspace root. If left unset, the workspace root is used. - string path = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of paths to return. The server may return fewer - // items than requested. If unspecified, the server will pick an appropriate - // default. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// `QueryDirectoryContents` response message. -message QueryDirectoryContentsResponse { - // Represents a single entry in a workspace directory. - message DirectoryEntry { - oneof entry { - // A file in the directory. - string file = 1; - - // A child directory in the directory. - string directory = 2; - } - } - - // List of entries in the directory. - repeated DirectoryEntry directory_entries = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// `MakeDirectory` request message. -message MakeDirectoryRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The directory's full path including directory name, relative to the - // workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `MakeDirectory` response message. -message MakeDirectoryResponse { - -} - -// `RemoveDirectory` request message. -message RemoveDirectoryRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The directory's full path including directory name, relative to the - // workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveDirectory` request message. -message MoveDirectoryRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The directory's full path including directory name, relative to the - // workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The new path for the directory including directory name, rooted at - // workspace root. - string new_path = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveDirectory` response message. -message MoveDirectoryResponse { - -} - -// `ReadFile` request message. -message ReadFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `ReadFile` response message. -message ReadFileResponse { - // The file's contents. - bytes file_contents = 1; -} - -// `RemoveFile` request message. -message RemoveFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveFile` request message. -message MoveFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The file's new path including filename, relative to the workspace root. - string new_path = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveFile` response message. -message MoveFileResponse { - -} - -// `WriteFile` request message. -message WriteFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file. - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The file's contents. - bytes contents = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `WriteFile` response message. -message WriteFileResponse { - -} - -// `InstallNpmPackages` request message. -message InstallNpmPackagesRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// `InstallNpmPackages` response message. -message InstallNpmPackagesResponse { - -} - -// Represents the result of compiling a Dataform project. -message CompilationResult { - option (google.api.resource) = { - type: "dataform.googleapis.com/CompilationResult" - pattern: "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}" - }; - - // Configures various aspects of Dataform code compilation. - message CodeCompilationConfig { - // Optional. The default database (Google Cloud project ID). - string default_database = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default schema (BigQuery dataset ID). - string default_schema = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string default_location = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default schema (BigQuery dataset ID) for assertions. - string assertion_schema = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-defined variables that are made available to project code during - // compilation. - map vars = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The suffix that should be appended to all database (Google Cloud project - // ID) names. - string database_suffix = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The suffix that should be appended to all schema (BigQuery dataset ID) - // names. - string schema_suffix = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The prefix that should be prepended to all table names. - string table_prefix = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // An error encountered when attempting to compile a Dataform project. - message CompilationError { - // Output only. The error's top level message. - string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error's full stack trace. - string stack = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The path of the file where this error occurred, if available, relative to - // the project root. - string path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the action where this error occurred, if available. - Target action_target = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The compilation result's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - oneof source { - // 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` - string git_commitish = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The name of the workspace to compile. Must be in the format - // `projects/*/locations/*/repositories/*/workspaces/*`. - string workspace = 3 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - } - - // Immutable. If set, fields of `code_compilation_overrides` override the default - // compilation settings that are specified in dataform.json. - CodeCompilationConfig code_compilation_config = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The version of `@dataform/core` that was used for compilation. - string dataform_core_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Errors encountered during project compilation. - repeated CompilationError compilation_errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `ListCompilationResults` request message. -message ListCompilationResultsRequest { - // Required. The repository in which to list compilation results. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListCompilationResults` response message. -message ListCompilationResultsResponse { - // List of compilation results. - repeated CompilationResult compilation_results = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetCompilationResult` request message. -message GetCompilationResultRequest { - // Required. The compilation result's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/CompilationResult" - } - ]; -} - -// `CreateCompilationResult` request message. -message CreateCompilationResultRequest { - // Required. The repository in which to create the compilation result. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Required. The compilation result to create. - CompilationResult compilation_result = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Represents an action identifier. If the action writes output, the output -// will be written to the referenced database object. -message Target { - // The action's database (Google Cloud project ID) . - string database = 1; - - // The action's schema (BigQuery dataset ID), within `database`. - string schema = 2; - - // The action's name, within `database` and `schema`. - string name = 3; -} - -// Describes a relation and its columns. -message RelationDescriptor { - // Describes a column. - message ColumnDescriptor { - // The identifier for the column. Each entry in `path` represents one level - // of nesting. - repeated string path = 1; - - // A textual description of the column. - string description = 2; - - // A list of BigQuery policy tags that will be applied to the column. - repeated string bigquery_policy_tags = 3; - } - - // A text description of the relation. - string description = 1; - - // A list of descriptions of columns within the relation. - repeated ColumnDescriptor columns = 2; - - // A set of BigQuery labels that should be applied to the relation. - map bigquery_labels = 3; -} - -// Represents a single Dataform action in a compilation result. -message CompilationResultAction { - // Represents a database relation. - message Relation { - // Indicates the type of this relation. - enum RelationType { - // Default value. This value is unused. - RELATION_TYPE_UNSPECIFIED = 0; - - // The relation is a table. - TABLE = 1; - - // The relation is a view. - VIEW = 2; - - // The relation is an incrementalized table. - INCREMENTAL_TABLE = 3; - - // The relation is a materialized view. - MATERIALIZED_VIEW = 4; - } - - // Contains settings for relations of type `INCREMENTAL_TABLE`. - message IncrementalTableConfig { - // The SELECT query which returns rows which should be inserted into the - // relation if it already exists and is not being refreshed. - string incremental_select_query = 1; - - // Whether this table should be protected from being refreshed. - bool refresh_disabled = 2; - - // 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. - repeated string unique_key_parts = 3; - - // A SQL expression conditional used to limit the set of existing rows - // considered for a merge operation (see `unique_key_parts` for more - // information). - string update_partition_filter = 4; - - // SQL statements to be executed before inserting new rows into the - // relation. - repeated string incremental_pre_operations = 5; - - // SQL statements to be executed after inserting new rows into the - // relation. - repeated string incremental_post_operations = 6; - } - - // A list of actions that this action depends on. - repeated Target dependency_targets = 1; - - // Whether this action is disabled (i.e. should not be run). - bool disabled = 2; - - // Arbitrary, user-defined tags on this action. - repeated string tags = 3; - - // Descriptor for the relation and its columns. - RelationDescriptor relation_descriptor = 4; - - // The type of this relation. - RelationType relation_type = 5; - - // The SELECT query which returns rows which this relation should contain. - string select_query = 6; - - // SQL statements to be executed before creating the relation. - repeated string pre_operations = 7; - - // SQL statements to be executed after creating the relation. - repeated string post_operations = 8; - - // Configures `INCREMENTAL_TABLE` settings for this relation. Only set if - // `relation_type` is `INCREMENTAL_TABLE`. - IncrementalTableConfig incremental_table_config = 9; - - // The SQL expression used to partition the relation. - string partition_expression = 10; - - // A list of columns or SQL expressions used to cluster the table. - repeated string cluster_expressions = 11; - - // Sets the partition expiration in days. - int32 partition_expiration_days = 12; - - // Specifies whether queries on this table must include a predicate filter - // that filters on the partitioning column. - bool require_partition_filter = 13; - - // 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. - map additional_options = 14; - } - - // Represents a list of arbitrary database operations. - message Operations { - // A list of actions that this action depends on. - repeated Target dependency_targets = 1; - - // Whether this action is disabled (i.e. should not be run). - bool disabled = 2; - - // Arbitrary, user-defined tags on this action. - repeated string tags = 3; - - // Descriptor for any output relation and its columns. Only set if - // `has_output` is true. - RelationDescriptor relation_descriptor = 6; - - // A list of arbitrary SQL statements that will be executed without - // alteration. - repeated string queries = 4; - - // Whether these operations produce an output relation. - bool has_output = 5; - } - - // Represents an assertion upon a SQL query which is required return zero - // rows. - message Assertion { - // A list of actions that this action depends on. - repeated Target dependency_targets = 1; - - // The parent action of this assertion. Only set if this assertion was - // automatically generated. - Target parent_action = 5; - - // Whether this action is disabled (i.e. should not be run). - bool disabled = 2; - - // Arbitrary, user-defined tags on this action. - repeated string tags = 3; - - // The SELECT query which must return zero rows in order for this assertion - // to succeed. - string select_query = 4; - - // Descriptor for the assertion's automatically-generated view and its - // columns. - RelationDescriptor relation_descriptor = 6; - } - - // Represents a relation which is not managed by Dataform but which may be - // referenced by Dataform actions. - message 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 relation_descriptor = 1; - } - - // This action's identifier. Unique within the compilation result. - Target target = 1; - - // The action's identifier if the project had been compiled without any - // overrides configured. Unique within the compilation result. - Target canonical_target = 2; - - // The full path including filename in which this action is located, relative - // to the workspace root. - string file_path = 3; - - oneof compiled_object { - // The database relation created/updated by this action. - Relation relation = 4; - - // The database operations executed by this action. - Operations operations = 5; - - // The assertion executed by this action. - Assertion assertion = 6; - - // The declaration declared by this action. - Declaration declaration = 7; - } -} - -// `QueryCompilationResultActions` request message. -message QueryCompilationResultActionsRequest { - // Required. The compilation result's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/CompilationResult" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Optional filter for the returned list. Filtering is only currently - // supported on the `file_path` field. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// `QueryCompilationResultActions` response message. -message QueryCompilationResultActionsResponse { - // List of compilation result actions. - repeated CompilationResultAction compilation_result_actions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Represents a single invocation of a compilation result. -message WorkflowInvocation { - option (google.api.resource) = { - type: "dataform.googleapis.com/WorkflowInvocation" - pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}" - }; - - // Includes various configuration options for this workflow invocation. - // If both `included_targets` and `included_tags` are unset, all actions - // will be included. - message InvocationConfig { - // Immutable. The set of action identifiers to include. - repeated Target included_targets = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The set of tags to include. - repeated string included_tags = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. When set to true, transitive dependencies of included actions will be - // executed. - bool transitive_dependencies_included = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. When set to true, transitive dependents of included actions will be - // executed. - bool transitive_dependents_included = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. When set to true, any incremental tables will be fully refreshed. - bool fully_refresh_incremental_tables_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; - } - - // Represents the current state of a workflow invocation. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The workflow invocation is currently running. - RUNNING = 1; - - // The workflow invocation succeeded. A terminal state. - SUCCEEDED = 2; - - // The workflow invocation was cancelled. A terminal state. - CANCELLED = 3; - - // The workflow invocation failed. A terminal state. - FAILED = 4; - - // The workflow invocation is being cancelled, but some actions are still - // running. - CANCELING = 5; - } - - // Output only. The workflow invocation's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The name of the compilation result to compile. Must be in the format - // `projects/*/locations/*/repositories/*/compilationResults/*`. - string compilation_result = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/CompilationResult" - } - ]; - - // Immutable. If left unset, a default InvocationConfig will be used. - InvocationConfig invocation_config = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. This workflow invocation's current state. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This workflow invocation's timing details. - google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `ListWorkflowInvocations` request message. -message ListWorkflowInvocationsRequest { - // Required. The parent resource of the WorkflowInvocation type. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListWorkflowInvocations` response message. -message ListWorkflowInvocationsResponse { - // List of workflow invocations. - repeated WorkflowInvocation workflow_invocations = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetWorkflowInvocation` request message. -message GetWorkflowInvocationRequest { - // Required. The workflow invocation resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; -} - -// `CreateWorkflowInvocation` request message. -message CreateWorkflowInvocationRequest { - // Required. The parent resource of the WorkflowInvocation type. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Required. The workflow invocation resource to create. - WorkflowInvocation workflow_invocation = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `DeleteWorkflowInvocation` request message. -message DeleteWorkflowInvocationRequest { - // Required. The workflow invocation resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; -} - -// `CancelWorkflowInvocation` request message. -message CancelWorkflowInvocationRequest { - // Required. The workflow invocation resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; -} - -// Represents a single action in a workflow invocation. -message WorkflowInvocationAction { - // Represents the current state of an workflow invocation action. - enum State { - // The action has not yet been considered for invocation. - PENDING = 0; - - // The action is currently running. - RUNNING = 1; - - // Execution of the action was skipped because upstream dependencies did not - // all complete successfully. A terminal state. - SKIPPED = 2; - - // Execution of the action was disabled as per the configuration of the - // corresponding compilation result action. A terminal state. - DISABLED = 3; - - // The action succeeded. A terminal state. - SUCCEEDED = 4; - - // The action was cancelled. A terminal state. - CANCELLED = 5; - - // The action failed. A terminal state. - FAILED = 6; - } - - // Represents a workflow action that will run against BigQuery. - message BigQueryAction { - // Output only. The generated BigQuery SQL script that will be executed. - string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. This action's identifier. Unique within the workflow invocation. - Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The action's identifier if the project had been compiled without any - // overrides configured. Unique within the compilation result. - Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This action's current state. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If and only if action's state is FAILED a failure reason is set. - string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The workflow action's bigquery action details. - BigQueryAction bigquery_action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `QueryWorkflowInvocationActions` request message. -message QueryWorkflowInvocationActionsRequest { - // Required. The workflow invocation's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `QueryWorkflowInvocationActions` response message. -message QueryWorkflowInvocationActionsResponse { - // List of workflow invocation actions. - repeated WorkflowInvocationAction workflow_invocation_actions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js deleted file mode 100644 index 65ab554..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCancelWorkflowInvocation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.cancelWorkflowInvocation(request); - console.log(response); - } - - callCancelWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js deleted file mode 100644 index e4b9e76..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.commit_workspace_changes.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, author) { - // [START dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * Required. The commit's author. - */ - // const author = {} - /** - * Optional. The commit's message. - */ - // const commitMessage = 'abc123' - /** - * Optional. Full file paths to commit including filename, rooted at workspace root. If - * left empty, all files will be committed. - */ - // const paths = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCommitWorkspaceChanges() { - // Construct request - const request = { - name, - author, - }; - - // Run request - const response = await dataformClient.commitWorkspaceChanges(request); - console.log(response); - } - - callCommitWorkspaceChanges(); - // [END dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js deleted file mode 100644 index 42cafe8..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_compilation_result.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, compilationResult) { - // [START dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to create the compilation result. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Required. The compilation result to create. - */ - // const compilationResult = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateCompilationResult() { - // Construct request - const request = { - parent, - compilationResult, - }; - - // Run request - const response = await dataformClient.createCompilationResult(request); - console.log(response); - } - - callCreateCompilationResult(); - // [END dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js deleted file mode 100644 index b734380..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_repository.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, repository, repositoryId) { - // [START dataform_v1alpha2_generated_Dataform_CreateRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location in which to create the repository. Must be in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Required. The repository to create. - */ - // const repository = {} - /** - * Required. The ID to use for the repository, which will become the final component of - * the repository's resource name. - */ - // const repositoryId = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateRepository() { - // Construct request - const request = { - parent, - repository, - repositoryId, - }; - - // Run request - const response = await dataformClient.createRepository(request); - console.log(response); - } - - callCreateRepository(); - // [END dataform_v1alpha2_generated_Dataform_CreateRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js deleted file mode 100644 index 7aeaced..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workflow_invocation.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, workflowInvocation) { - // [START dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the WorkflowInvocation type. - */ - // const parent = 'abc123' - /** - * Required. The workflow invocation resource to create. - */ - // const workflowInvocation = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateWorkflowInvocation() { - // Construct request - const request = { - parent, - workflowInvocation, - }; - - // Run request - const response = await dataformClient.createWorkflowInvocation(request); - console.log(response); - } - - callCreateWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js deleted file mode 100644 index 2b55956..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.create_workspace.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, workspace, workspaceId) { - // [START dataform_v1alpha2_generated_Dataform_CreateWorkspace_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to create the workspace. Must be in the format - * `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Required. The workspace to create. - */ - // const workspace = {} - /** - * Required. The ID to use for the workspace, which will become the final component of - * the workspace's resource name. - */ - // const workspaceId = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateWorkspace() { - // Construct request - const request = { - parent, - workspace, - workspaceId, - }; - - // Run request - const response = await dataformClient.createWorkspace(request); - console.log(response); - } - - callCreateWorkspace(); - // [END dataform_v1alpha2_generated_Dataform_CreateWorkspace_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js deleted file mode 100644 index bfe3dc9..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_repository.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_DeleteRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository's name. - */ - // const name = 'abc123' - /** - * 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.) - */ - // const force = true - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callDeleteRepository() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.deleteRepository(request); - console.log(response); - } - - callDeleteRepository(); - // [END dataform_v1alpha2_generated_Dataform_DeleteRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js deleted file mode 100644 index 800461d..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callDeleteWorkflowInvocation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.deleteWorkflowInvocation(request); - console.log(response); - } - - callDeleteWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js deleted file mode 100644 index f773c39..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.delete_workspace.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callDeleteWorkspace() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.deleteWorkspace(request); - console.log(response); - } - - callDeleteWorkspace(); - // [END dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js deleted file mode 100644 index df28731..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_diff.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchFileDiff() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.fetchFileDiff(request); - console.log(response); - } - - callFetchFileDiff(); - // [END dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js deleted file mode 100644 index ba0e827..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchFileGitStatuses() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.fetchFileGitStatuses(request); - console.log(response); - } - - callFetchFileGitStatuses(); - // [END dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js deleted file mode 100644 index 1dcc54b..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const remoteBranch = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchGitAheadBehind() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.fetchGitAheadBehind(request); - console.log(response); - } - - callFetchGitAheadBehind(); - // [END dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js deleted file mode 100644 index c6c2b7f..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.fetch_remote_branches.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchRemoteBranches() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.fetchRemoteBranches(request); - console.log(response); - } - - callFetchRemoteBranches(); - // [END dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js deleted file mode 100644 index 38711f9..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_compilation_result.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_GetCompilationResult_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The compilation result's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetCompilationResult() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getCompilationResult(request); - console.log(response); - } - - callGetCompilationResult(); - // [END dataform_v1alpha2_generated_Dataform_GetCompilationResult_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js deleted file mode 100644 index e633675..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_repository.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_GetRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetRepository() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getRepository(request); - console.log(response); - } - - callGetRepository(); - // [END dataform_v1alpha2_generated_Dataform_GetRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js deleted file mode 100644 index 8ed6ab4..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workflow_invocation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetWorkflowInvocation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getWorkflowInvocation(request); - console.log(response); - } - - callGetWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js deleted file mode 100644 index 294d027..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.get_workspace.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_GetWorkspace_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetWorkspace() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getWorkspace(request); - console.log(response); - } - - callGetWorkspace(); - // [END dataform_v1alpha2_generated_Dataform_GetWorkspace_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js deleted file mode 100644 index bfae9b7..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.install_npm_packages.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace) { - // [START dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callInstallNpmPackages() { - // Construct request - const request = { - workspace, - }; - - // Run request - const response = await dataformClient.installNpmPackages(request); - console.log(response); - } - - callInstallNpmPackages(); - // [END dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js deleted file mode 100644 index f463dc1..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_compilation_results.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1alpha2_generated_Dataform_ListCompilationResults_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListCompilationResults() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listCompilationResultsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCompilationResults(); - // [END dataform_v1alpha2_generated_Dataform_ListCompilationResults_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js deleted file mode 100644 index 2f81c22..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_repositories.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1alpha2_generated_Dataform_ListRepositories_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * 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. - */ - // const orderBy = 'abc123' - /** - * Optional. Filter for the returned list. - */ - // const filter = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListRepositories() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listRepositoriesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRepositories(); - // [END dataform_v1alpha2_generated_Dataform_ListRepositories_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js deleted file mode 100644 index 12e7d3e..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workflow_invocations.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListWorkflowInvocations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listWorkflowInvocationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkflowInvocations(); - // [END dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js deleted file mode 100644 index 8a1f1c9..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.list_workspaces.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1alpha2_generated_Dataform_ListWorkspaces_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * 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. - */ - // const orderBy = 'abc123' - /** - * Optional. Filter for the returned list. - */ - // const filter = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListWorkspaces() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listWorkspacesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkspaces(); - // [END dataform_v1alpha2_generated_Dataform_ListWorkspaces_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js deleted file mode 100644 index faf321e..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.make_directory.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_MakeDirectory_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The directory's full path including directory name, relative to the - * workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callMakeDirectory() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.makeDirectory(request); - console.log(response); - } - - callMakeDirectory(); - // [END dataform_v1alpha2_generated_Dataform_MakeDirectory_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js deleted file mode 100644 index d50b32b..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_directory.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path, newPath) { - // [START dataform_v1alpha2_generated_Dataform_MoveDirectory_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The directory's full path including directory name, relative to the - * workspace root. - */ - // const path = 'abc123' - /** - * Required. The new path for the directory including directory name, rooted at - * workspace root. - */ - // const newPath = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callMoveDirectory() { - // Construct request - const request = { - workspace, - path, - newPath, - }; - - // Run request - const response = await dataformClient.moveDirectory(request); - console.log(response); - } - - callMoveDirectory(); - // [END dataform_v1alpha2_generated_Dataform_MoveDirectory_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js deleted file mode 100644 index 7f04c99..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.move_file.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path, newPath) { - // [START dataform_v1alpha2_generated_Dataform_MoveFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - /** - * Required. The file's new path including filename, relative to the workspace root. - */ - // const newPath = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callMoveFile() { - // Construct request - const request = { - workspace, - path, - newPath, - }; - - // Run request - const response = await dataformClient.moveFile(request); - console.log(response); - } - - callMoveFile(); - // [END dataform_v1alpha2_generated_Dataform_MoveFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js deleted file mode 100644 index 2b6de81..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.pull_git_commits.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, author) { - // [START dataform_v1alpha2_generated_Dataform_PullGitCommits_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const remoteBranch = 'abc123' - /** - * Required. The author of any merge commit which may be created as a result of merging - * fetched Git commits into this workspace. - */ - // const author = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callPullGitCommits() { - // Construct request - const request = { - name, - author, - }; - - // Run request - const response = await dataformClient.pullGitCommits(request); - console.log(response); - } - - callPullGitCommits(); - // [END dataform_v1alpha2_generated_Dataform_PullGitCommits_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js deleted file mode 100644 index bdcd4b2..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.push_git_commits.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_PushGitCommits_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const remoteBranch = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callPushGitCommits() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.pushGitCommits(request); - console.log(response); - } - - callPushGitCommits(); - // [END dataform_v1alpha2_generated_Dataform_PushGitCommits_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js deleted file mode 100644 index e829710..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The compilation result's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - */ - // const filter = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callQueryCompilationResultActions() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await dataformClient.queryCompilationResultActionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callQueryCompilationResultActions(); - // [END dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js deleted file mode 100644 index 2e5c0bc..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_directory_contents.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace) { - // [START dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - */ - // const path = 'abc123' - /** - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callQueryDirectoryContents() { - // Construct request - const request = { - workspace, - }; - - // Run request - const iterable = await dataformClient.queryDirectoryContentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callQueryDirectoryContents(); - // [END dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js deleted file mode 100644 index 0abc8a2..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callQueryWorkflowInvocationActions() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await dataformClient.queryWorkflowInvocationActionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callQueryWorkflowInvocationActions(); - // [END dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js deleted file mode 100644 index 7cd0572..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.read_file.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_ReadFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callReadFile() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.readFile(request); - console.log(response); - } - - callReadFile(); - // [END dataform_v1alpha2_generated_Dataform_ReadFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js deleted file mode 100644 index 157e012..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_directory.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_RemoveDirectory_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The directory's full path including directory name, relative to the - * workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callRemoveDirectory() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.removeDirectory(request); - console.log(response); - } - - callRemoveDirectory(); - // [END dataform_v1alpha2_generated_Dataform_RemoveDirectory_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js deleted file mode 100644 index 396738b..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.remove_file.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_RemoveFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callRemoveFile() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.removeFile(request); - console.log(response); - } - - callRemoveFile(); - // [END dataform_v1alpha2_generated_Dataform_RemoveFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js deleted file mode 100644 index d91ec7f..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.reset_workspace_changes.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const paths = 'abc123' - /** - * Optional. If set to true, untracked files will be deleted. - */ - // const clean = true - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callResetWorkspaceChanges() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.resetWorkspaceChanges(request); - console.log(response); - } - - callResetWorkspaceChanges(); - // [END dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js deleted file mode 100644 index 48c5d61..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.update_repository.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(repository) { - // [START dataform_v1alpha2_generated_Dataform_UpdateRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Optional. Specifies the fields to be updated in the repository. If left unset, - * all fields will be updated. - */ - // const updateMask = {} - /** - * Required. The repository to update. - */ - // const repository = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callUpdateRepository() { - // Construct request - const request = { - repository, - }; - - // Run request - const response = await dataformClient.updateRepository(request); - console.log(response); - } - - callUpdateRepository(); - // [END dataform_v1alpha2_generated_Dataform_UpdateRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js deleted file mode 100644 index 08ed5bb..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/dataform.write_file.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path, contents) { - // [START dataform_v1alpha2_generated_Dataform_WriteFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file. - */ - // const path = 'abc123' - /** - * Required. The file's contents. - */ - // const contents = 'Buffer.from('string')' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callWriteFile() { - // Construct request - const request = { - workspace, - path, - contents, - }; - - // Run request - const response = await dataformClient.writeFile(request); - console.log(response); - } - - callWriteFile(); - // [END dataform_v1alpha2_generated_Dataform_WriteFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json b/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json deleted file mode 100644 index db87e4b..0000000 --- a/owl-bot-staging/v1alpha2/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json +++ /dev/null @@ -1,1647 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-dataform", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.dataform.v1alpha2", - "version": "v1alpha2" - } - ] - }, - "snippets": [ - { - "regionTag": "dataform_v1alpha2_generated_Dataform_ListRepositories_async", - "title": "Dataform listRepositories Sample", - "origin": "API_DEFINITION", - "description": " Lists Repositories in a given project and location.", - "canonical": true, - "file": "dataform.list_repositories.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRepositories", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListRepositories", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.ListRepositoriesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "ListRepositories", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListRepositories", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_GetRepository_async", - "title": "Dataform getRepository Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single Repository.", - "canonical": true, - "file": "dataform.get_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetRepository", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.Repository", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "GetRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_CreateRepository_async", - "title": "Dataform createRepository Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Repository in a given project and location.", - "canonical": true, - "file": "dataform.create_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateRepository", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "repository", - "type": ".google.cloud.dataform.v1alpha2.Repository" - }, - { - "name": "repository_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.Repository", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "CreateRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_UpdateRepository_async", - "title": "Dataform updateRepository Sample", - "origin": "API_DEFINITION", - "description": " Updates a single Repository.", - "canonical": true, - "file": "dataform.update_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.UpdateRepository", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "repository", - "type": ".google.cloud.dataform.v1alpha2.Repository" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.Repository", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "UpdateRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.UpdateRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_DeleteRepository_async", - "title": "Dataform deleteRepository Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Repository.", - "canonical": true, - "file": "dataform.delete_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteRepository", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "DeleteRepository", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async", - "title": "Dataform fetchRemoteBranches Sample", - "origin": "API_DEFINITION", - "description": " Fetches a Repository's remote branches.", - "canonical": true, - "file": "dataform.fetch_remote_branches.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchRemoteBranches", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchRemoteBranches", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "FetchRemoteBranches", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchRemoteBranches", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_ListWorkspaces_async", - "title": "Dataform listWorkspaces Sample", - "origin": "API_DEFINITION", - "description": " Lists Workspaces in a given Repository.", - "canonical": true, - "file": "dataform.list_workspaces.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkspaces", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkspaces", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.ListWorkspacesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "ListWorkspaces", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkspaces", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_GetWorkspace_async", - "title": "Dataform getWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single Workspace.", - "canonical": true, - "file": "dataform.get_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkspace", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.Workspace", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "GetWorkspace", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkspace", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_CreateWorkspace_async", - "title": "Dataform createWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Workspace in a given Repository.", - "canonical": true, - "file": "dataform.create_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkspace", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkspace", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "workspace", - "type": ".google.cloud.dataform.v1alpha2.Workspace" - }, - { - "name": "workspace_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.Workspace", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "CreateWorkspace", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkspace", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async", - "title": "Dataform deleteWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Workspace.", - "canonical": true, - "file": "dataform.delete_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkspace", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "DeleteWorkspace", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkspace", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async", - "title": "Dataform installNpmPackages Sample", - "origin": "API_DEFINITION", - "description": " Installs dependency NPM packages (inside a Workspace).", - "canonical": true, - "file": "dataform.install_npm_packages.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InstallNpmPackages", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.InstallNpmPackages", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "InstallNpmPackages", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.InstallNpmPackages", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_PullGitCommits_async", - "title": "Dataform pullGitCommits Sample", - "origin": "API_DEFINITION", - "description": " Pulls Git commits from the Repository's remote into a Workspace.", - "canonical": true, - "file": "dataform.pull_git_commits.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PullGitCommits", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.PullGitCommits", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "remote_branch", - "type": "TYPE_STRING" - }, - { - "name": "author", - "type": ".google.cloud.dataform.v1alpha2.CommitAuthor" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "PullGitCommits", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.PullGitCommits", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_PushGitCommits_async", - "title": "Dataform pushGitCommits Sample", - "origin": "API_DEFINITION", - "description": " Pushes Git commits from a Workspace to the Repository's remote.", - "canonical": true, - "file": "dataform.push_git_commits.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PushGitCommits", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.PushGitCommits", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "remote_branch", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "PushGitCommits", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.PushGitCommits", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async", - "title": "Dataform fetchFileGitStatuses Sample", - "origin": "API_DEFINITION", - "description": " Fetches Git statuses for the files in a Workspace.", - "canonical": true, - "file": "dataform.fetch_file_git_statuses.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchFileGitStatuses", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileGitStatuses", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "FetchFileGitStatuses", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileGitStatuses", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async", - "title": "Dataform fetchGitAheadBehind Sample", - "origin": "API_DEFINITION", - "description": " Fetches Git ahead/behind against a remote branch.", - "canonical": true, - "file": "dataform.fetch_git_ahead_behind.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchGitAheadBehind", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchGitAheadBehind", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "remote_branch", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "FetchGitAheadBehind", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchGitAheadBehind", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async", - "title": "Dataform commitWorkspaceChanges Sample", - "origin": "API_DEFINITION", - "description": " Applies a Git commit for uncommitted files in a Workspace.", - "canonical": true, - "file": "dataform.commit_workspace_changes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CommitWorkspaceChanges", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CommitWorkspaceChanges", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "author", - "type": ".google.cloud.dataform.v1alpha2.CommitAuthor" - }, - { - "name": "commit_message", - "type": "TYPE_STRING" - }, - { - "name": "paths", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "CommitWorkspaceChanges", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CommitWorkspaceChanges", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async", - "title": "Dataform resetWorkspaceChanges Sample", - "origin": "API_DEFINITION", - "description": " Performs a Git reset for uncommitted files in a Workspace.", - "canonical": true, - "file": "dataform.reset_workspace_changes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResetWorkspaceChanges", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ResetWorkspaceChanges", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "paths", - "type": "TYPE_STRING[]" - }, - { - "name": "clean", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "ResetWorkspaceChanges", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ResetWorkspaceChanges", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_FetchFileDiff_async", - "title": "Dataform fetchFileDiff Sample", - "origin": "API_DEFINITION", - "description": " Fetches Git diff for an uncommitted file in a Workspace.", - "canonical": true, - "file": "dataform.fetch_file_diff.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchFileDiff", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileDiff", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.FetchFileDiffResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "FetchFileDiff", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.FetchFileDiff", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async", - "title": "Dataform queryDirectoryContents Sample", - "origin": "API_DEFINITION", - "description": " Returns the contents of a given Workspace directory.", - "canonical": true, - "file": "dataform.query_directory_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "QueryDirectoryContents", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryDirectoryContents", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "QueryDirectoryContents", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryDirectoryContents", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_MakeDirectory_async", - "title": "Dataform makeDirectory Sample", - "origin": "API_DEFINITION", - "description": " Creates a directory inside a Workspace.", - "canonical": true, - "file": "dataform.make_directory.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MakeDirectory", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.MakeDirectory", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.MakeDirectoryResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "MakeDirectory", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.MakeDirectory", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_RemoveDirectory_async", - "title": "Dataform removeDirectory Sample", - "origin": "API_DEFINITION", - "description": " Deletes a directory (inside a Workspace) and all of its contents.", - "canonical": true, - "file": "dataform.remove_directory.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RemoveDirectory", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveDirectory", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "RemoveDirectory", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveDirectory", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_MoveDirectory_async", - "title": "Dataform moveDirectory Sample", - "origin": "API_DEFINITION", - "description": " Moves a directory (inside a Workspace), and all of its contents, to a new location.", - "canonical": true, - "file": "dataform.move_directory.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MoveDirectory", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveDirectory", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "new_path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.MoveDirectoryResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "MoveDirectory", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveDirectory", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_ReadFile_async", - "title": "Dataform readFile Sample", - "origin": "API_DEFINITION", - "description": " Returns the contents of a file (inside a Workspace).", - "canonical": true, - "file": "dataform.read_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ReadFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.ReadFileResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "ReadFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ReadFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_RemoveFile_async", - "title": "Dataform removeFile Sample", - "origin": "API_DEFINITION", - "description": " Deletes a file (inside a Workspace).", - "canonical": true, - "file": "dataform.remove_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RemoveFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "RemoveFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.RemoveFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_MoveFile_async", - "title": "Dataform moveFile Sample", - "origin": "API_DEFINITION", - "description": " Moves a file (inside a Workspace) to a new location.", - "canonical": true, - "file": "dataform.move_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MoveFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "new_path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.MoveFileResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "MoveFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.MoveFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_WriteFile_async", - "title": "Dataform writeFile Sample", - "origin": "API_DEFINITION", - "description": " Writes to a file (inside a Workspace).", - "canonical": true, - "file": "dataform.write_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "WriteFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.WriteFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "contents", - "type": "TYPE_BYTES" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.WriteFileResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "WriteFile", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.WriteFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_ListCompilationResults_async", - "title": "Dataform listCompilationResults Sample", - "origin": "API_DEFINITION", - "description": " Lists CompilationResults in a given Repository.", - "canonical": true, - "file": "dataform.list_compilation_results.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCompilationResults", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListCompilationResults", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.ListCompilationResultsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "ListCompilationResults", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListCompilationResults", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_GetCompilationResult_async", - "title": "Dataform getCompilationResult Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single CompilationResult.", - "canonical": true, - "file": "dataform.get_compilation_result.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCompilationResult", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetCompilationResult", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.CompilationResult", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "GetCompilationResult", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetCompilationResult", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async", - "title": "Dataform createCompilationResult Sample", - "origin": "API_DEFINITION", - "description": " Creates a new CompilationResult in a given project and location.", - "canonical": true, - "file": "dataform.create_compilation_result.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCompilationResult", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateCompilationResult", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "compilation_result", - "type": ".google.cloud.dataform.v1alpha2.CompilationResult" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.CompilationResult", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "CreateCompilationResult", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateCompilationResult", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async", - "title": "Dataform queryCompilationResultActions Sample", - "origin": "API_DEFINITION", - "description": " Returns CompilationResultActions in a given CompilationResult.", - "canonical": true, - "file": "dataform.query_compilation_result_actions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "QueryCompilationResultActions", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryCompilationResultActions", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.QueryCompilationResultActionsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "QueryCompilationResultActions", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryCompilationResultActions", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async", - "title": "Dataform listWorkflowInvocations Sample", - "origin": "API_DEFINITION", - "description": " Lists WorkflowInvocations in a given Repository.", - "canonical": true, - "file": "dataform.list_workflow_invocations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkflowInvocations", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkflowInvocations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.ListWorkflowInvocationsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "ListWorkflowInvocations", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.ListWorkflowInvocations", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async", - "title": "Dataform getWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single WorkflowInvocation.", - "canonical": true, - "file": "dataform.get_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.WorkflowInvocation", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "GetWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.GetWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async", - "title": "Dataform createWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Creates a new WorkflowInvocation in a given Repository.", - "canonical": true, - "file": "dataform.create_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "workflow_invocation", - "type": ".google.cloud.dataform.v1alpha2.WorkflowInvocation" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.WorkflowInvocation", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "CreateWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CreateWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async", - "title": "Dataform deleteWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single WorkflowInvocation.", - "canonical": true, - "file": "dataform.delete_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "DeleteWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.DeleteWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async", - "title": "Dataform cancelWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Requests cancellation of a running WorkflowInvocation.", - "canonical": true, - "file": "dataform.cancel_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CancelWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "CancelWorkflowInvocation", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.CancelWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async", - "title": "Dataform queryWorkflowInvocationActions Sample", - "origin": "API_DEFINITION", - "description": " Returns WorkflowInvocationActions in a given WorkflowInvocation.", - "canonical": true, - "file": "dataform.query_workflow_invocation_actions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "QueryWorkflowInvocationActions", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryWorkflowInvocationActions", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1alpha2.DataformClient" - }, - "method": { - "shortName": "QueryWorkflowInvocationActions", - "fullName": "google.cloud.dataform.v1alpha2.Dataform.QueryWorkflowInvocationActions", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1alpha2.Dataform" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1alpha2/src/index.ts b/owl-bot-staging/v1alpha2/src/index.ts deleted file mode 100644 index 84ba790..0000000 --- a/owl-bot-staging/v1alpha2/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1alpha2 from './v1alpha2'; -const DataformClient = v1alpha2.DataformClient; -type DataformClient = v1alpha2.DataformClient; -export {v1alpha2, DataformClient}; -export default {v1alpha2, DataformClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts deleted file mode 100644 index d5e4619..0000000 --- a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client.ts +++ /dev/null @@ -1,4387 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; - -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1alpha2/dataform_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './dataform_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Dataform is a service to develop, create, document, test, and update curated - * tables in BigQuery. - * @class - * @memberof v1alpha2 - */ -export class DataformClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - dataformStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DataformClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DataformClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new IamClient(this._gaxGrpc, opts); - - this.locationsClient = new LocationsClient(this._gaxGrpc, opts); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - compilationResultPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - repositoryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}' - ), - workflowInvocationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}' - ), - workspacePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listRepositories: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'repositories'), - listWorkspaces: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workspaces'), - queryDirectoryContents: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'directoryEntries'), - listCompilationResults: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResults'), - queryCompilationResultActions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResultActions'), - listWorkflowInvocations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocations'), - queryWorkflowInvocationActions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocationActions') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataform.v1alpha2.Dataform', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.dataformStub) { - return this.dataformStub; - } - - // Put together the "service stub" for - // google.cloud.dataform.v1alpha2.Dataform. - this.dataformStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataform.v1alpha2.Dataform') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataform.v1alpha2.Dataform, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const dataformStubMethods = - ['listRepositories', 'getRepository', 'createRepository', 'updateRepository', 'deleteRepository', 'fetchRemoteBranches', 'listWorkspaces', 'getWorkspace', 'createWorkspace', 'deleteWorkspace', 'installNpmPackages', 'pullGitCommits', 'pushGitCommits', 'fetchFileGitStatuses', 'fetchGitAheadBehind', 'commitWorkspaceChanges', 'resetWorkspaceChanges', 'fetchFileDiff', 'queryDirectoryContents', 'makeDirectory', 'removeDirectory', 'moveDirectory', 'readFile', 'removeFile', 'moveFile', 'writeFile', 'listCompilationResults', 'getCompilationResult', 'createCompilationResult', 'queryCompilationResultActions', 'listWorkflowInvocations', 'getWorkflowInvocation', 'createWorkflowInvocation', 'deleteWorkflowInvocation', 'cancelWorkflowInvocation', 'queryWorkflowInvocationActions']; - for (const methodName of dataformStubMethods) { - const callPromise = this.dataformStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.dataformStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'dataform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'dataform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Fetches a single Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The repository's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.get_repository.js - * region_tag:dataform_v1alpha2_generated_Dataform_GetRepository_async - */ - getRepository( - request?: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|undefined, {}|undefined - ]>; - getRepository( - request: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, - {}|null|undefined>): void; - getRepository( - request: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, - {}|null|undefined>): void; - getRepository( - request?: protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IGetRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getRepository(request, options, callback); - } -/** - * Creates a new Repository in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to create the repository. Must be in the format - * `projects/* /locations/*`. - * @param {google.cloud.dataform.v1alpha2.Repository} request.repository - * Required. The repository to create. - * @param {string} request.repositoryId - * Required. The ID to use for the repository, which will become the final component of - * the repository's resource name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.create_repository.js - * region_tag:dataform_v1alpha2_generated_Dataform_CreateRepository_async - */ - createRepository( - request?: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|undefined, {}|undefined - ]>; - createRepository( - request: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - createRepository( - request: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - createRepository( - request?: protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.ICreateRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createRepository(request, options, callback); - } -/** - * Updates a single Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Specifies the fields to be updated in the repository. If left unset, - * all fields will be updated. - * @param {google.cloud.dataform.v1alpha2.Repository} request.repository - * Required. The repository to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.update_repository.js - * region_tag:dataform_v1alpha2_generated_Dataform_UpdateRepository_async - */ - updateRepository( - request?: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|undefined, {}|undefined - ]>; - updateRepository( - request: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - updateRepository( - request: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - updateRepository( - request?: protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository, - protos.google.cloud.dataform.v1alpha2.IUpdateRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'repository.name': request.repository!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateRepository(request, options, callback); - } -/** - * Deletes a single Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The repository's name. - * @param {boolean} request.force - * 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.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.delete_repository.js - * region_tag:dataform_v1alpha2_generated_Dataform_DeleteRepository_async - */ - deleteRepository( - request?: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|undefined, {}|undefined - ]>; - deleteRepository( - request: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>): void; - deleteRepository( - request: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>): void; - deleteRepository( - request?: protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteRepository(request, options, callback); - } -/** - * Fetches a Repository's remote branches. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The repository's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchRemoteBranchesResponse]{@link google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.fetch_remote_branches.js - * region_tag:dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async - */ - fetchRemoteBranches( - request?: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|undefined, {}|undefined - ]>; - fetchRemoteBranches( - request: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>): void; - fetchRemoteBranches( - request: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>): void; - fetchRemoteBranches( - request?: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.fetchRemoteBranches(request, options, callback); - } -/** - * Fetches a single Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.get_workspace.js - * region_tag:dataform_v1alpha2_generated_Dataform_GetWorkspace_async - */ - getWorkspace( - request?: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|undefined, {}|undefined - ]>; - getWorkspace( - request: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - getWorkspace( - request: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - getWorkspace( - request?: protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.IGetWorkspaceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getWorkspace(request, options, callback); - } -/** - * Creates a new Workspace in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to create the workspace. Must be in the format - * `projects/* /locations/* /repositories/*`. - * @param {google.cloud.dataform.v1alpha2.Workspace} request.workspace - * Required. The workspace to create. - * @param {string} request.workspaceId - * Required. The ID to use for the workspace, which will become the final component of - * the workspace's resource name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.create_workspace.js - * region_tag:dataform_v1alpha2_generated_Dataform_CreateWorkspace_async - */ - createWorkspace( - request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|undefined, {}|undefined - ]>; - createWorkspace( - request: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - createWorkspace( - request: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - createWorkspace( - request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkspace, - protos.google.cloud.dataform.v1alpha2.ICreateWorkspaceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createWorkspace(request, options, callback); - } -/** - * Deletes a single Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.delete_workspace.js - * region_tag:dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async - */ - deleteWorkspace( - request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|undefined, {}|undefined - ]>; - deleteWorkspace( - request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkspace( - request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkspace( - request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkspaceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteWorkspace(request, options, callback); - } -/** - * Installs dependency NPM packages (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [InstallNpmPackagesResponse]{@link google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.install_npm_packages.js - * region_tag:dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async - */ - installNpmPackages( - request?: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|undefined, {}|undefined - ]>; - installNpmPackages( - request: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>): void; - installNpmPackages( - request: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>): void; - installNpmPackages( - request?: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.installNpmPackages(request, options, callback); - } -/** - * Pulls Git commits from the Repository's remote into a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string} [request.remoteBranch] - * 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. - * @param {google.cloud.dataform.v1alpha2.CommitAuthor} request.author - * Required. The author of any merge commit which may be created as a result of merging - * fetched Git commits into this workspace. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.pull_git_commits.js - * region_tag:dataform_v1alpha2_generated_Dataform_PullGitCommits_async - */ - pullGitCommits( - request?: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|undefined, {}|undefined - ]>; - pullGitCommits( - request: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pullGitCommits( - request: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pullGitCommits( - request?: protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPullGitCommitsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pullGitCommits(request, options, callback); - } -/** - * Pushes Git commits from a Workspace to the Repository's remote. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string} [request.remoteBranch] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.push_git_commits.js - * region_tag:dataform_v1alpha2_generated_Dataform_PushGitCommits_async - */ - pushGitCommits( - request?: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|undefined, {}|undefined - ]>; - pushGitCommits( - request: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pushGitCommits( - request: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pushGitCommits( - request?: protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IPushGitCommitsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pushGitCommits(request, options, callback); - } -/** - * Fetches Git statuses for the files in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchFileGitStatusesResponse]{@link google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js - * region_tag:dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async - */ - fetchFileGitStatuses( - request?: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|undefined, {}|undefined - ]>; - fetchFileGitStatuses( - request: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>): void; - fetchFileGitStatuses( - request: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>): void; - fetchFileGitStatuses( - request?: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.fetchFileGitStatuses(request, options, callback); - } -/** - * Fetches Git ahead/behind against a remote branch. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string} [request.remoteBranch] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchGitAheadBehindResponse]{@link google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js - * region_tag:dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async - */ - fetchGitAheadBehind( - request?: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|undefined, {}|undefined - ]>; - fetchGitAheadBehind( - request: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>): void; - fetchGitAheadBehind( - request: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>): void; - fetchGitAheadBehind( - request?: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.fetchGitAheadBehind(request, options, callback); - } -/** - * Applies a Git commit for uncommitted files in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {google.cloud.dataform.v1alpha2.CommitAuthor} request.author - * Required. The commit's author. - * @param {string} [request.commitMessage] - * Optional. The commit's message. - * @param {string[]} [request.paths] - * Optional. Full file paths to commit including filename, rooted at workspace root. If - * left empty, all files will be committed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.commit_workspace_changes.js - * region_tag:dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async - */ - commitWorkspaceChanges( - request?: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|undefined, {}|undefined - ]>; - commitWorkspaceChanges( - request: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - commitWorkspaceChanges( - request: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - commitWorkspaceChanges( - request?: protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICommitWorkspaceChangesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.commitWorkspaceChanges(request, options, callback); - } -/** - * Performs a Git reset for uncommitted files in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string[]} [request.paths] - * 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. - * @param {boolean} [request.clean] - * Optional. If set to true, untracked files will be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.reset_workspace_changes.js - * region_tag:dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async - */ - resetWorkspaceChanges( - request?: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|undefined, {}|undefined - ]>; - resetWorkspaceChanges( - request: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - resetWorkspaceChanges( - request: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - resetWorkspaceChanges( - request?: protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IResetWorkspaceChangesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.resetWorkspaceChanges(request, options, callback); - } -/** - * Fetches Git diff for an uncommitted file in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchFileDiffResponse]{@link google.cloud.dataform.v1alpha2.FetchFileDiffResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.fetch_file_diff.js - * region_tag:dataform_v1alpha2_generated_Dataform_FetchFileDiff_async - */ - fetchFileDiff( - request?: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|undefined, {}|undefined - ]>; - fetchFileDiff( - request: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>): void; - fetchFileDiff( - request: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>): void; - fetchFileDiff( - request?: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1alpha2.IFetchFileDiffRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.fetchFileDiff(request, options, callback); - } -/** - * Creates a directory inside a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The directory's full path including directory name, relative to the - * workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MakeDirectoryResponse]{@link google.cloud.dataform.v1alpha2.MakeDirectoryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.make_directory.js - * region_tag:dataform_v1alpha2_generated_Dataform_MakeDirectory_async - */ - makeDirectory( - request?: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|undefined, {}|undefined - ]>; - makeDirectory( - request: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>): void; - makeDirectory( - request: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>): void; - makeDirectory( - request?: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMakeDirectoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.makeDirectory(request, options, callback); - } -/** - * Deletes a directory (inside a Workspace) and all of its contents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The directory's full path including directory name, relative to the - * workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.remove_directory.js - * region_tag:dataform_v1alpha2_generated_Dataform_RemoveDirectory_async - */ - removeDirectory( - request?: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|undefined, {}|undefined - ]>; - removeDirectory( - request: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - removeDirectory( - request: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - removeDirectory( - request?: protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveDirectoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.removeDirectory(request, options, callback); - } -/** - * Moves a directory (inside a Workspace), and all of its contents, to a new - * location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The directory's full path including directory name, relative to the - * workspace root. - * @param {string} request.newPath - * Required. The new path for the directory including directory name, rooted at - * workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MoveDirectoryResponse]{@link google.cloud.dataform.v1alpha2.MoveDirectoryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.move_directory.js - * region_tag:dataform_v1alpha2_generated_Dataform_MoveDirectory_async - */ - moveDirectory( - request?: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|undefined, {}|undefined - ]>; - moveDirectory( - request: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - moveDirectory( - request: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - moveDirectory( - request?: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1alpha2.IMoveDirectoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.moveDirectory(request, options, callback); - } -/** - * Returns the contents of a file (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadFileResponse]{@link google.cloud.dataform.v1alpha2.ReadFileResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.read_file.js - * region_tag:dataform_v1alpha2_generated_Dataform_ReadFile_async - */ - readFile( - request?: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IReadFileResponse, - protos.google.cloud.dataform.v1alpha2.IReadFileRequest|undefined, {}|undefined - ]>; - readFile( - request: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IReadFileResponse, - protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, - {}|null|undefined>): void; - readFile( - request: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IReadFileResponse, - protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, - {}|null|undefined>): void; - readFile( - request?: protos.google.cloud.dataform.v1alpha2.IReadFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IReadFileResponse, - protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IReadFileResponse, - protos.google.cloud.dataform.v1alpha2.IReadFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IReadFileResponse, - protos.google.cloud.dataform.v1alpha2.IReadFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.readFile(request, options, callback); - } -/** - * Deletes a file (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.remove_file.js - * region_tag:dataform_v1alpha2_generated_Dataform_RemoveFile_async - */ - removeFile( - request?: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|undefined, {}|undefined - ]>; - removeFile( - request: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, - {}|null|undefined>): void; - removeFile( - request: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, - {}|null|undefined>): void; - removeFile( - request?: protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IRemoveFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.removeFile(request, options, callback); - } -/** - * Moves a file (inside a Workspace) to a new location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {string} request.newPath - * Required. The file's new path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MoveFileResponse]{@link google.cloud.dataform.v1alpha2.MoveFileResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.move_file.js - * region_tag:dataform_v1alpha2_generated_Dataform_MoveFile_async - */ - moveFile( - request?: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, - protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|undefined, {}|undefined - ]>; - moveFile( - request: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, - protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, - {}|null|undefined>): void; - moveFile( - request: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, - protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, - {}|null|undefined>): void; - moveFile( - request?: protos.google.cloud.dataform.v1alpha2.IMoveFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, - protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, - protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IMoveFileResponse, - protos.google.cloud.dataform.v1alpha2.IMoveFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.moveFile(request, options, callback); - } -/** - * Writes to a file (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file. - * @param {Buffer} request.contents - * Required. The file's contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteFileResponse]{@link google.cloud.dataform.v1alpha2.WriteFileResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.write_file.js - * region_tag:dataform_v1alpha2_generated_Dataform_WriteFile_async - */ - writeFile( - request?: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, - protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|undefined, {}|undefined - ]>; - writeFile( - request: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, - protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, - {}|null|undefined>): void; - writeFile( - request: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, - protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, - {}|null|undefined>): void; - writeFile( - request?: protos.google.cloud.dataform.v1alpha2.IWriteFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, - protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, - protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWriteFileResponse, - protos.google.cloud.dataform.v1alpha2.IWriteFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.writeFile(request, options, callback); - } -/** - * Fetches a single CompilationResult. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.get_compilation_result.js - * region_tag:dataform_v1alpha2_generated_Dataform_GetCompilationResult_async - */ - getCompilationResult( - request?: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|undefined, {}|undefined - ]>; - getCompilationResult( - request: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - getCompilationResult( - request: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - getCompilationResult( - request?: protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.IGetCompilationResultRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getCompilationResult(request, options, callback); - } -/** - * Creates a new CompilationResult in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to create the compilation result. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {google.cloud.dataform.v1alpha2.CompilationResult} request.compilationResult - * Required. The compilation result to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.create_compilation_result.js - * region_tag:dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async - */ - createCompilationResult( - request?: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|undefined, {}|undefined - ]>; - createCompilationResult( - request: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - createCompilationResult( - request: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - createCompilationResult( - request?: protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResult, - protos.google.cloud.dataform.v1alpha2.ICreateCompilationResultRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createCompilationResult(request, options, callback); - } -/** - * Fetches a single WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.get_workflow_invocation.js - * region_tag:dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async - */ - getWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|undefined, {}|undefined - ]>; - getWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - getWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - getWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.IGetWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getWorkflowInvocation(request, options, callback); - } -/** - * Creates a new WorkflowInvocation in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. - * @param {google.cloud.dataform.v1alpha2.WorkflowInvocation} request.workflowInvocation - * Required. The workflow invocation resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.create_workflow_invocation.js - * region_tag:dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async - */ - createWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|undefined, {}|undefined - ]>; - createWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - createWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, - callback: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - createWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation, - protos.google.cloud.dataform.v1alpha2.ICreateWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createWorkflowInvocation(request, options, callback); - } -/** - * Deletes a single WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.delete_workflow_invocation.js - * region_tag:dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async - */ - deleteWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|undefined, {}|undefined - ]>; - deleteWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.IDeleteWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteWorkflowInvocation(request, options, callback); - } -/** - * Requests cancellation of a running WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js - * region_tag:dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async - */ - cancelWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|undefined, {}|undefined - ]>; - cancelWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - cancelWorkflowInvocation( - request: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - cancelWorkflowInvocation( - request?: protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1alpha2.ICancelWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelWorkflowInvocation(request, options, callback); - } - - /** - * Lists Repositories in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listRepositoriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listRepositories( - request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository[], - protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest|null, - protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse - ]>; - listRepositories( - request: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IRepository>): void; - listRepositories( - request: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IRepository>): void; - listRepositories( - request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IRepository>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IRepository>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IRepository[], - protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest|null, - protos.google.cloud.dataform.v1alpha2.IListRepositoriesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listRepositories(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Repository]{@link google.cloud.dataform.v1alpha2.Repository} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listRepositoriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listRepositoriesStream( - request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listRepositories']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRepositories.createStream( - this.innerApiCalls.listRepositories as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRepositories`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Repository]{@link google.cloud.dataform.v1alpha2.Repository}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.list_repositories.js - * region_tag:dataform_v1alpha2_generated_Dataform_ListRepositories_async - */ - listRepositoriesAsync( - request?: protos.google.cloud.dataform.v1alpha2.IListRepositoriesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listRepositories']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRepositories.asyncIterate( - this.innerApiCalls['listRepositories'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Workspaces in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listWorkspacesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkspaces( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkspace[], - protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest|null, - protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse - ]>; - listWorkspaces( - request: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkspace>): void; - listWorkspaces( - request: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkspace>): void; - listWorkspaces( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkspace>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkspace>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkspace[], - protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest|null, - protos.google.cloud.dataform.v1alpha2.IListWorkspacesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listWorkspaces(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listWorkspacesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkspacesStream( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkspaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkspaces.createStream( - this.innerApiCalls.listWorkspaces as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkspaces`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Workspace]{@link google.cloud.dataform.v1alpha2.Workspace}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.list_workspaces.js - * region_tag:dataform_v1alpha2_generated_Dataform_ListWorkspaces_async - */ - listWorkspacesAsync( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkspacesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkspaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkspaces.asyncIterate( - this.innerApiCalls['listWorkspaces'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns the contents of a given Workspace directory. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} [request.path] - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - * @param {number} [request.pageSize] - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DirectoryEntry]{@link google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `queryDirectoryContentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryDirectoryContents( - request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[], - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest|null, - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse - ]>; - queryDirectoryContents( - request: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>): void; - queryDirectoryContents( - request: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>): void; - queryDirectoryContents( - request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[], - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest|null, - protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.queryDirectoryContents(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} [request.path] - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - * @param {number} [request.pageSize] - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DirectoryEntry]{@link google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `queryDirectoryContentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryDirectoryContentsStream( - request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - const defaultCallSettings = this._defaults['queryDirectoryContents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryDirectoryContents.createStream( - this.innerApiCalls.queryDirectoryContents as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryDirectoryContents`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} [request.path] - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - * @param {number} [request.pageSize] - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DirectoryEntry]{@link google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.query_directory_contents.js - * region_tag:dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async - */ - queryDirectoryContentsAsync( - request?: protos.google.cloud.dataform.v1alpha2.IQueryDirectoryContentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - const defaultCallSettings = this._defaults['queryDirectoryContents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryDirectoryContents.asyncIterate( - this.innerApiCalls['queryDirectoryContents'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists CompilationResults in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCompilationResultsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCompilationResults( - request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResult[], - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest|null, - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse - ]>; - listCompilationResults( - request: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResult>): void; - listCompilationResults( - request: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResult>): void; - listCompilationResults( - request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResult>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResult>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResult[], - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest|null, - protos.google.cloud.dataform.v1alpha2.IListCompilationResultsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listCompilationResults(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCompilationResultsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCompilationResultsStream( - request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCompilationResults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCompilationResults.createStream( - this.innerApiCalls.listCompilationResults as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCompilationResults`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CompilationResult]{@link google.cloud.dataform.v1alpha2.CompilationResult}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.list_compilation_results.js - * region_tag:dataform_v1alpha2_generated_Dataform_ListCompilationResults_async - */ - listCompilationResultsAsync( - request?: protos.google.cloud.dataform.v1alpha2.IListCompilationResultsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCompilationResults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCompilationResults.asyncIterate( - this.innerApiCalls['listCompilationResults'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns CompilationResultActions in a given CompilationResult. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.filter] - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CompilationResultAction]{@link google.cloud.dataform.v1alpha2.CompilationResultAction}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `queryCompilationResultActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryCompilationResultActions( - request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[], - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest|null, - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse - ]>; - queryCompilationResultActions( - request: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>): void; - queryCompilationResultActions( - request: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>): void; - queryCompilationResultActions( - request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.ICompilationResultAction>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[], - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest|null, - protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.queryCompilationResultActions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.filter] - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CompilationResultAction]{@link google.cloud.dataform.v1alpha2.CompilationResultAction} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `queryCompilationResultActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryCompilationResultActionsStream( - request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryCompilationResultActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryCompilationResultActions.createStream( - this.innerApiCalls.queryCompilationResultActions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryCompilationResultActions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.filter] - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CompilationResultAction]{@link google.cloud.dataform.v1alpha2.CompilationResultAction}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.query_compilation_result_actions.js - * region_tag:dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async - */ - queryCompilationResultActionsAsync( - request?: protos.google.cloud.dataform.v1alpha2.IQueryCompilationResultActionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryCompilationResultActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryCompilationResultActions.asyncIterate( - this.innerApiCalls['queryCompilationResultActions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists WorkflowInvocations in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listWorkflowInvocationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkflowInvocations( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[], - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest|null, - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse - ]>; - listWorkflowInvocations( - request: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>): void; - listWorkflowInvocations( - request: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>): void; - listWorkflowInvocations( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[], - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest|null, - protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listWorkflowInvocations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listWorkflowInvocationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkflowInvocationsStream( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkflowInvocations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkflowInvocations.createStream( - this.innerApiCalls.listWorkflowInvocations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkflowInvocations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [WorkflowInvocation]{@link google.cloud.dataform.v1alpha2.WorkflowInvocation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.list_workflow_invocations.js - * region_tag:dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async - */ - listWorkflowInvocationsAsync( - request?: protos.google.cloud.dataform.v1alpha2.IListWorkflowInvocationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkflowInvocations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkflowInvocations.asyncIterate( - this.innerApiCalls['listWorkflowInvocations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns WorkflowInvocationActions in a given WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [WorkflowInvocationAction]{@link google.cloud.dataform.v1alpha2.WorkflowInvocationAction}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `queryWorkflowInvocationActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryWorkflowInvocationActions( - request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[], - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest|null, - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse - ]>; - queryWorkflowInvocationActions( - request: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>): void; - queryWorkflowInvocationActions( - request: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>): void; - queryWorkflowInvocationActions( - request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction>): - Promise<[ - protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[], - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest|null, - protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.queryWorkflowInvocationActions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [WorkflowInvocationAction]{@link google.cloud.dataform.v1alpha2.WorkflowInvocationAction} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `queryWorkflowInvocationActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryWorkflowInvocationActionsStream( - request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryWorkflowInvocationActions.createStream( - this.innerApiCalls.queryWorkflowInvocationActions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryWorkflowInvocationActions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [WorkflowInvocationAction]{@link google.cloud.dataform.v1alpha2.WorkflowInvocationAction}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js - * region_tag:dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async - */ - queryWorkflowInvocationActionsAsync( - request?: protos.google.cloud.dataform.v1alpha2.IQueryWorkflowInvocationActionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryWorkflowInvocationActions.asyncIterate( - this.innerApiCalls['queryWorkflowInvocationActions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * 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 {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * 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). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * 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 {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * 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). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified compilationResult resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @param {string} compilation_result - * @returns {string} Resource name string. - */ - compilationResultPath(project:string,location:string,repository:string,compilationResult:string) { - return this.pathTemplates.compilationResultPathTemplate.render({ - project: project, - location: location, - repository: repository, - compilation_result: compilationResult, - }); - } - - /** - * Parse the project from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).project; - } - - /** - * Parse the location from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).location; - } - - /** - * Parse the repository from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).repository; - } - - /** - * Parse the compilation_result from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the compilation_result. - */ - matchCompilationResultFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).compilation_result; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified repository resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @returns {string} Resource name string. - */ - repositoryPath(project:string,location:string,repository:string) { - return this.pathTemplates.repositoryPathTemplate.render({ - project: project, - location: location, - repository: repository, - }); - } - - /** - * Parse the project from Repository resource. - * - * @param {string} repositoryName - * A fully-qualified path representing Repository resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRepositoryName(repositoryName: string) { - return this.pathTemplates.repositoryPathTemplate.match(repositoryName).project; - } - - /** - * Parse the location from Repository resource. - * - * @param {string} repositoryName - * A fully-qualified path representing Repository resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRepositoryName(repositoryName: string) { - return this.pathTemplates.repositoryPathTemplate.match(repositoryName).location; - } - - /** - * Parse the repository from Repository resource. - * - * @param {string} repositoryName - * A fully-qualified path representing Repository resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromRepositoryName(repositoryName: string) { - return this.pathTemplates.repositoryPathTemplate.match(repositoryName).repository; - } - - /** - * Return a fully-qualified workflowInvocation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @param {string} workflow_invocation - * @returns {string} Resource name string. - */ - workflowInvocationPath(project:string,location:string,repository:string,workflowInvocation:string) { - return this.pathTemplates.workflowInvocationPathTemplate.render({ - project: project, - location: location, - repository: repository, - workflow_invocation: workflowInvocation, - }); - } - - /** - * Parse the project from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).project; - } - - /** - * Parse the location from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).location; - } - - /** - * Parse the repository from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).repository; - } - - /** - * Parse the workflow_invocation from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the workflow_invocation. - */ - matchWorkflowInvocationFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).workflow_invocation; - } - - /** - * Return a fully-qualified workspace resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @param {string} workspace - * @returns {string} Resource name string. - */ - workspacePath(project:string,location:string,repository:string,workspace:string) { - return this.pathTemplates.workspacePathTemplate.render({ - project: project, - location: location, - repository: repository, - workspace: workspace, - }); - } - - /** - * Parse the project from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).project; - } - - /** - * Parse the location from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).location; - } - - /** - * Parse the repository from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).repository; - } - - /** - * Parse the workspace from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the workspace. - */ - matchWorkspaceFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).workspace; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.dataformStub && !this._terminated) { - return this.dataformStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json deleted file mode 100644 index b52dc9c..0000000 --- a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_client_config.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataform.v1alpha2.Dataform": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListRepositories": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchRemoteBranches": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListWorkspaces": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetWorkspace": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateWorkspace": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteWorkspace": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InstallNpmPackages": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PullGitCommits": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PushGitCommits": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchFileGitStatuses": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchGitAheadBehind": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CommitWorkspaceChanges": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResetWorkspaceChanges": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchFileDiff": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryDirectoryContents": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MakeDirectory": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveDirectory": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MoveDirectory": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MoveFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "WriteFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListCompilationResults": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetCompilationResult": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateCompilationResult": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryCompilationResultActions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListWorkflowInvocations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryWorkflowInvocationActions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json b/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json deleted file mode 100644 index 78309dc..0000000 --- a/owl-bot-staging/v1alpha2/src/v1alpha2/dataform_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/cloud/dataform/v1alpha2/dataform.proto" -] diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json b/owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json deleted file mode 100644 index d0c680b..0000000 --- a/owl-bot-staging/v1alpha2/src/v1alpha2/gapic_metadata.json +++ /dev/null @@ -1,411 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.dataform.v1alpha2", - "libraryPackage": "@google-cloud/dataform", - "services": { - "Dataform": { - "clients": { - "grpc": { - "libraryClient": "DataformClient", - "rpcs": { - "GetRepository": { - "methods": [ - "getRepository" - ] - }, - "CreateRepository": { - "methods": [ - "createRepository" - ] - }, - "UpdateRepository": { - "methods": [ - "updateRepository" - ] - }, - "DeleteRepository": { - "methods": [ - "deleteRepository" - ] - }, - "FetchRemoteBranches": { - "methods": [ - "fetchRemoteBranches" - ] - }, - "GetWorkspace": { - "methods": [ - "getWorkspace" - ] - }, - "CreateWorkspace": { - "methods": [ - "createWorkspace" - ] - }, - "DeleteWorkspace": { - "methods": [ - "deleteWorkspace" - ] - }, - "InstallNpmPackages": { - "methods": [ - "installNpmPackages" - ] - }, - "PullGitCommits": { - "methods": [ - "pullGitCommits" - ] - }, - "PushGitCommits": { - "methods": [ - "pushGitCommits" - ] - }, - "FetchFileGitStatuses": { - "methods": [ - "fetchFileGitStatuses" - ] - }, - "FetchGitAheadBehind": { - "methods": [ - "fetchGitAheadBehind" - ] - }, - "CommitWorkspaceChanges": { - "methods": [ - "commitWorkspaceChanges" - ] - }, - "ResetWorkspaceChanges": { - "methods": [ - "resetWorkspaceChanges" - ] - }, - "FetchFileDiff": { - "methods": [ - "fetchFileDiff" - ] - }, - "MakeDirectory": { - "methods": [ - "makeDirectory" - ] - }, - "RemoveDirectory": { - "methods": [ - "removeDirectory" - ] - }, - "MoveDirectory": { - "methods": [ - "moveDirectory" - ] - }, - "ReadFile": { - "methods": [ - "readFile" - ] - }, - "RemoveFile": { - "methods": [ - "removeFile" - ] - }, - "MoveFile": { - "methods": [ - "moveFile" - ] - }, - "WriteFile": { - "methods": [ - "writeFile" - ] - }, - "GetCompilationResult": { - "methods": [ - "getCompilationResult" - ] - }, - "CreateCompilationResult": { - "methods": [ - "createCompilationResult" - ] - }, - "GetWorkflowInvocation": { - "methods": [ - "getWorkflowInvocation" - ] - }, - "CreateWorkflowInvocation": { - "methods": [ - "createWorkflowInvocation" - ] - }, - "DeleteWorkflowInvocation": { - "methods": [ - "deleteWorkflowInvocation" - ] - }, - "CancelWorkflowInvocation": { - "methods": [ - "cancelWorkflowInvocation" - ] - }, - "ListRepositories": { - "methods": [ - "listRepositories", - "listRepositoriesStream", - "listRepositoriesAsync" - ] - }, - "ListWorkspaces": { - "methods": [ - "listWorkspaces", - "listWorkspacesStream", - "listWorkspacesAsync" - ] - }, - "QueryDirectoryContents": { - "methods": [ - "queryDirectoryContents", - "queryDirectoryContentsStream", - "queryDirectoryContentsAsync" - ] - }, - "ListCompilationResults": { - "methods": [ - "listCompilationResults", - "listCompilationResultsStream", - "listCompilationResultsAsync" - ] - }, - "QueryCompilationResultActions": { - "methods": [ - "queryCompilationResultActions", - "queryCompilationResultActionsStream", - "queryCompilationResultActionsAsync" - ] - }, - "ListWorkflowInvocations": { - "methods": [ - "listWorkflowInvocations", - "listWorkflowInvocationsStream", - "listWorkflowInvocationsAsync" - ] - }, - "QueryWorkflowInvocationActions": { - "methods": [ - "queryWorkflowInvocationActions", - "queryWorkflowInvocationActionsStream", - "queryWorkflowInvocationActionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DataformClient", - "rpcs": { - "GetRepository": { - "methods": [ - "getRepository" - ] - }, - "CreateRepository": { - "methods": [ - "createRepository" - ] - }, - "UpdateRepository": { - "methods": [ - "updateRepository" - ] - }, - "DeleteRepository": { - "methods": [ - "deleteRepository" - ] - }, - "FetchRemoteBranches": { - "methods": [ - "fetchRemoteBranches" - ] - }, - "GetWorkspace": { - "methods": [ - "getWorkspace" - ] - }, - "CreateWorkspace": { - "methods": [ - "createWorkspace" - ] - }, - "DeleteWorkspace": { - "methods": [ - "deleteWorkspace" - ] - }, - "InstallNpmPackages": { - "methods": [ - "installNpmPackages" - ] - }, - "PullGitCommits": { - "methods": [ - "pullGitCommits" - ] - }, - "PushGitCommits": { - "methods": [ - "pushGitCommits" - ] - }, - "FetchFileGitStatuses": { - "methods": [ - "fetchFileGitStatuses" - ] - }, - "FetchGitAheadBehind": { - "methods": [ - "fetchGitAheadBehind" - ] - }, - "CommitWorkspaceChanges": { - "methods": [ - "commitWorkspaceChanges" - ] - }, - "ResetWorkspaceChanges": { - "methods": [ - "resetWorkspaceChanges" - ] - }, - "FetchFileDiff": { - "methods": [ - "fetchFileDiff" - ] - }, - "MakeDirectory": { - "methods": [ - "makeDirectory" - ] - }, - "RemoveDirectory": { - "methods": [ - "removeDirectory" - ] - }, - "MoveDirectory": { - "methods": [ - "moveDirectory" - ] - }, - "ReadFile": { - "methods": [ - "readFile" - ] - }, - "RemoveFile": { - "methods": [ - "removeFile" - ] - }, - "MoveFile": { - "methods": [ - "moveFile" - ] - }, - "WriteFile": { - "methods": [ - "writeFile" - ] - }, - "GetCompilationResult": { - "methods": [ - "getCompilationResult" - ] - }, - "CreateCompilationResult": { - "methods": [ - "createCompilationResult" - ] - }, - "GetWorkflowInvocation": { - "methods": [ - "getWorkflowInvocation" - ] - }, - "CreateWorkflowInvocation": { - "methods": [ - "createWorkflowInvocation" - ] - }, - "DeleteWorkflowInvocation": { - "methods": [ - "deleteWorkflowInvocation" - ] - }, - "CancelWorkflowInvocation": { - "methods": [ - "cancelWorkflowInvocation" - ] - }, - "ListRepositories": { - "methods": [ - "listRepositories", - "listRepositoriesStream", - "listRepositoriesAsync" - ] - }, - "ListWorkspaces": { - "methods": [ - "listWorkspaces", - "listWorkspacesStream", - "listWorkspacesAsync" - ] - }, - "QueryDirectoryContents": { - "methods": [ - "queryDirectoryContents", - "queryDirectoryContentsStream", - "queryDirectoryContentsAsync" - ] - }, - "ListCompilationResults": { - "methods": [ - "listCompilationResults", - "listCompilationResultsStream", - "listCompilationResultsAsync" - ] - }, - "QueryCompilationResultActions": { - "methods": [ - "queryCompilationResultActions", - "queryCompilationResultActionsStream", - "queryCompilationResultActionsAsync" - ] - }, - "ListWorkflowInvocations": { - "methods": [ - "listWorkflowInvocations", - "listWorkflowInvocationsStream", - "listWorkflowInvocationsAsync" - ] - }, - "QueryWorkflowInvocationActions": { - "methods": [ - "queryWorkflowInvocationActions", - "queryWorkflowInvocationActionsStream", - "queryWorkflowInvocationActionsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1alpha2/src/v1alpha2/index.ts b/owl-bot-staging/v1alpha2/src/v1alpha2/index.ts deleted file mode 100644 index a1e4487..0000000 --- a/owl-bot-staging/v1alpha2/src/v1alpha2/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DataformClient} from './dataform_client'; diff --git a/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 5955dff..0000000 --- a/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const dataform = require('@google-cloud/dataform'); - -function main() { - const dataformClient = new dataform.DataformClient(); -} - -main(); diff --git a/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 3f49bdd..0000000 --- a/owl-bot-staging/v1alpha2/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {DataformClient} from '@google-cloud/dataform'; - -// check that the client class type name can be used -function doStuffWithDataformClient(client: DataformClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const dataformClient = new DataformClient(); - doStuffWithDataformClient(dataformClient); -} - -main(); diff --git a/owl-bot-staging/v1alpha2/system-test/install.ts b/owl-bot-staging/v1alpha2/system-test/install.ts deleted file mode 100644 index 557a575..0000000 --- a/owl-bot-staging/v1alpha2/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts b/owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts deleted file mode 100644 index b2edea7..0000000 --- a/owl-bot-staging/v1alpha2/test/gapic_dataform_v1alpha2.ts +++ /dev/null @@ -1,5251 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as dataformModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1alpha2.DataformClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = dataformModule.v1alpha2.DataformClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = dataformModule.v1alpha2.DataformClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = dataformModule.v1alpha2.DataformClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new dataformModule.v1alpha2.DataformClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new dataformModule.v1alpha2.DataformClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataformStub, undefined); - await client.initialize(); - assert(client.dataformStub); - }); - - it('has close method for the initialized client', done => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.dataformStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataformStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getRepository', () => { - it('invokes getRepository without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); - client.innerApiCalls.getRepository = stubSimpleCall(expectedResponse); - const [response] = await client.getRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getRepository without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); - client.innerApiCalls.getRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRepository( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getRepository with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRepository(request), expectedError); - assert((client.innerApiCalls.getRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getRepository with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetRepositoryRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getRepository(request), expectedError); - }); - }); - - describe('createRepository', () => { - it('invokes createRepository without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); - client.innerApiCalls.createRepository = stubSimpleCall(expectedResponse); - const [response] = await client.createRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createRepository without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); - client.innerApiCalls.createRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createRepository( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createRepository with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createRepository(request), expectedError); - assert((client.innerApiCalls.createRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createRepository with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateRepositoryRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createRepository(request), expectedError); - }); - }); - - describe('updateRepository', () => { - it('invokes updateRepository without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedHeaderRequestParams = "repository.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); - client.innerApiCalls.updateRepository = stubSimpleCall(expectedResponse); - const [response] = await client.updateRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateRepository without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedHeaderRequestParams = "repository.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()); - client.innerApiCalls.updateRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateRepository( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateRepository with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedHeaderRequestParams = "repository.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateRepository(request), expectedError); - assert((client.innerApiCalls.updateRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateRepository with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateRepository(request), expectedError); - }); - }); - - describe('deleteRepository', () => { - it('invokes deleteRepository without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteRepository = stubSimpleCall(expectedResponse); - const [response] = await client.deleteRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteRepository without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRepository( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteRepository with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteRepository(request), expectedError); - assert((client.innerApiCalls.deleteRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteRepository with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteRepositoryRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteRepository(request), expectedError); - }); - }); - - describe('fetchRemoteBranches', () => { - it('invokes fetchRemoteBranches without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse()); - client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(expectedResponse); - const [response] = await client.fetchRemoteBranches(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchRemoteBranches without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesResponse()); - client.innerApiCalls.fetchRemoteBranches = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchRemoteBranches( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchRemoteBranchesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchRemoteBranches with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchRemoteBranches(request), expectedError); - assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchRemoteBranches with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchRemoteBranches(request), expectedError); - }); - }); - - describe('getWorkspace', () => { - it('invokes getWorkspace without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); - client.innerApiCalls.getWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkspace without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); - client.innerApiCalls.getWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkspace( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkspace|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getWorkspace with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkspace(request), expectedError); - assert((client.innerApiCalls.getWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkspace with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkspaceRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getWorkspace(request), expectedError); - }); - }); - - describe('createWorkspace', () => { - it('invokes createWorkspace without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); - client.innerApiCalls.createWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.createWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkspace without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()); - client.innerApiCalls.createWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkspace( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkspace|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createWorkspace with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createWorkspace(request), expectedError); - assert((client.innerApiCalls.createWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkspace with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkspaceRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createWorkspace(request), expectedError); - }); - }); - - describe('deleteWorkspace', () => { - it('invokes deleteWorkspace without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkspace without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkspace( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteWorkspace with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteWorkspace(request), expectedError); - assert((client.innerApiCalls.deleteWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkspace with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkspaceRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteWorkspace(request), expectedError); - }); - }); - - describe('installNpmPackages', () => { - it('invokes installNpmPackages without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse()); - client.innerApiCalls.installNpmPackages = stubSimpleCall(expectedResponse); - const [response] = await client.installNpmPackages(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.installNpmPackages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes installNpmPackages without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesResponse()); - client.innerApiCalls.installNpmPackages = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.installNpmPackages( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IInstallNpmPackagesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.installNpmPackages as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes installNpmPackages with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.installNpmPackages = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.installNpmPackages(request), expectedError); - assert((client.innerApiCalls.installNpmPackages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes installNpmPackages with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.installNpmPackages(request), expectedError); - }); - }); - - describe('pullGitCommits', () => { - it('invokes pullGitCommits without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pullGitCommits = stubSimpleCall(expectedResponse); - const [response] = await client.pullGitCommits(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pullGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pullGitCommits without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pullGitCommits = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pullGitCommits( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pullGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pullGitCommits with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pullGitCommits = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pullGitCommits(request), expectedError); - assert((client.innerApiCalls.pullGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pullGitCommits with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PullGitCommitsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pullGitCommits(request), expectedError); - }); - }); - - describe('pushGitCommits', () => { - it('invokes pushGitCommits without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pushGitCommits = stubSimpleCall(expectedResponse); - const [response] = await client.pushGitCommits(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pushGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pushGitCommits without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pushGitCommits = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pushGitCommits( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pushGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pushGitCommits with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pushGitCommits = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pushGitCommits(request), expectedError); - assert((client.innerApiCalls.pushGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pushGitCommits with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.PushGitCommitsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pushGitCommits(request), expectedError); - }); - }); - - describe('fetchFileGitStatuses', () => { - it('invokes fetchFileGitStatuses without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse()); - client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(expectedResponse); - const [response] = await client.fetchFileGitStatuses(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileGitStatuses without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesResponse()); - client.innerApiCalls.fetchFileGitStatuses = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchFileGitStatuses( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchFileGitStatusesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchFileGitStatuses with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchFileGitStatuses(request), expectedError); - assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileGitStatuses with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchFileGitStatuses(request), expectedError); - }); - }); - - describe('fetchGitAheadBehind', () => { - it('invokes fetchGitAheadBehind without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse()); - client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(expectedResponse); - const [response] = await client.fetchGitAheadBehind(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchGitAheadBehind without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindResponse()); - client.innerApiCalls.fetchGitAheadBehind = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchGitAheadBehind( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchGitAheadBehindResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchGitAheadBehind with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchGitAheadBehind(request), expectedError); - assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchGitAheadBehind with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchGitAheadBehind(request), expectedError); - }); - }); - - describe('commitWorkspaceChanges', () => { - it('invokes commitWorkspaceChanges without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(expectedResponse); - const [response] = await client.commitWorkspaceChanges(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes commitWorkspaceChanges without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.commitWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commitWorkspaceChanges( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes commitWorkspaceChanges with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commitWorkspaceChanges(request), expectedError); - assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes commitWorkspaceChanges with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.commitWorkspaceChanges(request), expectedError); - }); - }); - - describe('resetWorkspaceChanges', () => { - it('invokes resetWorkspaceChanges without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(expectedResponse); - const [response] = await client.resetWorkspaceChanges(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resetWorkspaceChanges without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resetWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resetWorkspaceChanges( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes resetWorkspaceChanges with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resetWorkspaceChanges(request), expectedError); - assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resetWorkspaceChanges with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resetWorkspaceChanges(request), expectedError); - }); - }); - - describe('fetchFileDiff', () => { - it('invokes fetchFileDiff without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffResponse()); - client.innerApiCalls.fetchFileDiff = stubSimpleCall(expectedResponse); - const [response] = await client.fetchFileDiff(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileDiff as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileDiff without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffResponse()); - client.innerApiCalls.fetchFileDiff = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchFileDiff( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IFetchFileDiffResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileDiff as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchFileDiff with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchFileDiff = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchFileDiff(request), expectedError); - assert((client.innerApiCalls.fetchFileDiff as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileDiff with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.FetchFileDiffRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchFileDiff(request), expectedError); - }); - }); - - describe('makeDirectory', () => { - it('invokes makeDirectory without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryResponse()); - client.innerApiCalls.makeDirectory = stubSimpleCall(expectedResponse); - const [response] = await client.makeDirectory(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.makeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes makeDirectory without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryResponse()); - client.innerApiCalls.makeDirectory = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.makeDirectory( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IMakeDirectoryResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.makeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes makeDirectory with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.makeDirectory = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.makeDirectory(request), expectedError); - assert((client.innerApiCalls.makeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes makeDirectory with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MakeDirectoryRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.makeDirectory(request), expectedError); - }); - }); - - describe('removeDirectory', () => { - it('invokes removeDirectory without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeDirectory = stubSimpleCall(expectedResponse); - const [response] = await client.removeDirectory(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeDirectory without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeDirectory = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeDirectory( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeDirectory with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeDirectory = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeDirectory(request), expectedError); - assert((client.innerApiCalls.removeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeDirectory with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeDirectory(request), expectedError); - }); - }); - - describe('moveDirectory', () => { - it('invokes moveDirectory without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryResponse()); - client.innerApiCalls.moveDirectory = stubSimpleCall(expectedResponse); - const [response] = await client.moveDirectory(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveDirectory without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryResponse()); - client.innerApiCalls.moveDirectory = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.moveDirectory( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IMoveDirectoryResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes moveDirectory with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.moveDirectory = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.moveDirectory(request), expectedError); - assert((client.innerApiCalls.moveDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveDirectory with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveDirectoryRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.moveDirectory(request), expectedError); - }); - }); - - describe('readFile', () => { - it('invokes readFile without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileResponse()); - client.innerApiCalls.readFile = stubSimpleCall(expectedResponse); - const [response] = await client.readFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFile without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileResponse()); - client.innerApiCalls.readFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readFile( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IReadFileResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes readFile with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readFile(request), expectedError); - assert((client.innerApiCalls.readFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFile with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ReadFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readFile(request), expectedError); - }); - }); - - describe('removeFile', () => { - it('invokes removeFile without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeFile = stubSimpleCall(expectedResponse); - const [response] = await client.removeFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeFile without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeFile( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeFile with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeFile(request), expectedError); - assert((client.innerApiCalls.removeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeFile with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.RemoveFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeFile(request), expectedError); - }); - }); - - describe('moveFile', () => { - it('invokes moveFile without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileResponse()); - client.innerApiCalls.moveFile = stubSimpleCall(expectedResponse); - const [response] = await client.moveFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveFile without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileResponse()); - client.innerApiCalls.moveFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.moveFile( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IMoveFileResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes moveFile with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.moveFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.moveFile(request), expectedError); - assert((client.innerApiCalls.moveFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveFile with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.MoveFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.moveFile(request), expectedError); - }); - }); - - describe('writeFile', () => { - it('invokes writeFile without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileResponse()); - client.innerApiCalls.writeFile = stubSimpleCall(expectedResponse); - const [response] = await client.writeFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeFile without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileResponse()); - client.innerApiCalls.writeFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeFile( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWriteFileResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes writeFile with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.writeFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeFile(request), expectedError); - assert((client.innerApiCalls.writeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeFile with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WriteFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeFile(request), expectedError); - }); - }); - - describe('getCompilationResult', () => { - it('invokes getCompilationResult without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); - client.innerApiCalls.getCompilationResult = stubSimpleCall(expectedResponse); - const [response] = await client.getCompilationResult(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCompilationResult without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); - client.innerApiCalls.getCompilationResult = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCompilationResult( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResult|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getCompilationResult with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getCompilationResult = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCompilationResult(request), expectedError); - assert((client.innerApiCalls.getCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCompilationResult with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetCompilationResultRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCompilationResult(request), expectedError); - }); - }); - - describe('createCompilationResult', () => { - it('invokes createCompilationResult without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); - client.innerApiCalls.createCompilationResult = stubSimpleCall(expectedResponse); - const [response] = await client.createCompilationResult(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCompilationResult without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()); - client.innerApiCalls.createCompilationResult = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCompilationResult( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResult|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createCompilationResult with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createCompilationResult = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCompilationResult(request), expectedError); - assert((client.innerApiCalls.createCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCompilationResult with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateCompilationResultRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCompilationResult(request), expectedError); - }); - }); - - describe('getWorkflowInvocation', () => { - it('invokes getWorkflowInvocation without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); - client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); - client.innerApiCalls.getWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getWorkflowInvocation with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getWorkflowInvocation(request), expectedError); - }); - }); - - describe('createWorkflowInvocation', () => { - it('invokes createWorkflowInvocation without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); - client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.createWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()); - client.innerApiCalls.createWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createWorkflowInvocation with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createWorkflowInvocation(request), expectedError); - }); - }); - - describe('deleteWorkflowInvocation', () => { - it('invokes deleteWorkflowInvocation without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteWorkflowInvocation with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); - }); - }); - - describe('cancelWorkflowInvocation', () => { - it('invokes cancelWorkflowInvocation without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.cancelWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelWorkflowInvocation with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); - }); - }); - - describe('listRepositories', () => { - it('invokes listRepositories without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - ]; - client.innerApiCalls.listRepositories = stubSimpleCall(expectedResponse); - const [response] = await client.listRepositories(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listRepositories as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listRepositories without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - ]; - client.innerApiCalls.listRepositories = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRepositories( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IRepository[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listRepositories as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listRepositories with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listRepositories = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRepositories(request), expectedError); - assert((client.innerApiCalls.listRepositories as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listRepositoriesStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - ]; - client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRepositoriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.Repository[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Repository) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); - assert.strictEqual( - (client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listRepositoriesStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRepositoriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.Repository[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Repository) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); - assert.strictEqual( - (client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listRepositories without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Repository()), - ]; - client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.IRepository[] = []; - const iterable = client.listRepositoriesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listRepositories with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRepositoriesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.IRepository[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listWorkspaces', () => { - it('invokes listWorkspaces without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - ]; - client.innerApiCalls.listWorkspaces = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkspaces(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkspaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkspaces without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - ]; - client.innerApiCalls.listWorkspaces = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkspaces( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkspace[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkspaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listWorkspaces with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkspaces = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkspaces(request), expectedError); - assert((client.innerApiCalls.listWorkspaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkspacesStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - ]; - client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkspacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.Workspace[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Workspace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listWorkspacesStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkspacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.Workspace[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.Workspace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkspaces without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.Workspace()), - ]; - client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.IWorkspace[] = []; - const iterable = client.listWorkspacesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkspaces with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkspacesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.IWorkspace[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('queryDirectoryContents', () => { - it('invokes queryDirectoryContents without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.innerApiCalls.queryDirectoryContents = stubSimpleCall(expectedResponse); - const [response] = await client.queryDirectoryContents(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryDirectoryContents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryDirectoryContents without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.innerApiCalls.queryDirectoryContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryDirectoryContents( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryDirectoryContents as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryDirectoryContents with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryDirectoryContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryDirectoryContents(request), expectedError); - assert((client.innerApiCalls.queryDirectoryContents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryDirectoryContentsStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryDirectoryContentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes queryDirectoryContentsStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedError = new Error('expected'); - client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryDirectoryContentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryDirectoryContents without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; - const iterable = client.queryDirectoryContentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryDirectoryContents with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace=";const expectedError = new Error('expected'); - client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryDirectoryContentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listCompilationResults', () => { - it('invokes listCompilationResults without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - ]; - client.innerApiCalls.listCompilationResults = stubSimpleCall(expectedResponse); - const [response] = await client.listCompilationResults(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCompilationResults as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCompilationResults without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - ]; - client.innerApiCalls.listCompilationResults = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCompilationResults( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResult[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCompilationResults as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listCompilationResults with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listCompilationResults = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCompilationResults(request), expectedError); - assert((client.innerApiCalls.listCompilationResults as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCompilationResultsStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - ]; - client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCompilationResultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.CompilationResult[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listCompilationResultsStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCompilationResultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.CompilationResult[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCompilationResults without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResult()), - ]; - client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResult[] = []; - const iterable = client.listCompilationResultsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCompilationResults with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCompilationResultsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResult[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('queryCompilationResultActions', () => { - it('invokes queryCompilationResultActions without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - ]; - client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(expectedResponse); - const [response] = await client.queryCompilationResultActions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryCompilationResultActions without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - ]; - client.innerApiCalls.queryCompilationResultActions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryCompilationResultActions( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryCompilationResultActions with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryCompilationResultActions(request), expectedError); - assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryCompilationResultActionsStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - ]; - client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryCompilationResultActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.CompilationResultAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResultAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes queryCompilationResultActionsStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedError = new Error('expected'); - client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryCompilationResultActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.CompilationResultAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.CompilationResultAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryCompilationResultActions without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.CompilationResultAction()), - ]; - client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[] = []; - const iterable = client.queryCompilationResultActionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryCompilationResultActions with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); - client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryCompilationResultActionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.ICompilationResultAction[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listWorkflowInvocations', () => { - it('invokes listWorkflowInvocations without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - ]; - client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkflowInvocations(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkflowInvocations without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - ]; - client.innerApiCalls.listWorkflowInvocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkflowInvocations( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listWorkflowInvocations with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkflowInvocations(request), expectedError); - assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkflowInvocationsStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - ]; - client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkflowInvocationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listWorkflowInvocationsStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkflowInvocationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkflowInvocations without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocation()), - ]; - client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[] = []; - const iterable = client.listWorkflowInvocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkflowInvocations with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkflowInvocationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('queryWorkflowInvocationActions', () => { - it('invokes queryWorkflowInvocationActions without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - ]; - client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(expectedResponse); - const [response] = await client.queryWorkflowInvocationActions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryWorkflowInvocationActions without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - ]; - client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryWorkflowInvocationActions( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryWorkflowInvocationActions with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryWorkflowInvocationActions(request), expectedError); - assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryWorkflowInvocationActionsStream without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - ]; - client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryWorkflowInvocationActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes queryWorkflowInvocationActionsStream with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedError = new Error('expected'); - client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryWorkflowInvocationActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryWorkflowInvocationActions without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.WorkflowInvocationAction()), - ]; - client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[] = []; - const iterable = client.queryWorkflowInvocationActionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryWorkflowInvocationActions with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1alpha2.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); - client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryWorkflowInvocationActionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1alpha2.IWorkflowInvocationAction[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('compilationResult', () => { - const fakePath = "/rendered/path/compilationResult"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - compilation_result: "compilationResultValue", - }; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.compilationResultPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.compilationResultPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('compilationResultPath', () => { - const result = client.compilationResultPath("projectValue", "locationValue", "repositoryValue", "compilationResultValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.compilationResultPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCompilationResultName', () => { - const result = client.matchProjectFromCompilationResultName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCompilationResultName', () => { - const result = client.matchLocationFromCompilationResultName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromCompilationResultName', () => { - const result = client.matchRepositoryFromCompilationResultName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCompilationResultFromCompilationResultName', () => { - const result = client.matchCompilationResultFromCompilationResultName(fakePath); - assert.strictEqual(result, "compilationResultValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('repository', () => { - const fakePath = "/rendered/path/repository"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - }; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.repositoryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.repositoryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('repositoryPath', () => { - const result = client.repositoryPath("projectValue", "locationValue", "repositoryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.repositoryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRepositoryName', () => { - const result = client.matchProjectFromRepositoryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRepositoryName', () => { - const result = client.matchLocationFromRepositoryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromRepositoryName', () => { - const result = client.matchRepositoryFromRepositoryName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('workflowInvocation', () => { - const fakePath = "/rendered/path/workflowInvocation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - workflow_invocation: "workflowInvocationValue", - }; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.workflowInvocationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workflowInvocationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workflowInvocationPath', () => { - const result = client.workflowInvocationPath("projectValue", "locationValue", "repositoryValue", "workflowInvocationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workflowInvocationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkflowInvocationName', () => { - const result = client.matchProjectFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkflowInvocationName', () => { - const result = client.matchLocationFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromWorkflowInvocationName', () => { - const result = client.matchRepositoryFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowInvocationFromWorkflowInvocationName', () => { - const result = client.matchWorkflowInvocationFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "workflowInvocationValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('workspace', () => { - const fakePath = "/rendered/path/workspace"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - workspace: "workspaceValue", - }; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.workspacePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workspacePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workspacePath', () => { - const result = client.workspacePath("projectValue", "locationValue", "repositoryValue", "workspaceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workspacePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkspaceName', () => { - const result = client.matchProjectFromWorkspaceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkspaceName', () => { - const result = client.matchLocationFromWorkspaceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromWorkspaceName', () => { - const result = client.matchRepositoryFromWorkspaceName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkspaceFromWorkspaceName', () => { - const result = client.matchWorkspaceFromWorkspaceName(fakePath); - assert.strictEqual(result, "workspaceValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1alpha2/tsconfig.json b/owl-bot-staging/v1alpha2/tsconfig.json deleted file mode 100644 index c78f1c8..0000000 --- a/owl-bot-staging/v1alpha2/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1alpha2/webpack.config.js b/owl-bot-staging/v1alpha2/webpack.config.js deleted file mode 100644 index b2259ed..0000000 --- a/owl-bot-staging/v1alpha2/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'Dataform', - filename: './dataform.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/v1beta1/.eslintignore b/owl-bot-staging/v1beta1/.eslintignore deleted file mode 100644 index cfc348e..0000000 --- a/owl-bot-staging/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/owl-bot-staging/v1beta1/.eslintrc.json b/owl-bot-staging/v1beta1/.eslintrc.json deleted file mode 100644 index 7821534..0000000 --- a/owl-bot-staging/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1beta1/.gitignore b/owl-bot-staging/v1beta1/.gitignore deleted file mode 100644 index 5d32b23..0000000 --- a/owl-bot-staging/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1beta1/.jsdoc.js b/owl-bot-staging/v1beta1/.jsdoc.js deleted file mode 100644 index 166ea79..0000000 --- a/owl-bot-staging/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2022 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/dataform', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1beta1/.mocharc.js b/owl-bot-staging/v1beta1/.mocharc.js deleted file mode 100644 index 481c522..0000000 --- a/owl-bot-staging/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1beta1/.prettierrc.js b/owl-bot-staging/v1beta1/.prettierrc.js deleted file mode 100644 index 494e147..0000000 --- a/owl-bot-staging/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1beta1/README.md b/owl-bot-staging/v1beta1/README.md deleted file mode 100644 index cd744d1..0000000 --- a/owl-bot-staging/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Dataform: Nodejs Client diff --git a/owl-bot-staging/v1beta1/linkinator.config.json b/owl-bot-staging/v1beta1/linkinator.config.json deleted file mode 100644 index befd23c..0000000 --- a/owl-bot-staging/v1beta1/linkinator.config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io", - "https://console.cloud.google.com/cloudshell", - "https://support.google.com" - ], - "silent": true, - "concurrency": 5, - "retry": true, - "retryErrors": true, - "retryErrorsCount": 5, - "retryErrorsJitter": 3000 -} diff --git a/owl-bot-staging/v1beta1/package.json b/owl-bot-staging/v1beta1/package.json deleted file mode 100644 index 8b0851c..0000000 --- a/owl-bot-staging/v1beta1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/dataform", - "version": "0.1.0", - "description": "Dataform client for Node.js", - "repository": "googleapis/nodejs-dataform", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google dataform", - "dataform", - "dataform" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^3.2.0" - }, - "devDependencies": { - "@types/mocha": "^9.1.1", - "@types/node": "^16.11.50", - "@types/sinon": "^10.0.13", - "c8": "^7.12.0", - "gts": "^3.1.0", - "jsdoc": "^3.6.11", - "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.2", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^14.0.0", - "ts-loader": "^8.4.0", - "typescript": "^4.7.4", - "webpack": "^4.46.0", - "webpack-cli": "^4.10.0" - }, - "engines": { - "node": ">=v12" - } -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto b/owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto deleted file mode 100644 index 57d43c3..0000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/dataform/v1beta1/dataform.proto +++ /dev/null @@ -1,1629 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataform.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/type/interval.proto"; - -option csharp_namespace = "Google.Cloud.Dataform.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/dataform/v1beta1;dataform"; -option java_multiple_files = true; -option java_outer_classname = "DataformProto"; -option java_package = "com.google.cloud.dataform.v1beta1"; -option php_namespace = "Google\\Cloud\\Dataform\\V1beta1"; -option ruby_package = "Google::Cloud::Dataform::V1beta1"; -option (google.api.resource_definition) = { - type: "secretmanager.googleapis.com/SecretVersion" - pattern: "projects/{project}/secrets/{secret}/versions/{version}" -}; - -// Dataform is a service to develop, create, document, test, and update curated -// tables in BigQuery. -service Dataform { - option (google.api.default_host) = "dataform.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists Repositories in a given project and location. - rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/repositories" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single Repository. - rpc GetRepository(GetRepositoryRequest) returns (Repository) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Repository in a given project and location. - rpc CreateRepository(CreateRepositoryRequest) returns (Repository) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/repositories" - body: "repository" - }; - option (google.api.method_signature) = "parent,repository,repository_id"; - } - - // Updates a single Repository. - rpc UpdateRepository(UpdateRepositoryRequest) returns (Repository) { - option (google.api.http) = { - patch: "/v1beta1/{repository.name=projects/*/locations/*/repositories/*}" - body: "repository" - }; - option (google.api.method_signature) = "repository,update_mask"; - } - - // Deletes a single Repository. - rpc DeleteRepository(DeleteRepositoryRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/repositories/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Fetches a Repository's remote branches. - rpc FetchRemoteBranches(FetchRemoteBranchesRequest) returns (FetchRemoteBranchesResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*}:fetchRemoteBranches" - }; - } - - // Lists Workspaces in a given Repository. - rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single Workspace. - rpc GetWorkspace(GetWorkspaceRequest) returns (Workspace) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new Workspace in a given Repository. - rpc CreateWorkspace(CreateWorkspaceRequest) returns (Workspace) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workspaces" - body: "workspace" - }; - option (google.api.method_signature) = "parent,workspace,workspace_id"; - } - - // Deletes a single Workspace. - rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Installs dependency NPM packages (inside a Workspace). - rpc InstallNpmPackages(InstallNpmPackagesRequest) returns (InstallNpmPackagesResponse) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:installNpmPackages" - body: "*" - }; - } - - // Pulls Git commits from the Repository's remote into a Workspace. - rpc PullGitCommits(PullGitCommitsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:pull" - body: "*" - }; - } - - // Pushes Git commits from a Workspace to the Repository's remote. - rpc PushGitCommits(PushGitCommitsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:push" - body: "*" - }; - } - - // Fetches Git statuses for the files in a Workspace. - rpc FetchFileGitStatuses(FetchFileGitStatusesRequest) returns (FetchFileGitStatusesResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileGitStatuses" - }; - } - - // Fetches Git ahead/behind against a remote branch. - rpc FetchGitAheadBehind(FetchGitAheadBehindRequest) returns (FetchGitAheadBehindResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:fetchGitAheadBehind" - }; - } - - // Applies a Git commit for uncommitted files in a Workspace. - rpc CommitWorkspaceChanges(CommitWorkspaceChangesRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:commit" - body: "*" - }; - } - - // Performs a Git reset for uncommitted files in a Workspace. - rpc ResetWorkspaceChanges(ResetWorkspaceChangesRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workspaces/*}:reset" - body: "*" - }; - } - - // Fetches Git diff for an uncommitted file in a Workspace. - rpc FetchFileDiff(FetchFileDiffRequest) returns (FetchFileDiffResponse) { - option (google.api.http) = { - get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:fetchFileDiff" - }; - } - - // Returns the contents of a given Workspace directory. - rpc QueryDirectoryContents(QueryDirectoryContentsRequest) returns (QueryDirectoryContentsResponse) { - option (google.api.http) = { - get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:queryDirectoryContents" - }; - } - - // Creates a directory inside a Workspace. - rpc MakeDirectory(MakeDirectoryRequest) returns (MakeDirectoryResponse) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:makeDirectory" - body: "*" - }; - } - - // Deletes a directory (inside a Workspace) and all of its contents. - rpc RemoveDirectory(RemoveDirectoryRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeDirectory" - body: "*" - }; - } - - // Moves a directory (inside a Workspace), and all of its contents, to a new - // location. - rpc MoveDirectory(MoveDirectoryRequest) returns (MoveDirectoryResponse) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveDirectory" - body: "*" - }; - } - - // Returns the contents of a file (inside a Workspace). - rpc ReadFile(ReadFileRequest) returns (ReadFileResponse) { - option (google.api.http) = { - get: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile" - }; - } - - // Deletes a file (inside a Workspace). - rpc RemoveFile(RemoveFileRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:removeFile" - body: "*" - }; - } - - // Moves a file (inside a Workspace) to a new location. - rpc MoveFile(MoveFileRequest) returns (MoveFileResponse) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:moveFile" - body: "*" - }; - } - - // Writes to a file (inside a Workspace). - rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) { - option (google.api.http) = { - post: "/v1beta1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:writeFile" - body: "*" - }; - } - - // Lists CompilationResults in a given Repository. - rpc ListCompilationResults(ListCompilationResultsRequest) returns (ListCompilationResultsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single CompilationResult. - rpc GetCompilationResult(GetCompilationResultRequest) returns (CompilationResult) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new CompilationResult in a given project and location. - rpc CreateCompilationResult(CreateCompilationResultRequest) returns (CompilationResult) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/compilationResults" - body: "compilation_result" - }; - option (google.api.method_signature) = "parent,compilation_result"; - } - - // Returns CompilationResultActions in a given CompilationResult. - rpc QueryCompilationResultActions(QueryCompilationResultActionsRequest) returns (QueryCompilationResultActionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/compilationResults/*}:query" - }; - } - - // Lists WorkflowInvocations in a given Repository. - rpc ListWorkflowInvocations(ListWorkflowInvocationsRequest) returns (ListWorkflowInvocationsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetches a single WorkflowInvocation. - rpc GetWorkflowInvocation(GetWorkflowInvocationRequest) returns (WorkflowInvocation) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new WorkflowInvocation in a given Repository. - rpc CreateWorkflowInvocation(CreateWorkflowInvocationRequest) returns (WorkflowInvocation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/repositories/*}/workflowInvocations" - body: "workflow_invocation" - }; - option (google.api.method_signature) = "parent,workflow_invocation"; - } - - // Deletes a single WorkflowInvocation. - rpc DeleteWorkflowInvocation(DeleteWorkflowInvocationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Requests cancellation of a running WorkflowInvocation. - rpc CancelWorkflowInvocation(CancelWorkflowInvocationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:cancel" - body: "*" - }; - } - - // Returns WorkflowInvocationActions in a given WorkflowInvocation. - rpc QueryWorkflowInvocationActions(QueryWorkflowInvocationActionsRequest) returns (QueryWorkflowInvocationActionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/repositories/*/workflowInvocations/*}:query" - }; - } -} - -// Represents a Dataform Git repository. -message Repository { - option (google.api.resource) = { - type: "dataform.googleapis.com/Repository" - pattern: "projects/{project}/locations/{location}/repositories/{repository}" - }; - - // Controls Git remote configuration for a repository. - message GitRemoteSettings { - // Indicates the status of a Git authentication token. - enum TokenStatus { - // Default value. This value is unused. - TOKEN_STATUS_UNSPECIFIED = 0; - - // The token could not be found in Secret Manager (or the Dataform - // Service Account did not have permission to access it). - NOT_FOUND = 1; - - // The token could not be used to authenticate against the Git remote. - INVALID = 2; - - // The token was used successfully to authenticate against the Git remote. - VALID = 3; - } - - // Required. The Git remote's URL. - string url = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Git remote's default branch name. - string default_branch = 2 [(google.api.field_behavior) = REQUIRED]; - - // 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/*`. - string authentication_token_secret_version = 3 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "secretmanager.googleapis.com/SecretVersion" - } - ]; - - // Output only. Indicates the status of the Git access token. - TokenStatus token_status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The repository's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. If set, configures this repository to be linked to a Git remote. - GitRemoteSettings git_remote_settings = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListRepositories` request message. -message ListRepositoriesRequest { - // Required. The location in which to list repositories. Must be in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Optional. Maximum number of repositories to return. The server may return fewer - // items than requested. If unspecified, the server will pick an appropriate - // default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter for the returned list. - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListRepositories` response message. -message ListRepositoriesResponse { - // List of repositories. - repeated Repository repositories = 1; - - // A token which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetRepository` request message. -message GetRepositoryRequest { - // Required. The repository's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; -} - -// `CreateRepository` request message. -message CreateRepositoryRequest { - // Required. The location in which to create the repository. Must be in the format - // `projects/*/locations/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The repository to create. - Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the repository, which will become the final component of - // the repository's resource name. - string repository_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `UpdateRepository` request message. -message UpdateRepositoryRequest { - // Optional. Specifies the fields to be updated in the repository. If left unset, - // all fields will be updated. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The repository to update. - Repository repository = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `DeleteRepository` request message. -message DeleteRepositoryRequest { - // Required. The repository's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // 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.) - bool force = 2; -} - -// `FetchRemoteBranches` request message. -message FetchRemoteBranchesRequest { - // Required. The repository's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; -} - -// `FetchRemoteBranches` response message. -message FetchRemoteBranchesResponse { - // The remote repository's branch names. - repeated string branches = 1; -} - -// Represents a Dataform Git workspace. -message Workspace { - option (google.api.resource) = { - type: "dataform.googleapis.com/Workspace" - pattern: "projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}" - }; - - // Output only. The workspace's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `ListWorkspaces` request message. -message ListWorkspacesRequest { - // Required. The repository in which to list workspaces. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Optional. Maximum number of workspaces to return. The server may return fewer - // items than requested. If unspecified, the server will pick an appropriate - // default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string order_by = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filter for the returned list. - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListWorkspaces` response message. -message ListWorkspacesResponse { - // List of workspaces. - repeated Workspace workspaces = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetWorkspace` request message. -message GetWorkspaceRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// `CreateWorkspace` request message. -message CreateWorkspaceRequest { - // Required. The repository in which to create the workspace. Must be in the format - // `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Required. The workspace to create. - Workspace workspace = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the workspace, which will become the final component of - // the workspace's resource name. - string workspace_id = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `DeleteWorkspace` request message. -message DeleteWorkspaceRequest { - // Required. The workspace resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// Represents the author of a Git commit. -message CommitAuthor { - // Required. The commit author's name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The commit author's email address. - string email_address = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `PullGitCommits` request message. -message PullGitCommitsRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The author of any merge commit which may be created as a result of merging - // fetched Git commits into this workspace. - CommitAuthor author = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `PushGitCommits` request message. -message PushGitCommitsRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// `FetchFileGitStatuses` request message. -message FetchFileGitStatusesRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// `FetchFileGitStatuses` response message. -message FetchFileGitStatusesResponse { - // Represents the Git state of a file with uncommitted changes. - message UncommittedFileChange { - // Indicates the status of an uncommitted file change. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The file has been newly added. - ADDED = 1; - - // The file has been deleted. - DELETED = 2; - - // The file has been modified. - MODIFIED = 3; - - // The file contains merge conflicts. - HAS_CONFLICTS = 4; - } - - // The file's full path including filename, relative to the workspace root. - string path = 1; - - // Indicates the status of the file. - State state = 2; - } - - // A list of all files which have uncommitted Git changes. There will only be - // a single entry for any given file. - repeated UncommittedFileChange uncommitted_file_changes = 1; -} - -// `FetchGitAheadBehind` request message. -message FetchGitAheadBehindRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - string remote_branch = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// `FetchGitAheadBehind` response message. -message FetchGitAheadBehindResponse { - // The number of commits in the remote branch that are not in the workspace. - int32 commits_ahead = 1; - - // The number of commits in the workspace that are not in the remote branch. - int32 commits_behind = 2; -} - -// `CommitWorkspaceChanges` request message. -message CommitWorkspaceChangesRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The commit's author. - CommitAuthor author = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The commit's message. - string commit_message = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Full file paths to commit including filename, rooted at workspace root. If - // left empty, all files will be committed. - repeated string paths = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ResetWorkspaceChanges` request message. -message ResetWorkspaceChangesRequest { - // Required. The workspace's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // 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. - repeated string paths = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, untracked files will be deleted. - bool clean = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `FetchFileDiff` request message. -message FetchFileDiffRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `FetchFileDiff` response message. -message FetchFileDiffResponse { - // The raw formatted Git diff for the file. - string formatted_diff = 1; -} - -// `QueryDirectoryContents` request message. -message QueryDirectoryContentsRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Optional. The directory's full path including directory name, relative to the - // workspace root. If left unset, the workspace root is used. - string path = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of paths to return. The server may return fewer - // items than requested. If unspecified, the server will pick an appropriate - // default. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// `QueryDirectoryContents` response message. -message QueryDirectoryContentsResponse { - // Represents a single entry in a workspace directory. - message DirectoryEntry { - oneof entry { - // A file in the directory. - string file = 1; - - // A child directory in the directory. - string directory = 2; - } - } - - // List of entries in the directory. - repeated DirectoryEntry directory_entries = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// `MakeDirectory` request message. -message MakeDirectoryRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The directory's full path including directory name, relative to the - // workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `MakeDirectory` response message. -message MakeDirectoryResponse { - -} - -// `RemoveDirectory` request message. -message RemoveDirectoryRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The directory's full path including directory name, relative to the - // workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveDirectory` request message. -message MoveDirectoryRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The directory's full path including directory name, relative to the - // workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The new path for the directory including directory name, rooted at - // workspace root. - string new_path = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveDirectory` response message. -message MoveDirectoryResponse { - -} - -// `ReadFile` request message. -message ReadFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `ReadFile` response message. -message ReadFileResponse { - // The file's contents. - bytes file_contents = 1; -} - -// `RemoveFile` request message. -message RemoveFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveFile` request message. -message MoveFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file's full path including filename, relative to the workspace root. - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The file's new path including filename, relative to the workspace root. - string new_path = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `MoveFile` response message. -message MoveFileResponse { - -} - -// `WriteFile` request message. -message WriteFileRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - - // Required. The file. - string path = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The file's contents. - bytes contents = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// `WriteFile` response message. -message WriteFileResponse { - -} - -// `InstallNpmPackages` request message. -message InstallNpmPackagesRequest { - // Required. The workspace's name. - string workspace = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; -} - -// `InstallNpmPackages` response message. -message InstallNpmPackagesResponse { - -} - -// Represents the result of compiling a Dataform project. -message CompilationResult { - option (google.api.resource) = { - type: "dataform.googleapis.com/CompilationResult" - pattern: "projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}" - }; - - // Configures various aspects of Dataform code compilation. - message CodeCompilationConfig { - // Optional. The default database (Google Cloud project ID). - string default_database = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default schema (BigQuery dataset ID). - string default_schema = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string default_location = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The default schema (BigQuery dataset ID) for assertions. - string assertion_schema = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. User-defined variables that are made available to project code during - // compilation. - map vars = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The suffix that should be appended to all database (Google Cloud project - // ID) names. - string database_suffix = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The suffix that should be appended to all schema (BigQuery dataset ID) - // names. - string schema_suffix = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The prefix that should be prepended to all table names. - string table_prefix = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // An error encountered when attempting to compile a Dataform project. - message CompilationError { - // Output only. The error's top level message. - string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error's full stack trace. - string stack = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The path of the file where this error occurred, if available, relative to - // the project root. - string path = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The identifier of the action where this error occurred, if available. - Target action_target = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The compilation result's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - oneof source { - // 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` - string git_commitish = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The name of the workspace to compile. Must be in the format - // `projects/*/locations/*/repositories/*/workspaces/*`. - string workspace = 3 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Workspace" - } - ]; - } - - // Immutable. If set, fields of `code_compilation_overrides` override the default - // compilation settings that are specified in dataform.json. - CodeCompilationConfig code_compilation_config = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. The version of `@dataform/core` that was used for compilation. - string dataform_core_version = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Errors encountered during project compilation. - repeated CompilationError compilation_errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `ListCompilationResults` request message. -message ListCompilationResultsRequest { - // Required. The repository in which to list compilation results. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListCompilationResults` response message. -message ListCompilationResultsResponse { - // List of compilation results. - repeated CompilationResult compilation_results = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetCompilationResult` request message. -message GetCompilationResultRequest { - // Required. The compilation result's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/CompilationResult" - } - ]; -} - -// `CreateCompilationResult` request message. -message CreateCompilationResultRequest { - // Required. The repository in which to create the compilation result. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Required. The compilation result to create. - CompilationResult compilation_result = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Represents an action identifier. If the action writes output, the output -// will be written to the referenced database object. -message Target { - // The action's database (Google Cloud project ID) . - string database = 1; - - // The action's schema (BigQuery dataset ID), within `database`. - string schema = 2; - - // The action's name, within `database` and `schema`. - string name = 3; -} - -// Describes a relation and its columns. -message RelationDescriptor { - // Describes a column. - message ColumnDescriptor { - // The identifier for the column. Each entry in `path` represents one level - // of nesting. - repeated string path = 1; - - // A textual description of the column. - string description = 2; - - // A list of BigQuery policy tags that will be applied to the column. - repeated string bigquery_policy_tags = 3; - } - - // A text description of the relation. - string description = 1; - - // A list of descriptions of columns within the relation. - repeated ColumnDescriptor columns = 2; - - // A set of BigQuery labels that should be applied to the relation. - map bigquery_labels = 3; -} - -// Represents a single Dataform action in a compilation result. -message CompilationResultAction { - // Represents a database relation. - message Relation { - // Indicates the type of this relation. - enum RelationType { - // Default value. This value is unused. - RELATION_TYPE_UNSPECIFIED = 0; - - // The relation is a table. - TABLE = 1; - - // The relation is a view. - VIEW = 2; - - // The relation is an incrementalized table. - INCREMENTAL_TABLE = 3; - - // The relation is a materialized view. - MATERIALIZED_VIEW = 4; - } - - // Contains settings for relations of type `INCREMENTAL_TABLE`. - message IncrementalTableConfig { - // The SELECT query which returns rows which should be inserted into the - // relation if it already exists and is not being refreshed. - string incremental_select_query = 1; - - // Whether this table should be protected from being refreshed. - bool refresh_disabled = 2; - - // 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. - repeated string unique_key_parts = 3; - - // A SQL expression conditional used to limit the set of existing rows - // considered for a merge operation (see `unique_key_parts` for more - // information). - string update_partition_filter = 4; - - // SQL statements to be executed before inserting new rows into the - // relation. - repeated string incremental_pre_operations = 5; - - // SQL statements to be executed after inserting new rows into the - // relation. - repeated string incremental_post_operations = 6; - } - - // A list of actions that this action depends on. - repeated Target dependency_targets = 1; - - // Whether this action is disabled (i.e. should not be run). - bool disabled = 2; - - // Arbitrary, user-defined tags on this action. - repeated string tags = 3; - - // Descriptor for the relation and its columns. - RelationDescriptor relation_descriptor = 4; - - // The type of this relation. - RelationType relation_type = 5; - - // The SELECT query which returns rows which this relation should contain. - string select_query = 6; - - // SQL statements to be executed before creating the relation. - repeated string pre_operations = 7; - - // SQL statements to be executed after creating the relation. - repeated string post_operations = 8; - - // Configures `INCREMENTAL_TABLE` settings for this relation. Only set if - // `relation_type` is `INCREMENTAL_TABLE`. - IncrementalTableConfig incremental_table_config = 9; - - // The SQL expression used to partition the relation. - string partition_expression = 10; - - // A list of columns or SQL expressions used to cluster the table. - repeated string cluster_expressions = 11; - - // Sets the partition expiration in days. - int32 partition_expiration_days = 12; - - // Specifies whether queries on this table must include a predicate filter - // that filters on the partitioning column. - bool require_partition_filter = 13; - - // 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. - map additional_options = 14; - } - - // Represents a list of arbitrary database operations. - message Operations { - // A list of actions that this action depends on. - repeated Target dependency_targets = 1; - - // Whether this action is disabled (i.e. should not be run). - bool disabled = 2; - - // Arbitrary, user-defined tags on this action. - repeated string tags = 3; - - // Descriptor for any output relation and its columns. Only set if - // `has_output` is true. - RelationDescriptor relation_descriptor = 6; - - // A list of arbitrary SQL statements that will be executed without - // alteration. - repeated string queries = 4; - - // Whether these operations produce an output relation. - bool has_output = 5; - } - - // Represents an assertion upon a SQL query which is required return zero - // rows. - message Assertion { - // A list of actions that this action depends on. - repeated Target dependency_targets = 1; - - // The parent action of this assertion. Only set if this assertion was - // automatically generated. - Target parent_action = 5; - - // Whether this action is disabled (i.e. should not be run). - bool disabled = 2; - - // Arbitrary, user-defined tags on this action. - repeated string tags = 3; - - // The SELECT query which must return zero rows in order for this assertion - // to succeed. - string select_query = 4; - - // Descriptor for the assertion's automatically-generated view and its - // columns. - RelationDescriptor relation_descriptor = 6; - } - - // Represents a relation which is not managed by Dataform but which may be - // referenced by Dataform actions. - message 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 relation_descriptor = 1; - } - - // This action's identifier. Unique within the compilation result. - Target target = 1; - - // The action's identifier if the project had been compiled without any - // overrides configured. Unique within the compilation result. - Target canonical_target = 2; - - // The full path including filename in which this action is located, relative - // to the workspace root. - string file_path = 3; - - oneof compiled_object { - // The database relation created/updated by this action. - Relation relation = 4; - - // The database operations executed by this action. - Operations operations = 5; - - // The assertion executed by this action. - Assertion assertion = 6; - - // The declaration declared by this action. - Declaration declaration = 7; - } -} - -// `QueryCompilationResultActions` request message. -message QueryCompilationResultActionsRequest { - // Required. The compilation result's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/CompilationResult" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Optional filter for the returned list. Filtering is only currently - // supported on the `file_path` field. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// `QueryCompilationResultActions` response message. -message QueryCompilationResultActionsResponse { - // List of compilation result actions. - repeated CompilationResultAction compilation_result_actions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Represents a single invocation of a compilation result. -message WorkflowInvocation { - option (google.api.resource) = { - type: "dataform.googleapis.com/WorkflowInvocation" - pattern: "projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}" - }; - - // Includes various configuration options for this workflow invocation. - // If both `included_targets` and `included_tags` are unset, all actions - // will be included. - message InvocationConfig { - // Immutable. The set of action identifiers to include. - repeated Target included_targets = 1 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. The set of tags to include. - repeated string included_tags = 2 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. When set to true, transitive dependencies of included actions will be - // executed. - bool transitive_dependencies_included = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. When set to true, transitive dependents of included actions will be - // executed. - bool transitive_dependents_included = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Immutable. When set to true, any incremental tables will be fully refreshed. - bool fully_refresh_incremental_tables_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; - } - - // Represents the current state of a workflow invocation. - enum State { - // Default value. This value is unused. - STATE_UNSPECIFIED = 0; - - // The workflow invocation is currently running. - RUNNING = 1; - - // The workflow invocation succeeded. A terminal state. - SUCCEEDED = 2; - - // The workflow invocation was cancelled. A terminal state. - CANCELLED = 3; - - // The workflow invocation failed. A terminal state. - FAILED = 4; - - // The workflow invocation is being cancelled, but some actions are still - // running. - CANCELING = 5; - } - - // Output only. The workflow invocation's name. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Immutable. The name of the compilation result to compile. Must be in the format - // `projects/*/locations/*/repositories/*/compilationResults/*`. - string compilation_result = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/CompilationResult" - } - ]; - - // Immutable. If left unset, a default InvocationConfig will be used. - InvocationConfig invocation_config = 3 [(google.api.field_behavior) = IMMUTABLE]; - - // Output only. This workflow invocation's current state. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This workflow invocation's timing details. - google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `ListWorkflowInvocations` request message. -message ListWorkflowInvocationsRequest { - // Required. The parent resource of the WorkflowInvocation type. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `ListWorkflowInvocations` response message. -message ListWorkflowInvocationsResponse { - // List of workflow invocations. - repeated WorkflowInvocation workflow_invocations = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Locations which could not be reached. - repeated string unreachable = 3; -} - -// `GetWorkflowInvocation` request message. -message GetWorkflowInvocationRequest { - // Required. The workflow invocation resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; -} - -// `CreateWorkflowInvocation` request message. -message CreateWorkflowInvocationRequest { - // Required. The repository in which to create the workflow invocation. Must be in the - // format `projects/*/locations/*/repositories/*`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/Repository" - } - ]; - - // Required. The workflow invocation resource to create. - WorkflowInvocation workflow_invocation = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `DeleteWorkflowInvocation` request message. -message DeleteWorkflowInvocationRequest { - // Required. The workflow invocation resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; -} - -// `CancelWorkflowInvocation` request message. -message CancelWorkflowInvocationRequest { - // Required. The workflow invocation resource's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; -} - -// Represents a single action in a workflow invocation. -message WorkflowInvocationAction { - // Represents the current state of an workflow invocation action. - enum State { - // The action has not yet been considered for invocation. - PENDING = 0; - - // The action is currently running. - RUNNING = 1; - - // Execution of the action was skipped because upstream dependencies did not - // all complete successfully. A terminal state. - SKIPPED = 2; - - // Execution of the action was disabled as per the configuration of the - // corresponding compilation result action. A terminal state. - DISABLED = 3; - - // The action succeeded. A terminal state. - SUCCEEDED = 4; - - // The action was cancelled. A terminal state. - CANCELLED = 5; - - // The action failed. A terminal state. - FAILED = 6; - } - - // Represents a workflow action that will run against BigQuery. - message BigQueryAction { - // Output only. The generated BigQuery SQL script that will be executed. - string sql_script = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. This action's identifier. Unique within the workflow invocation. - Target target = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The action's identifier if the project had been compiled without any - // overrides configured. Unique within the compilation result. - Target canonical_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This action's current state. - State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If and only if action's state is FAILED a failure reason is set. - string failure_reason = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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. - google.type.Interval invocation_timing = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The workflow action's bigquery action details. - BigQueryAction bigquery_action = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `QueryWorkflowInvocationActions` request message. -message QueryWorkflowInvocationActionsRequest { - // Required. The workflow invocation's name. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataform.googleapis.com/WorkflowInvocation" - } - ]; - - // 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. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // 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. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// `QueryWorkflowInvocationActions` response message. -message QueryWorkflowInvocationActionsResponse { - // List of workflow invocation actions. - repeated WorkflowInvocationAction workflow_invocation_actions = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js deleted file mode 100644 index 2028cb6..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCancelWorkflowInvocation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.cancelWorkflowInvocation(request); - console.log(response); - } - - callCancelWorkflowInvocation(); - // [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js deleted file mode 100644 index 01e533e..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.commit_workspace_changes.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, author) { - // [START dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * Required. The commit's author. - */ - // const author = {} - /** - * Optional. The commit's message. - */ - // const commitMessage = 'abc123' - /** - * Optional. Full file paths to commit including filename, rooted at workspace root. If - * left empty, all files will be committed. - */ - // const paths = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCommitWorkspaceChanges() { - // Construct request - const request = { - name, - author, - }; - - // Run request - const response = await dataformClient.commitWorkspaceChanges(request); - console.log(response); - } - - callCommitWorkspaceChanges(); - // [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js deleted file mode 100644 index 8826207..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_compilation_result.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, compilationResult) { - // [START dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to create the compilation result. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Required. The compilation result to create. - */ - // const compilationResult = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateCompilationResult() { - // Construct request - const request = { - parent, - compilationResult, - }; - - // Run request - const response = await dataformClient.createCompilationResult(request); - console.log(response); - } - - callCreateCompilationResult(); - // [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js deleted file mode 100644 index b0d66cd..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_repository.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, repository, repositoryId) { - // [START dataform_v1beta1_generated_Dataform_CreateRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location in which to create the repository. Must be in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Required. The repository to create. - */ - // const repository = {} - /** - * Required. The ID to use for the repository, which will become the final component of - * the repository's resource name. - */ - // const repositoryId = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateRepository() { - // Construct request - const request = { - parent, - repository, - repositoryId, - }; - - // Run request - const response = await dataformClient.createRepository(request); - console.log(response); - } - - callCreateRepository(); - // [END dataform_v1beta1_generated_Dataform_CreateRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js deleted file mode 100644 index 9108d48..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workflow_invocation.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, workflowInvocation) { - // [START dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to create the workflow invocation. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Required. The workflow invocation resource to create. - */ - // const workflowInvocation = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateWorkflowInvocation() { - // Construct request - const request = { - parent, - workflowInvocation, - }; - - // Run request - const response = await dataformClient.createWorkflowInvocation(request); - console.log(response); - } - - callCreateWorkflowInvocation(); - // [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js deleted file mode 100644 index 531becb..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.create_workspace.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent, workspace, workspaceId) { - // [START dataform_v1beta1_generated_Dataform_CreateWorkspace_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to create the workspace. Must be in the format - * `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Required. The workspace to create. - */ - // const workspace = {} - /** - * Required. The ID to use for the workspace, which will become the final component of - * the workspace's resource name. - */ - // const workspaceId = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callCreateWorkspace() { - // Construct request - const request = { - parent, - workspace, - workspaceId, - }; - - // Run request - const response = await dataformClient.createWorkspace(request); - console.log(response); - } - - callCreateWorkspace(); - // [END dataform_v1beta1_generated_Dataform_CreateWorkspace_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js deleted file mode 100644 index ad2ad43..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_repository.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_DeleteRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository's name. - */ - // const name = 'abc123' - /** - * 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.) - */ - // const force = true - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callDeleteRepository() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.deleteRepository(request); - console.log(response); - } - - callDeleteRepository(); - // [END dataform_v1beta1_generated_Dataform_DeleteRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js deleted file mode 100644 index ab0aaac..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workflow_invocation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callDeleteWorkflowInvocation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.deleteWorkflowInvocation(request); - console.log(response); - } - - callDeleteWorkflowInvocation(); - // [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js deleted file mode 100644 index 5c0060d..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.delete_workspace.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callDeleteWorkspace() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.deleteWorkspace(request); - console.log(response); - } - - callDeleteWorkspace(); - // [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js deleted file mode 100644 index 2df2eb2..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_diff.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1beta1_generated_Dataform_FetchFileDiff_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchFileDiff() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.fetchFileDiff(request); - console.log(response); - } - - callFetchFileDiff(); - // [END dataform_v1beta1_generated_Dataform_FetchFileDiff_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js deleted file mode 100644 index 03cfe21..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchFileGitStatuses() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.fetchFileGitStatuses(request); - console.log(response); - } - - callFetchFileGitStatuses(); - // [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js deleted file mode 100644 index 733dde9..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const remoteBranch = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchGitAheadBehind() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.fetchGitAheadBehind(request); - console.log(response); - } - - callFetchGitAheadBehind(); - // [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js deleted file mode 100644 index 43c3d2a..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.fetch_remote_branches.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callFetchRemoteBranches() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.fetchRemoteBranches(request); - console.log(response); - } - - callFetchRemoteBranches(); - // [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js deleted file mode 100644 index ee22ddb..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_compilation_result.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_GetCompilationResult_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The compilation result's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetCompilationResult() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getCompilationResult(request); - console.log(response); - } - - callGetCompilationResult(); - // [END dataform_v1beta1_generated_Dataform_GetCompilationResult_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js deleted file mode 100644 index 071180c..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_repository.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_GetRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetRepository() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getRepository(request); - console.log(response); - } - - callGetRepository(); - // [END dataform_v1beta1_generated_Dataform_GetRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js deleted file mode 100644 index 9e48759..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workflow_invocation.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation resource's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetWorkflowInvocation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getWorkflowInvocation(request); - console.log(response); - } - - callGetWorkflowInvocation(); - // [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js deleted file mode 100644 index 6c22c2e..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.get_workspace.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_GetWorkspace_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callGetWorkspace() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.getWorkspace(request); - console.log(response); - } - - callGetWorkspace(); - // [END dataform_v1beta1_generated_Dataform_GetWorkspace_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js deleted file mode 100644 index d8ecbf9..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.install_npm_packages.js +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace) { - // [START dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callInstallNpmPackages() { - // Construct request - const request = { - workspace, - }; - - // Run request - const response = await dataformClient.installNpmPackages(request); - console.log(response); - } - - callInstallNpmPackages(); - // [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js deleted file mode 100644 index ec422dd..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_compilation_results.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1beta1_generated_Dataform_ListCompilationResults_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListCompilationResults() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listCompilationResultsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListCompilationResults(); - // [END dataform_v1beta1_generated_Dataform_ListCompilationResults_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js deleted file mode 100644 index 279161f..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_repositories.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1beta1_generated_Dataform_ListRepositories_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - */ - // const parent = 'abc123' - /** - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * 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. - */ - // const orderBy = 'abc123' - /** - * Optional. Filter for the returned list. - */ - // const filter = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListRepositories() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listRepositoriesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListRepositories(); - // [END dataform_v1beta1_generated_Dataform_ListRepositories_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js deleted file mode 100644 index e9194a1..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workflow_invocations.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListWorkflowInvocations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listWorkflowInvocationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkflowInvocations(); - // [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js deleted file mode 100644 index fbf8647..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.list_workspaces.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START dataform_v1beta1_generated_Dataform_ListWorkspaces_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - */ - // const parent = 'abc123' - /** - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * 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. - */ - // const orderBy = 'abc123' - /** - * Optional. Filter for the returned list. - */ - // const filter = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callListWorkspaces() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await dataformClient.listWorkspacesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkspaces(); - // [END dataform_v1beta1_generated_Dataform_ListWorkspaces_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js deleted file mode 100644 index b352c7b..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.make_directory.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1beta1_generated_Dataform_MakeDirectory_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The directory's full path including directory name, relative to the - * workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callMakeDirectory() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.makeDirectory(request); - console.log(response); - } - - callMakeDirectory(); - // [END dataform_v1beta1_generated_Dataform_MakeDirectory_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js deleted file mode 100644 index ec43257..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_directory.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path, newPath) { - // [START dataform_v1beta1_generated_Dataform_MoveDirectory_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The directory's full path including directory name, relative to the - * workspace root. - */ - // const path = 'abc123' - /** - * Required. The new path for the directory including directory name, rooted at - * workspace root. - */ - // const newPath = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callMoveDirectory() { - // Construct request - const request = { - workspace, - path, - newPath, - }; - - // Run request - const response = await dataformClient.moveDirectory(request); - console.log(response); - } - - callMoveDirectory(); - // [END dataform_v1beta1_generated_Dataform_MoveDirectory_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js deleted file mode 100644 index c00db1f..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.move_file.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path, newPath) { - // [START dataform_v1beta1_generated_Dataform_MoveFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - /** - * Required. The file's new path including filename, relative to the workspace root. - */ - // const newPath = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callMoveFile() { - // Construct request - const request = { - workspace, - path, - newPath, - }; - - // Run request - const response = await dataformClient.moveFile(request); - console.log(response); - } - - callMoveFile(); - // [END dataform_v1beta1_generated_Dataform_MoveFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js deleted file mode 100644 index 18c8f38..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.pull_git_commits.js +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name, author) { - // [START dataform_v1beta1_generated_Dataform_PullGitCommits_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const remoteBranch = 'abc123' - /** - * Required. The author of any merge commit which may be created as a result of merging - * fetched Git commits into this workspace. - */ - // const author = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callPullGitCommits() { - // Construct request - const request = { - name, - author, - }; - - // Run request - const response = await dataformClient.pullGitCommits(request); - console.log(response); - } - - callPullGitCommits(); - // [END dataform_v1beta1_generated_Dataform_PullGitCommits_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js deleted file mode 100644 index 0863cf3..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.push_git_commits.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_PushGitCommits_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const remoteBranch = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callPushGitCommits() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.pushGitCommits(request); - console.log(response); - } - - callPushGitCommits(); - // [END dataform_v1beta1_generated_Dataform_PushGitCommits_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js deleted file mode 100644 index 1690b94..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_compilation_result_actions.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The compilation result's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - /** - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - */ - // const filter = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callQueryCompilationResultActions() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await dataformClient.queryCompilationResultActionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callQueryCompilationResultActions(); - // [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js deleted file mode 100644 index c779211..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_directory_contents.js +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace) { - // [START dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - */ - // const path = 'abc123' - /** - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callQueryDirectoryContents() { - // Construct request - const request = { - workspace, - }; - - // Run request - const iterable = await dataformClient.queryDirectoryContentsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callQueryDirectoryContents(); - // [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js deleted file mode 100644 index 9a7531e..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workflow invocation's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const pageSize = 1234 - /** - * 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. - */ - // const pageToken = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callQueryWorkflowInvocationActions() { - // Construct request - const request = { - name, - }; - - // Run request - const iterable = await dataformClient.queryWorkflowInvocationActionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callQueryWorkflowInvocationActions(); - // [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js deleted file mode 100644 index 61d5eeb..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.read_file.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1beta1_generated_Dataform_ReadFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callReadFile() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.readFile(request); - console.log(response); - } - - callReadFile(); - // [END dataform_v1beta1_generated_Dataform_ReadFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js deleted file mode 100644 index c22c6a1..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_directory.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1beta1_generated_Dataform_RemoveDirectory_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The directory's full path including directory name, relative to the - * workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callRemoveDirectory() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.removeDirectory(request); - console.log(response); - } - - callRemoveDirectory(); - // [END dataform_v1beta1_generated_Dataform_RemoveDirectory_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js deleted file mode 100644 index 22a7529..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.remove_file.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path) { - // [START dataform_v1beta1_generated_Dataform_RemoveFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file's full path including filename, relative to the workspace root. - */ - // const path = 'abc123' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callRemoveFile() { - // Construct request - const request = { - workspace, - path, - }; - - // Run request - const response = await dataformClient.removeFile(request); - console.log(response); - } - - callRemoveFile(); - // [END dataform_v1beta1_generated_Dataform_RemoveFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js deleted file mode 100644 index e611fb1..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.reset_workspace_changes.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const name = 'abc123' - /** - * 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. - */ - // const paths = 'abc123' - /** - * Optional. If set to true, untracked files will be deleted. - */ - // const clean = true - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callResetWorkspaceChanges() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataformClient.resetWorkspaceChanges(request); - console.log(response); - } - - callResetWorkspaceChanges(); - // [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js deleted file mode 100644 index ce879f0..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.update_repository.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(repository) { - // [START dataform_v1beta1_generated_Dataform_UpdateRepository_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Optional. Specifies the fields to be updated in the repository. If left unset, - * all fields will be updated. - */ - // const updateMask = {} - /** - * Required. The repository to update. - */ - // const repository = {} - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callUpdateRepository() { - // Construct request - const request = { - repository, - }; - - // Run request - const response = await dataformClient.updateRepository(request); - console.log(response); - } - - callUpdateRepository(); - // [END dataform_v1beta1_generated_Dataform_UpdateRepository_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js b/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js deleted file mode 100644 index 33502bd..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/dataform.write_file.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(workspace, path, contents) { - // [START dataform_v1beta1_generated_Dataform_WriteFile_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The workspace's name. - */ - // const workspace = 'abc123' - /** - * Required. The file. - */ - // const path = 'abc123' - /** - * Required. The file's contents. - */ - // const contents = 'Buffer.from('string')' - - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1beta1; - - // Instantiates a client - const dataformClient = new DataformClient(); - - async function callWriteFile() { - // Construct request - const request = { - workspace, - path, - contents, - }; - - // Run request - const response = await dataformClient.writeFile(request); - console.log(response); - } - - callWriteFile(); - // [END dataform_v1beta1_generated_Dataform_WriteFile_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json b/owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json deleted file mode 100644 index 38a4377..0000000 --- a/owl-bot-staging/v1beta1/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json +++ /dev/null @@ -1,1647 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-dataform", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.dataform.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "dataform_v1beta1_generated_Dataform_ListRepositories_async", - "title": "Dataform listRepositories Sample", - "origin": "API_DEFINITION", - "description": " Lists Repositories in a given project and location.", - "canonical": true, - "file": "dataform.list_repositories.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListRepositories", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.ListRepositoriesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "ListRepositories", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListRepositories", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_GetRepository_async", - "title": "Dataform getRepository Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single Repository.", - "canonical": true, - "file": "dataform.get_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.Repository", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "GetRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_CreateRepository_async", - "title": "Dataform createRepository Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Repository in a given project and location.", - "canonical": true, - "file": "dataform.create_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "repository", - "type": ".google.cloud.dataform.v1beta1.Repository" - }, - { - "name": "repository_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.Repository", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "CreateRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_UpdateRepository_async", - "title": "Dataform updateRepository Sample", - "origin": "API_DEFINITION", - "description": " Updates a single Repository.", - "canonical": true, - "file": "dataform.update_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "repository", - "type": ".google.cloud.dataform.v1beta1.Repository" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.Repository", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "UpdateRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.UpdateRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteRepository_async", - "title": "Dataform deleteRepository Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Repository.", - "canonical": true, - "file": "dataform.delete_repository.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "DeleteRepository", - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteRepository", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async", - "title": "Dataform fetchRemoteBranches Sample", - "origin": "API_DEFINITION", - "description": " Fetches a Repository's remote branches.", - "canonical": true, - "file": "dataform.fetch_remote_branches.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchRemoteBranches", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "FetchRemoteBranches", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchRemoteBranches", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkspaces_async", - "title": "Dataform listWorkspaces Sample", - "origin": "API_DEFINITION", - "description": " Lists Workspaces in a given Repository.", - "canonical": true, - "file": "dataform.list_workspaces.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkspaces", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.ListWorkspacesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "ListWorkspaces", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkspaces", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkspace_async", - "title": "Dataform getWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single Workspace.", - "canonical": true, - "file": "dataform.get_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkspace", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.Workspace", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "GetWorkspace", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkspace", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkspace_async", - "title": "Dataform createWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Workspace in a given Repository.", - "canonical": true, - "file": "dataform.create_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkspace", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "workspace", - "type": ".google.cloud.dataform.v1beta1.Workspace" - }, - { - "name": "workspace_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.Workspace", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "CreateWorkspace", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkspace", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkspace_async", - "title": "Dataform deleteWorkspace Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Workspace.", - "canonical": true, - "file": "dataform.delete_workspace.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkspace", - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "DeleteWorkspace", - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkspace", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_InstallNpmPackages_async", - "title": "Dataform installNpmPackages Sample", - "origin": "API_DEFINITION", - "description": " Installs dependency NPM packages (inside a Workspace).", - "canonical": true, - "file": "dataform.install_npm_packages.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InstallNpmPackages", - "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.InstallNpmPackagesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "InstallNpmPackages", - "fullName": "google.cloud.dataform.v1beta1.Dataform.InstallNpmPackages", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_PullGitCommits_async", - "title": "Dataform pullGitCommits Sample", - "origin": "API_DEFINITION", - "description": " Pulls Git commits from the Repository's remote into a Workspace.", - "canonical": true, - "file": "dataform.pull_git_commits.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PullGitCommits", - "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "remote_branch", - "type": "TYPE_STRING" - }, - { - "name": "author", - "type": ".google.cloud.dataform.v1beta1.CommitAuthor" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "PullGitCommits", - "fullName": "google.cloud.dataform.v1beta1.Dataform.PullGitCommits", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_PushGitCommits_async", - "title": "Dataform pushGitCommits Sample", - "origin": "API_DEFINITION", - "description": " Pushes Git commits from a Workspace to the Repository's remote.", - "canonical": true, - "file": "dataform.push_git_commits.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "PushGitCommits", - "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "remote_branch", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "PushGitCommits", - "fullName": "google.cloud.dataform.v1beta1.Dataform.PushGitCommits", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async", - "title": "Dataform fetchFileGitStatuses Sample", - "origin": "API_DEFINITION", - "description": " Fetches Git statuses for the files in a Workspace.", - "canonical": true, - "file": "dataform.fetch_file_git_statuses.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchFileGitStatuses", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "FetchFileGitStatuses", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileGitStatuses", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async", - "title": "Dataform fetchGitAheadBehind Sample", - "origin": "API_DEFINITION", - "description": " Fetches Git ahead/behind against a remote branch.", - "canonical": true, - "file": "dataform.fetch_git_ahead_behind.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchGitAheadBehind", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "remote_branch", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "FetchGitAheadBehind", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchGitAheadBehind", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async", - "title": "Dataform commitWorkspaceChanges Sample", - "origin": "API_DEFINITION", - "description": " Applies a Git commit for uncommitted files in a Workspace.", - "canonical": true, - "file": "dataform.commit_workspace_changes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 67, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CommitWorkspaceChanges", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "author", - "type": ".google.cloud.dataform.v1beta1.CommitAuthor" - }, - { - "name": "commit_message", - "type": "TYPE_STRING" - }, - { - "name": "paths", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "CommitWorkspaceChanges", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CommitWorkspaceChanges", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async", - "title": "Dataform resetWorkspaceChanges Sample", - "origin": "API_DEFINITION", - "description": " Performs a Git reset for uncommitted files in a Workspace.", - "canonical": true, - "file": "dataform.reset_workspace_changes.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResetWorkspaceChanges", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "paths", - "type": "TYPE_STRING[]" - }, - { - "name": "clean", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "ResetWorkspaceChanges", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ResetWorkspaceChanges", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_FetchFileDiff_async", - "title": "Dataform fetchFileDiff Sample", - "origin": "API_DEFINITION", - "description": " Fetches Git diff for an uncommitted file in a Workspace.", - "canonical": true, - "file": "dataform.fetch_file_diff.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchFileDiff", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.FetchFileDiffResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "FetchFileDiff", - "fullName": "google.cloud.dataform.v1beta1.Dataform.FetchFileDiff", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async", - "title": "Dataform queryDirectoryContents Sample", - "origin": "API_DEFINITION", - "description": " Returns the contents of a given Workspace directory.", - "canonical": true, - "file": "dataform.query_directory_contents.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "QueryDirectoryContents", - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "QueryDirectoryContents", - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryDirectoryContents", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_MakeDirectory_async", - "title": "Dataform makeDirectory Sample", - "origin": "API_DEFINITION", - "description": " Creates a directory inside a Workspace.", - "canonical": true, - "file": "dataform.make_directory.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MakeDirectory", - "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.MakeDirectoryResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "MakeDirectory", - "fullName": "google.cloud.dataform.v1beta1.Dataform.MakeDirectory", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_RemoveDirectory_async", - "title": "Dataform removeDirectory Sample", - "origin": "API_DEFINITION", - "description": " Deletes a directory (inside a Workspace) and all of its contents.", - "canonical": true, - "file": "dataform.remove_directory.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RemoveDirectory", - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "RemoveDirectory", - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveDirectory", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_MoveDirectory_async", - "title": "Dataform moveDirectory Sample", - "origin": "API_DEFINITION", - "description": " Moves a directory (inside a Workspace), and all of its contents, to a new location.", - "canonical": true, - "file": "dataform.move_directory.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MoveDirectory", - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "new_path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.MoveDirectoryResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "MoveDirectory", - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveDirectory", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_ReadFile_async", - "title": "Dataform readFile Sample", - "origin": "API_DEFINITION", - "description": " Returns the contents of a file (inside a Workspace).", - "canonical": true, - "file": "dataform.read_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReadFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.ReadFileResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "ReadFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ReadFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_RemoveFile_async", - "title": "Dataform removeFile Sample", - "origin": "API_DEFINITION", - "description": " Deletes a file (inside a Workspace).", - "canonical": true, - "file": "dataform.remove_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RemoveFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "RemoveFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.RemoveFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_MoveFile_async", - "title": "Dataform moveFile Sample", - "origin": "API_DEFINITION", - "description": " Moves a file (inside a Workspace) to a new location.", - "canonical": true, - "file": "dataform.move_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "MoveFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "new_path", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.MoveFileResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "MoveFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.MoveFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_WriteFile_async", - "title": "Dataform writeFile Sample", - "origin": "API_DEFINITION", - "description": " Writes to a file (inside a Workspace).", - "canonical": true, - "file": "dataform.write_file.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "WriteFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", - "async": true, - "parameters": [ - { - "name": "workspace", - "type": "TYPE_STRING" - }, - { - "name": "path", - "type": "TYPE_STRING" - }, - { - "name": "contents", - "type": "TYPE_BYTES" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.WriteFileResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "WriteFile", - "fullName": "google.cloud.dataform.v1beta1.Dataform.WriteFile", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_ListCompilationResults_async", - "title": "Dataform listCompilationResults Sample", - "origin": "API_DEFINITION", - "description": " Lists CompilationResults in a given Repository.", - "canonical": true, - "file": "dataform.list_compilation_results.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListCompilationResults", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.ListCompilationResultsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "ListCompilationResults", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListCompilationResults", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_GetCompilationResult_async", - "title": "Dataform getCompilationResult Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single CompilationResult.", - "canonical": true, - "file": "dataform.get_compilation_result.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCompilationResult", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.CompilationResult", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "GetCompilationResult", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetCompilationResult", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_CreateCompilationResult_async", - "title": "Dataform createCompilationResult Sample", - "origin": "API_DEFINITION", - "description": " Creates a new CompilationResult in a given project and location.", - "canonical": true, - "file": "dataform.create_compilation_result.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCompilationResult", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "compilation_result", - "type": ".google.cloud.dataform.v1beta1.CompilationResult" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.CompilationResult", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "CreateCompilationResult", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateCompilationResult", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async", - "title": "Dataform queryCompilationResultActions Sample", - "origin": "API_DEFINITION", - "description": " Returns CompilationResultActions in a given CompilationResult.", - "canonical": true, - "file": "dataform.query_compilation_result_actions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "QueryCompilationResultActions", - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.QueryCompilationResultActionsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "QueryCompilationResultActions", - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryCompilationResultActions", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async", - "title": "Dataform listWorkflowInvocations Sample", - "origin": "API_DEFINITION", - "description": " Lists WorkflowInvocations in a given Repository.", - "canonical": true, - "file": "dataform.list_workflow_invocations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkflowInvocations", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.ListWorkflowInvocationsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "ListWorkflowInvocations", - "fullName": "google.cloud.dataform.v1beta1.Dataform.ListWorkflowInvocations", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async", - "title": "Dataform getWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Fetches a single WorkflowInvocation.", - "canonical": true, - "file": "dataform.get_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.WorkflowInvocation", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "GetWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.GetWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async", - "title": "Dataform createWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Creates a new WorkflowInvocation in a given Repository.", - "canonical": true, - "file": "dataform.create_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "workflow_invocation", - "type": ".google.cloud.dataform.v1beta1.WorkflowInvocation" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.WorkflowInvocation", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "CreateWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CreateWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async", - "title": "Dataform deleteWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single WorkflowInvocation.", - "canonical": true, - "file": "dataform.delete_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "DeleteWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.DeleteWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async", - "title": "Dataform cancelWorkflowInvocation Sample", - "origin": "API_DEFINITION", - "description": " Requests cancellation of a running WorkflowInvocation.", - "canonical": true, - "file": "dataform.cancel_workflow_invocation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "CancelWorkflowInvocation", - "fullName": "google.cloud.dataform.v1beta1.Dataform.CancelWorkflowInvocation", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - }, - { - "regionTag": "dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async", - "title": "Dataform queryWorkflowInvocationActions Sample", - "origin": "API_DEFINITION", - "description": " Returns WorkflowInvocationActions in a given WorkflowInvocation.", - "canonical": true, - "file": "dataform.query_workflow_invocation_actions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "QueryWorkflowInvocationActions", - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsResponse", - "client": { - "shortName": "DataformClient", - "fullName": "google.cloud.dataform.v1beta1.DataformClient" - }, - "method": { - "shortName": "QueryWorkflowInvocationActions", - "fullName": "google.cloud.dataform.v1beta1.Dataform.QueryWorkflowInvocationActions", - "service": { - "shortName": "Dataform", - "fullName": "google.cloud.dataform.v1beta1.Dataform" - } - } - } - } - ] -} diff --git a/owl-bot-staging/v1beta1/src/index.ts b/owl-bot-staging/v1beta1/src/index.ts deleted file mode 100644 index 3f26c5b..0000000 --- a/owl-bot-staging/v1beta1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta1 from './v1beta1'; -const DataformClient = v1beta1.DataformClient; -type DataformClient = v1beta1.DataformClient; -export {v1beta1, DataformClient}; -export default {v1beta1, DataformClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts deleted file mode 100644 index 2460ede..0000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataform_client.ts +++ /dev/null @@ -1,4388 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; - -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/dataform_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './dataform_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Dataform is a service to develop, create, document, test, and update curated - * tables in BigQuery. - * @class - * @memberof v1beta1 - */ -export class DataformClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - dataformStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DataformClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. - * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DataformClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - this.iamClient = new IamClient(this._gaxGrpc, opts); - - this.locationsClient = new LocationsClient(this._gaxGrpc, opts); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - compilationResultPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/compilationResults/{compilation_result}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - repositoryPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}' - ), - workflowInvocationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workflowInvocations/{workflow_invocation}' - ), - workspacePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/repositories/{repository}/workspaces/{workspace}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listRepositories: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'repositories'), - listWorkspaces: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workspaces'), - queryDirectoryContents: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'directoryEntries'), - listCompilationResults: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResults'), - queryCompilationResultActions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'compilationResultActions'), - listWorkflowInvocations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocations'), - queryWorkflowInvocationActions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'workflowInvocationActions') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataform.v1beta1.Dataform', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.dataformStub) { - return this.dataformStub; - } - - // Put together the "service stub" for - // google.cloud.dataform.v1beta1.Dataform. - this.dataformStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataform.v1beta1.Dataform') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataform.v1beta1.Dataform, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const dataformStubMethods = - ['listRepositories', 'getRepository', 'createRepository', 'updateRepository', 'deleteRepository', 'fetchRemoteBranches', 'listWorkspaces', 'getWorkspace', 'createWorkspace', 'deleteWorkspace', 'installNpmPackages', 'pullGitCommits', 'pushGitCommits', 'fetchFileGitStatuses', 'fetchGitAheadBehind', 'commitWorkspaceChanges', 'resetWorkspaceChanges', 'fetchFileDiff', 'queryDirectoryContents', 'makeDirectory', 'removeDirectory', 'moveDirectory', 'readFile', 'removeFile', 'moveFile', 'writeFile', 'listCompilationResults', 'getCompilationResult', 'createCompilationResult', 'queryCompilationResultActions', 'listWorkflowInvocations', 'getWorkflowInvocation', 'createWorkflowInvocation', 'deleteWorkflowInvocation', 'cancelWorkflowInvocation', 'queryWorkflowInvocationActions']; - for (const methodName of dataformStubMethods) { - const callPromise = this.dataformStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - this.descriptors.page[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.dataformStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'dataform.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'dataform.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Fetches a single Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The repository's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.get_repository.js - * region_tag:dataform_v1beta1_generated_Dataform_GetRepository_async - */ - getRepository( - request?: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|undefined, {}|undefined - ]>; - getRepository( - request: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, - {}|null|undefined>): void; - getRepository( - request: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, - {}|null|undefined>): void; - getRepository( - request?: protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IGetRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getRepository(request, options, callback); - } -/** - * Creates a new Repository in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to create the repository. Must be in the format - * `projects/* /locations/*`. - * @param {google.cloud.dataform.v1beta1.Repository} request.repository - * Required. The repository to create. - * @param {string} request.repositoryId - * Required. The ID to use for the repository, which will become the final component of - * the repository's resource name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.create_repository.js - * region_tag:dataform_v1beta1_generated_Dataform_CreateRepository_async - */ - createRepository( - request?: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|undefined, {}|undefined - ]>; - createRepository( - request: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - createRepository( - request: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - createRepository( - request?: protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.ICreateRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createRepository(request, options, callback); - } -/** - * Updates a single Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Specifies the fields to be updated in the repository. If left unset, - * all fields will be updated. - * @param {google.cloud.dataform.v1beta1.Repository} request.repository - * Required. The repository to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.update_repository.js - * region_tag:dataform_v1beta1_generated_Dataform_UpdateRepository_async - */ - updateRepository( - request?: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|undefined, {}|undefined - ]>; - updateRepository( - request: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - updateRepository( - request: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>): void; - updateRepository( - request?: protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository, - protos.google.cloud.dataform.v1beta1.IUpdateRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'repository.name': request.repository!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateRepository(request, options, callback); - } -/** - * Deletes a single Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The repository's name. - * @param {boolean} request.force - * 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.) - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.delete_repository.js - * region_tag:dataform_v1beta1_generated_Dataform_DeleteRepository_async - */ - deleteRepository( - request?: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|undefined, {}|undefined - ]>; - deleteRepository( - request: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>): void; - deleteRepository( - request: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>): void; - deleteRepository( - request?: protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteRepositoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteRepository(request, options, callback); - } -/** - * Fetches a Repository's remote branches. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The repository's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchRemoteBranchesResponse]{@link google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.fetch_remote_branches.js - * region_tag:dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async - */ - fetchRemoteBranches( - request?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|undefined, {}|undefined - ]>; - fetchRemoteBranches( - request: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>): void; - fetchRemoteBranches( - request: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>): void; - fetchRemoteBranches( - request?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse, - protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.fetchRemoteBranches(request, options, callback); - } -/** - * Fetches a single Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.get_workspace.js - * region_tag:dataform_v1beta1_generated_Dataform_GetWorkspace_async - */ - getWorkspace( - request?: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|undefined, {}|undefined - ]>; - getWorkspace( - request: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - getWorkspace( - request: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - getWorkspace( - request?: protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.IGetWorkspaceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getWorkspace(request, options, callback); - } -/** - * Creates a new Workspace in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to create the workspace. Must be in the format - * `projects/* /locations/* /repositories/*`. - * @param {google.cloud.dataform.v1beta1.Workspace} request.workspace - * Required. The workspace to create. - * @param {string} request.workspaceId - * Required. The ID to use for the workspace, which will become the final component of - * the workspace's resource name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.create_workspace.js - * region_tag:dataform_v1beta1_generated_Dataform_CreateWorkspace_async - */ - createWorkspace( - request?: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|undefined, {}|undefined - ]>; - createWorkspace( - request: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - createWorkspace( - request: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - createWorkspace( - request?: protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkspace, - protos.google.cloud.dataform.v1beta1.ICreateWorkspaceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createWorkspace(request, options, callback); - } -/** - * Deletes a single Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.delete_workspace.js - * region_tag:dataform_v1beta1_generated_Dataform_DeleteWorkspace_async - */ - deleteWorkspace( - request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|undefined, {}|undefined - ]>; - deleteWorkspace( - request: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkspace( - request: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkspace( - request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkspaceRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteWorkspace(request, options, callback); - } -/** - * Installs dependency NPM packages (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [InstallNpmPackagesResponse]{@link google.cloud.dataform.v1beta1.InstallNpmPackagesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.install_npm_packages.js - * region_tag:dataform_v1beta1_generated_Dataform_InstallNpmPackages_async - */ - installNpmPackages( - request?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|undefined, {}|undefined - ]>; - installNpmPackages( - request: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>): void; - installNpmPackages( - request: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>): void; - installNpmPackages( - request?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse, - protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.installNpmPackages(request, options, callback); - } -/** - * Pulls Git commits from the Repository's remote into a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string} [request.remoteBranch] - * 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. - * @param {google.cloud.dataform.v1beta1.CommitAuthor} request.author - * Required. The author of any merge commit which may be created as a result of merging - * fetched Git commits into this workspace. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.pull_git_commits.js - * region_tag:dataform_v1beta1_generated_Dataform_PullGitCommits_async - */ - pullGitCommits( - request?: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|undefined, {}|undefined - ]>; - pullGitCommits( - request: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pullGitCommits( - request: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pullGitCommits( - request?: protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPullGitCommitsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pullGitCommits(request, options, callback); - } -/** - * Pushes Git commits from a Workspace to the Repository's remote. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string} [request.remoteBranch] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.push_git_commits.js - * region_tag:dataform_v1beta1_generated_Dataform_PushGitCommits_async - */ - pushGitCommits( - request?: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|undefined, {}|undefined - ]>; - pushGitCommits( - request: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pushGitCommits( - request: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>): void; - pushGitCommits( - request?: protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IPushGitCommitsRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.pushGitCommits(request, options, callback); - } -/** - * Fetches Git statuses for the files in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchFileGitStatusesResponse]{@link google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.fetch_file_git_statuses.js - * region_tag:dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async - */ - fetchFileGitStatuses( - request?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|undefined, {}|undefined - ]>; - fetchFileGitStatuses( - request: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>): void; - fetchFileGitStatuses( - request: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>): void; - fetchFileGitStatuses( - request?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.fetchFileGitStatuses(request, options, callback); - } -/** - * Fetches Git ahead/behind against a remote branch. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string} [request.remoteBranch] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchGitAheadBehindResponse]{@link google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js - * region_tag:dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async - */ - fetchGitAheadBehind( - request?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|undefined, {}|undefined - ]>; - fetchGitAheadBehind( - request: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>): void; - fetchGitAheadBehind( - request: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>): void; - fetchGitAheadBehind( - request?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse, - protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.fetchGitAheadBehind(request, options, callback); - } -/** - * Applies a Git commit for uncommitted files in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {google.cloud.dataform.v1beta1.CommitAuthor} request.author - * Required. The commit's author. - * @param {string} [request.commitMessage] - * Optional. The commit's message. - * @param {string[]} [request.paths] - * Optional. Full file paths to commit including filename, rooted at workspace root. If - * left empty, all files will be committed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.commit_workspace_changes.js - * region_tag:dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async - */ - commitWorkspaceChanges( - request?: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|undefined, {}|undefined - ]>; - commitWorkspaceChanges( - request: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - commitWorkspaceChanges( - request: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - commitWorkspaceChanges( - request?: protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICommitWorkspaceChangesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.commitWorkspaceChanges(request, options, callback); - } -/** - * Performs a Git reset for uncommitted files in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workspace's name. - * @param {string[]} [request.paths] - * 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. - * @param {boolean} [request.clean] - * Optional. If set to true, untracked files will be deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.reset_workspace_changes.js - * region_tag:dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async - */ - resetWorkspaceChanges( - request?: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|undefined, {}|undefined - ]>; - resetWorkspaceChanges( - request: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - resetWorkspaceChanges( - request: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): void; - resetWorkspaceChanges( - request?: protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IResetWorkspaceChangesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.resetWorkspaceChanges(request, options, callback); - } -/** - * Fetches Git diff for an uncommitted file in a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [FetchFileDiffResponse]{@link google.cloud.dataform.v1beta1.FetchFileDiffResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.fetch_file_diff.js - * region_tag:dataform_v1beta1_generated_Dataform_FetchFileDiff_async - */ - fetchFileDiff( - request?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|undefined, {}|undefined - ]>; - fetchFileDiff( - request: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>): void; - fetchFileDiff( - request: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>): void; - fetchFileDiff( - request?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse, - protos.google.cloud.dataform.v1beta1.IFetchFileDiffRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.fetchFileDiff(request, options, callback); - } -/** - * Creates a directory inside a Workspace. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The directory's full path including directory name, relative to the - * workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MakeDirectoryResponse]{@link google.cloud.dataform.v1beta1.MakeDirectoryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.make_directory.js - * region_tag:dataform_v1beta1_generated_Dataform_MakeDirectory_async - */ - makeDirectory( - request?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|undefined, {}|undefined - ]>; - makeDirectory( - request: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>): void; - makeDirectory( - request: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>): void; - makeDirectory( - request?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMakeDirectoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.makeDirectory(request, options, callback); - } -/** - * Deletes a directory (inside a Workspace) and all of its contents. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The directory's full path including directory name, relative to the - * workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.remove_directory.js - * region_tag:dataform_v1beta1_generated_Dataform_RemoveDirectory_async - */ - removeDirectory( - request?: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|undefined, {}|undefined - ]>; - removeDirectory( - request: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - removeDirectory( - request: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - removeDirectory( - request?: protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveDirectoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.removeDirectory(request, options, callback); - } -/** - * Moves a directory (inside a Workspace), and all of its contents, to a new - * location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The directory's full path including directory name, relative to the - * workspace root. - * @param {string} request.newPath - * Required. The new path for the directory including directory name, rooted at - * workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MoveDirectoryResponse]{@link google.cloud.dataform.v1beta1.MoveDirectoryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.move_directory.js - * region_tag:dataform_v1beta1_generated_Dataform_MoveDirectory_async - */ - moveDirectory( - request?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|undefined, {}|undefined - ]>; - moveDirectory( - request: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - moveDirectory( - request: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>): void; - moveDirectory( - request?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse, - protos.google.cloud.dataform.v1beta1.IMoveDirectoryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.moveDirectory(request, options, callback); - } -/** - * Returns the contents of a file (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ReadFileResponse]{@link google.cloud.dataform.v1beta1.ReadFileResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.read_file.js - * region_tag:dataform_v1beta1_generated_Dataform_ReadFile_async - */ - readFile( - request?: protos.google.cloud.dataform.v1beta1.IReadFileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IReadFileResponse, - protos.google.cloud.dataform.v1beta1.IReadFileRequest|undefined, {}|undefined - ]>; - readFile( - request: protos.google.cloud.dataform.v1beta1.IReadFileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IReadFileResponse, - protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, - {}|null|undefined>): void; - readFile( - request: protos.google.cloud.dataform.v1beta1.IReadFileRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IReadFileResponse, - protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, - {}|null|undefined>): void; - readFile( - request?: protos.google.cloud.dataform.v1beta1.IReadFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IReadFileResponse, - protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IReadFileResponse, - protos.google.cloud.dataform.v1beta1.IReadFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IReadFileResponse, - protos.google.cloud.dataform.v1beta1.IReadFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.readFile(request, options, callback); - } -/** - * Deletes a file (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.remove_file.js - * region_tag:dataform_v1beta1_generated_Dataform_RemoveFile_async - */ - removeFile( - request?: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|undefined, {}|undefined - ]>; - removeFile( - request: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, - {}|null|undefined>): void; - removeFile( - request: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, - {}|null|undefined>): void; - removeFile( - request?: protos.google.cloud.dataform.v1beta1.IRemoveFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IRemoveFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.removeFile(request, options, callback); - } -/** - * Moves a file (inside a Workspace) to a new location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file's full path including filename, relative to the workspace root. - * @param {string} request.newPath - * Required. The file's new path including filename, relative to the workspace root. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [MoveFileResponse]{@link google.cloud.dataform.v1beta1.MoveFileResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.move_file.js - * region_tag:dataform_v1beta1_generated_Dataform_MoveFile_async - */ - moveFile( - request?: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IMoveFileResponse, - protos.google.cloud.dataform.v1beta1.IMoveFileRequest|undefined, {}|undefined - ]>; - moveFile( - request: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IMoveFileResponse, - protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, - {}|null|undefined>): void; - moveFile( - request: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IMoveFileResponse, - protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, - {}|null|undefined>): void; - moveFile( - request?: protos.google.cloud.dataform.v1beta1.IMoveFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IMoveFileResponse, - protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IMoveFileResponse, - protos.google.cloud.dataform.v1beta1.IMoveFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IMoveFileResponse, - protos.google.cloud.dataform.v1beta1.IMoveFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.moveFile(request, options, callback); - } -/** - * Writes to a file (inside a Workspace). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} request.path - * Required. The file. - * @param {Buffer} request.contents - * Required. The file's contents. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WriteFileResponse]{@link google.cloud.dataform.v1beta1.WriteFileResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.write_file.js - * region_tag:dataform_v1beta1_generated_Dataform_WriteFile_async - */ - writeFile( - request?: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWriteFileResponse, - protos.google.cloud.dataform.v1beta1.IWriteFileRequest|undefined, {}|undefined - ]>; - writeFile( - request: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWriteFileResponse, - protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, - {}|null|undefined>): void; - writeFile( - request: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWriteFileResponse, - protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, - {}|null|undefined>): void; - writeFile( - request?: protos.google.cloud.dataform.v1beta1.IWriteFileRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IWriteFileResponse, - protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IWriteFileResponse, - protos.google.cloud.dataform.v1beta1.IWriteFileRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWriteFileResponse, - protos.google.cloud.dataform.v1beta1.IWriteFileRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.writeFile(request, options, callback); - } -/** - * Fetches a single CompilationResult. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.get_compilation_result.js - * region_tag:dataform_v1beta1_generated_Dataform_GetCompilationResult_async - */ - getCompilationResult( - request?: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|undefined, {}|undefined - ]>; - getCompilationResult( - request: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - getCompilationResult( - request: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - getCompilationResult( - request?: protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.IGetCompilationResultRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getCompilationResult(request, options, callback); - } -/** - * Creates a new CompilationResult in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to create the compilation result. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {google.cloud.dataform.v1beta1.CompilationResult} request.compilationResult - * Required. The compilation result to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.create_compilation_result.js - * region_tag:dataform_v1beta1_generated_Dataform_CreateCompilationResult_async - */ - createCompilationResult( - request?: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|undefined, {}|undefined - ]>; - createCompilationResult( - request: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - createCompilationResult( - request: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>): void; - createCompilationResult( - request?: protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResult, - protos.google.cloud.dataform.v1beta1.ICreateCompilationResultRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createCompilationResult(request, options, callback); - } -/** - * Fetches a single WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.get_workflow_invocation.js - * region_tag:dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async - */ - getWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|undefined, {}|undefined - ]>; - getWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - getWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - getWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.IGetWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getWorkflowInvocation(request, options, callback); - } -/** - * Creates a new WorkflowInvocation in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to create the workflow invocation. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {google.cloud.dataform.v1beta1.WorkflowInvocation} request.workflowInvocation - * Required. The workflow invocation resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.create_workflow_invocation.js - * region_tag:dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async - */ - createWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|undefined, {}|undefined - ]>; - createWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - createWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, - callback: Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - createWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation, - protos.google.cloud.dataform.v1beta1.ICreateWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createWorkflowInvocation(request, options, callback); - } -/** - * Deletes a single WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.delete_workflow_invocation.js - * region_tag:dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async - */ - deleteWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|undefined, {}|undefined - ]>; - deleteWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.IDeleteWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteWorkflowInvocation(request, options, callback); - } -/** - * Requests cancellation of a running WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation resource's name. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.cancel_workflow_invocation.js - * region_tag:dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async - */ - cancelWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|undefined, {}|undefined - ]>; - cancelWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - cancelWorkflowInvocation( - request: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): void; - cancelWorkflowInvocation( - request?: protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataform.v1beta1.ICancelWorkflowInvocationRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.cancelWorkflowInvocation(request, options, callback); - } - - /** - * Lists Repositories in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Repository]{@link google.cloud.dataform.v1beta1.Repository}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listRepositoriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listRepositories( - request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository[], - protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest|null, - protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse - ]>; - listRepositories( - request: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IRepository>): void; - listRepositories( - request: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IRepository>): void; - listRepositories( - request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IRepository>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IRepository>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IRepository[], - protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest|null, - protos.google.cloud.dataform.v1beta1.IListRepositoriesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listRepositories(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Repository]{@link google.cloud.dataform.v1beta1.Repository} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listRepositoriesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listRepositoriesStream( - request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listRepositories']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRepositories.createStream( - this.innerApiCalls.listRepositories as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listRepositories`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Repository]{@link google.cloud.dataform.v1beta1.Repository}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.list_repositories.js - * region_tag:dataform_v1beta1_generated_Dataform_ListRepositories_async - */ - listRepositoriesAsync( - request?: protos.google.cloud.dataform.v1beta1.IListRepositoriesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listRepositories']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listRepositories.asyncIterate( - this.innerApiCalls['listRepositories'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Workspaces in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listWorkspacesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkspaces( - request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkspace[], - protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest|null, - protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse - ]>; - listWorkspaces( - request: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkspace>): void; - listWorkspaces( - request: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkspace>): void; - listWorkspaces( - request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkspace>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkspace>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkspace[], - protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest|null, - protos.google.cloud.dataform.v1beta1.IListWorkspacesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listWorkspaces(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [Workspace]{@link google.cloud.dataform.v1beta1.Workspace} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listWorkspacesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkspacesStream( - request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkspaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkspaces.createStream( - this.innerApiCalls.listWorkspaces as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkspaces`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list workspaces. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * Optional. Maximum number of workspaces to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.orderBy] - * 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. - * @param {string} [request.filter] - * Optional. Filter for the returned list. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Workspace]{@link google.cloud.dataform.v1beta1.Workspace}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.list_workspaces.js - * region_tag:dataform_v1beta1_generated_Dataform_ListWorkspaces_async - */ - listWorkspacesAsync( - request?: protos.google.cloud.dataform.v1beta1.IListWorkspacesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkspaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkspaces.asyncIterate( - this.innerApiCalls['listWorkspaces'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns the contents of a given Workspace directory. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} [request.path] - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - * @param {number} [request.pageSize] - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DirectoryEntry]{@link google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `queryDirectoryContentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryDirectoryContents( - request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[], - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest|null, - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse - ]>; - queryDirectoryContents( - request: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>): void; - queryDirectoryContents( - request: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>): void; - queryDirectoryContents( - request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry>): - Promise<[ - protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[], - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest|null, - protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - this.initialize(); - return this.innerApiCalls.queryDirectoryContents(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} [request.path] - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - * @param {number} [request.pageSize] - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [DirectoryEntry]{@link google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `queryDirectoryContentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryDirectoryContentsStream( - request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - const defaultCallSettings = this._defaults['queryDirectoryContents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryDirectoryContents.createStream( - this.innerApiCalls.queryDirectoryContents as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryDirectoryContents`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.workspace - * Required. The workspace's name. - * @param {string} [request.path] - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - * @param {number} [request.pageSize] - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [DirectoryEntry]{@link google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.query_directory_contents.js - * region_tag:dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async - */ - queryDirectoryContentsAsync( - request?: protos.google.cloud.dataform.v1beta1.IQueryDirectoryContentsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'workspace': request.workspace || '', - }); - const defaultCallSettings = this._defaults['queryDirectoryContents']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryDirectoryContents.asyncIterate( - this.innerApiCalls['queryDirectoryContents'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists CompilationResults in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listCompilationResultsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCompilationResults( - request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResult[], - protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest|null, - protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse - ]>; - listCompilationResults( - request: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResult>): void; - listCompilationResults( - request: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResult>): void; - listCompilationResults( - request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResult>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResult>): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResult[], - protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest|null, - protos.google.cloud.dataform.v1beta1.IListCompilationResultsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listCompilationResults(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listCompilationResultsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listCompilationResultsStream( - request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCompilationResults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCompilationResults.createStream( - this.innerApiCalls.listCompilationResults as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listCompilationResults`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The repository in which to list compilation results. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CompilationResult]{@link google.cloud.dataform.v1beta1.CompilationResult}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.list_compilation_results.js - * region_tag:dataform_v1beta1_generated_Dataform_ListCompilationResults_async - */ - listCompilationResultsAsync( - request?: protos.google.cloud.dataform.v1beta1.IListCompilationResultsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listCompilationResults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listCompilationResults.asyncIterate( - this.innerApiCalls['listCompilationResults'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns CompilationResultActions in a given CompilationResult. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.filter] - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [CompilationResultAction]{@link google.cloud.dataform.v1beta1.CompilationResultAction}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `queryCompilationResultActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryCompilationResultActions( - request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResultAction[], - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest|null, - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse - ]>; - queryCompilationResultActions( - request: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResultAction>): void; - queryCompilationResultActions( - request: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResultAction>): void; - queryCompilationResultActions( - request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResultAction>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.ICompilationResultAction>): - Promise<[ - protos.google.cloud.dataform.v1beta1.ICompilationResultAction[], - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest|null, - protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.queryCompilationResultActions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.filter] - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [CompilationResultAction]{@link google.cloud.dataform.v1beta1.CompilationResultAction} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `queryCompilationResultActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryCompilationResultActionsStream( - request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryCompilationResultActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryCompilationResultActions.createStream( - this.innerApiCalls.queryCompilationResultActions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryCompilationResultActions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The compilation result's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {string} [request.filter] - * Optional. Optional filter for the returned list. Filtering is only currently - * supported on the `file_path` field. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [CompilationResultAction]{@link google.cloud.dataform.v1beta1.CompilationResultAction}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.query_compilation_result_actions.js - * region_tag:dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async - */ - queryCompilationResultActionsAsync( - request?: protos.google.cloud.dataform.v1beta1.IQueryCompilationResultActionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryCompilationResultActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryCompilationResultActions.asyncIterate( - this.innerApiCalls['queryCompilationResultActions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists WorkflowInvocations in a given Repository. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listWorkflowInvocationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkflowInvocations( - request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[], - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest|null, - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse - ]>; - listWorkflowInvocations( - request: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>): void; - listWorkflowInvocations( - request: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>): void; - listWorkflowInvocations( - request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[], - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest|null, - protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listWorkflowInvocations(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listWorkflowInvocationsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - listWorkflowInvocationsStream( - request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkflowInvocations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkflowInvocations.createStream( - this.innerApiCalls.listWorkflowInvocations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkflowInvocations`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the WorkflowInvocation type. Must be in the - * format `projects/* /locations/* /repositories/*`. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [WorkflowInvocation]{@link google.cloud.dataform.v1beta1.WorkflowInvocation}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.list_workflow_invocations.js - * region_tag:dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async - */ - listWorkflowInvocationsAsync( - request?: protos.google.cloud.dataform.v1beta1.IListWorkflowInvocationsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listWorkflowInvocations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listWorkflowInvocations.asyncIterate( - this.innerApiCalls['listWorkflowInvocations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Returns WorkflowInvocationActions in a given WorkflowInvocation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [WorkflowInvocationAction]{@link google.cloud.dataform.v1beta1.WorkflowInvocationAction}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `queryWorkflowInvocationActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryWorkflowInvocationActions( - request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[], - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest|null, - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse - ]>; - queryWorkflowInvocationActions( - request: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>): void; - queryWorkflowInvocationActions( - request: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - callback: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>): void; - queryWorkflowInvocationActions( - request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>, - callback?: PaginationCallback< - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse|null|undefined, - protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction>): - Promise<[ - protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[], - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest|null, - protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.queryWorkflowInvocationActions(request, options, callback); - } - -/** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing [WorkflowInvocationAction]{@link google.cloud.dataform.v1beta1.WorkflowInvocationAction} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `queryWorkflowInvocationActionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ - queryWorkflowInvocationActionsStream( - request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryWorkflowInvocationActions.createStream( - this.innerApiCalls.queryWorkflowInvocationActions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `queryWorkflowInvocationActions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The workflow invocation's name. - * @param {number} [request.pageSize] - * 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. - * @param {string} [request.pageToken] - * 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. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [WorkflowInvocationAction]{@link google.cloud.dataform.v1beta1.WorkflowInvocationAction}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example include:samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js - * region_tag:dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async - */ - queryWorkflowInvocationActionsAsync( - request?: protos.google.cloud.dataform.v1beta1.IQueryWorkflowInvocationActionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - const defaultCallSettings = this._defaults['queryWorkflowInvocationActions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.queryWorkflowInvocationActions.asyncIterate( - this.innerApiCalls['queryWorkflowInvocationActions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * 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 {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * 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). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * 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 {Object} request - * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * 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). - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). - * When you iterate the returned iterable, each element will be an object representing - * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified compilationResult resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @param {string} compilation_result - * @returns {string} Resource name string. - */ - compilationResultPath(project:string,location:string,repository:string,compilationResult:string) { - return this.pathTemplates.compilationResultPathTemplate.render({ - project: project, - location: location, - repository: repository, - compilation_result: compilationResult, - }); - } - - /** - * Parse the project from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the project. - */ - matchProjectFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).project; - } - - /** - * Parse the location from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the location. - */ - matchLocationFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).location; - } - - /** - * Parse the repository from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).repository; - } - - /** - * Parse the compilation_result from CompilationResult resource. - * - * @param {string} compilationResultName - * A fully-qualified path representing CompilationResult resource. - * @returns {string} A string representing the compilation_result. - */ - matchCompilationResultFromCompilationResultName(compilationResultName: string) { - return this.pathTemplates.compilationResultPathTemplate.match(compilationResultName).compilation_result; - } - - /** - * Return a fully-qualified location resource name string. - * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. - */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ - project: project, - location: location, - }); - } - - /** - * Parse the project from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the project. - */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; - } - - /** - * Parse the location from Location resource. - * - * @param {string} locationName - * A fully-qualified path representing Location resource. - * @returns {string} A string representing the location. - */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; - } - - /** - * Return a fully-qualified repository resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @returns {string} Resource name string. - */ - repositoryPath(project:string,location:string,repository:string) { - return this.pathTemplates.repositoryPathTemplate.render({ - project: project, - location: location, - repository: repository, - }); - } - - /** - * Parse the project from Repository resource. - * - * @param {string} repositoryName - * A fully-qualified path representing Repository resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRepositoryName(repositoryName: string) { - return this.pathTemplates.repositoryPathTemplate.match(repositoryName).project; - } - - /** - * Parse the location from Repository resource. - * - * @param {string} repositoryName - * A fully-qualified path representing Repository resource. - * @returns {string} A string representing the location. - */ - matchLocationFromRepositoryName(repositoryName: string) { - return this.pathTemplates.repositoryPathTemplate.match(repositoryName).location; - } - - /** - * Parse the repository from Repository resource. - * - * @param {string} repositoryName - * A fully-qualified path representing Repository resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromRepositoryName(repositoryName: string) { - return this.pathTemplates.repositoryPathTemplate.match(repositoryName).repository; - } - - /** - * Return a fully-qualified workflowInvocation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @param {string} workflow_invocation - * @returns {string} Resource name string. - */ - workflowInvocationPath(project:string,location:string,repository:string,workflowInvocation:string) { - return this.pathTemplates.workflowInvocationPathTemplate.render({ - project: project, - location: location, - repository: repository, - workflow_invocation: workflowInvocation, - }); - } - - /** - * Parse the project from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).project; - } - - /** - * Parse the location from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).location; - } - - /** - * Parse the repository from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).repository; - } - - /** - * Parse the workflow_invocation from WorkflowInvocation resource. - * - * @param {string} workflowInvocationName - * A fully-qualified path representing WorkflowInvocation resource. - * @returns {string} A string representing the workflow_invocation. - */ - matchWorkflowInvocationFromWorkflowInvocationName(workflowInvocationName: string) { - return this.pathTemplates.workflowInvocationPathTemplate.match(workflowInvocationName).workflow_invocation; - } - - /** - * Return a fully-qualified workspace resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} repository - * @param {string} workspace - * @returns {string} Resource name string. - */ - workspacePath(project:string,location:string,repository:string,workspace:string) { - return this.pathTemplates.workspacePathTemplate.render({ - project: project, - location: location, - repository: repository, - workspace: workspace, - }); - } - - /** - * Parse the project from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the project. - */ - matchProjectFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).project; - } - - /** - * Parse the location from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the location. - */ - matchLocationFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).location; - } - - /** - * Parse the repository from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the repository. - */ - matchRepositoryFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).repository; - } - - /** - * Parse the workspace from Workspace resource. - * - * @param {string} workspaceName - * A fully-qualified path representing Workspace resource. - * @returns {string} A string representing the workspace. - */ - matchWorkspaceFromWorkspaceName(workspaceName: string) { - return this.pathTemplates.workspacePathTemplate.match(workspaceName).workspace; - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.dataformStub && !this._terminated) { - return this.dataformStub.then(stub => { - this._terminated = true; - stub.close(); - this.iamClient.close(); - this.locationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json deleted file mode 100644 index 6e61613..0000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataform_client_config.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataform.v1beta1.Dataform": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListRepositories": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteRepository": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchRemoteBranches": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListWorkspaces": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetWorkspace": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateWorkspace": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteWorkspace": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InstallNpmPackages": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PullGitCommits": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "PushGitCommits": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchFileGitStatuses": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchGitAheadBehind": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CommitWorkspaceChanges": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResetWorkspaceChanges": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchFileDiff": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryDirectoryContents": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MakeDirectory": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveDirectory": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MoveDirectory": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReadFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "MoveFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "WriteFile": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListCompilationResults": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetCompilationResult": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateCompilationResult": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryCompilationResultActions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListWorkflowInvocations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CancelWorkflowInvocation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "QueryWorkflowInvocationActions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json deleted file mode 100644 index 8e9b5e1..0000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/dataform_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/cloud/dataform/v1beta1/dataform.proto" -] diff --git a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 72fc33e..0000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,411 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.dataform.v1beta1", - "libraryPackage": "@google-cloud/dataform", - "services": { - "Dataform": { - "clients": { - "grpc": { - "libraryClient": "DataformClient", - "rpcs": { - "GetRepository": { - "methods": [ - "getRepository" - ] - }, - "CreateRepository": { - "methods": [ - "createRepository" - ] - }, - "UpdateRepository": { - "methods": [ - "updateRepository" - ] - }, - "DeleteRepository": { - "methods": [ - "deleteRepository" - ] - }, - "FetchRemoteBranches": { - "methods": [ - "fetchRemoteBranches" - ] - }, - "GetWorkspace": { - "methods": [ - "getWorkspace" - ] - }, - "CreateWorkspace": { - "methods": [ - "createWorkspace" - ] - }, - "DeleteWorkspace": { - "methods": [ - "deleteWorkspace" - ] - }, - "InstallNpmPackages": { - "methods": [ - "installNpmPackages" - ] - }, - "PullGitCommits": { - "methods": [ - "pullGitCommits" - ] - }, - "PushGitCommits": { - "methods": [ - "pushGitCommits" - ] - }, - "FetchFileGitStatuses": { - "methods": [ - "fetchFileGitStatuses" - ] - }, - "FetchGitAheadBehind": { - "methods": [ - "fetchGitAheadBehind" - ] - }, - "CommitWorkspaceChanges": { - "methods": [ - "commitWorkspaceChanges" - ] - }, - "ResetWorkspaceChanges": { - "methods": [ - "resetWorkspaceChanges" - ] - }, - "FetchFileDiff": { - "methods": [ - "fetchFileDiff" - ] - }, - "MakeDirectory": { - "methods": [ - "makeDirectory" - ] - }, - "RemoveDirectory": { - "methods": [ - "removeDirectory" - ] - }, - "MoveDirectory": { - "methods": [ - "moveDirectory" - ] - }, - "ReadFile": { - "methods": [ - "readFile" - ] - }, - "RemoveFile": { - "methods": [ - "removeFile" - ] - }, - "MoveFile": { - "methods": [ - "moveFile" - ] - }, - "WriteFile": { - "methods": [ - "writeFile" - ] - }, - "GetCompilationResult": { - "methods": [ - "getCompilationResult" - ] - }, - "CreateCompilationResult": { - "methods": [ - "createCompilationResult" - ] - }, - "GetWorkflowInvocation": { - "methods": [ - "getWorkflowInvocation" - ] - }, - "CreateWorkflowInvocation": { - "methods": [ - "createWorkflowInvocation" - ] - }, - "DeleteWorkflowInvocation": { - "methods": [ - "deleteWorkflowInvocation" - ] - }, - "CancelWorkflowInvocation": { - "methods": [ - "cancelWorkflowInvocation" - ] - }, - "ListRepositories": { - "methods": [ - "listRepositories", - "listRepositoriesStream", - "listRepositoriesAsync" - ] - }, - "ListWorkspaces": { - "methods": [ - "listWorkspaces", - "listWorkspacesStream", - "listWorkspacesAsync" - ] - }, - "QueryDirectoryContents": { - "methods": [ - "queryDirectoryContents", - "queryDirectoryContentsStream", - "queryDirectoryContentsAsync" - ] - }, - "ListCompilationResults": { - "methods": [ - "listCompilationResults", - "listCompilationResultsStream", - "listCompilationResultsAsync" - ] - }, - "QueryCompilationResultActions": { - "methods": [ - "queryCompilationResultActions", - "queryCompilationResultActionsStream", - "queryCompilationResultActionsAsync" - ] - }, - "ListWorkflowInvocations": { - "methods": [ - "listWorkflowInvocations", - "listWorkflowInvocationsStream", - "listWorkflowInvocationsAsync" - ] - }, - "QueryWorkflowInvocationActions": { - "methods": [ - "queryWorkflowInvocationActions", - "queryWorkflowInvocationActionsStream", - "queryWorkflowInvocationActionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DataformClient", - "rpcs": { - "GetRepository": { - "methods": [ - "getRepository" - ] - }, - "CreateRepository": { - "methods": [ - "createRepository" - ] - }, - "UpdateRepository": { - "methods": [ - "updateRepository" - ] - }, - "DeleteRepository": { - "methods": [ - "deleteRepository" - ] - }, - "FetchRemoteBranches": { - "methods": [ - "fetchRemoteBranches" - ] - }, - "GetWorkspace": { - "methods": [ - "getWorkspace" - ] - }, - "CreateWorkspace": { - "methods": [ - "createWorkspace" - ] - }, - "DeleteWorkspace": { - "methods": [ - "deleteWorkspace" - ] - }, - "InstallNpmPackages": { - "methods": [ - "installNpmPackages" - ] - }, - "PullGitCommits": { - "methods": [ - "pullGitCommits" - ] - }, - "PushGitCommits": { - "methods": [ - "pushGitCommits" - ] - }, - "FetchFileGitStatuses": { - "methods": [ - "fetchFileGitStatuses" - ] - }, - "FetchGitAheadBehind": { - "methods": [ - "fetchGitAheadBehind" - ] - }, - "CommitWorkspaceChanges": { - "methods": [ - "commitWorkspaceChanges" - ] - }, - "ResetWorkspaceChanges": { - "methods": [ - "resetWorkspaceChanges" - ] - }, - "FetchFileDiff": { - "methods": [ - "fetchFileDiff" - ] - }, - "MakeDirectory": { - "methods": [ - "makeDirectory" - ] - }, - "RemoveDirectory": { - "methods": [ - "removeDirectory" - ] - }, - "MoveDirectory": { - "methods": [ - "moveDirectory" - ] - }, - "ReadFile": { - "methods": [ - "readFile" - ] - }, - "RemoveFile": { - "methods": [ - "removeFile" - ] - }, - "MoveFile": { - "methods": [ - "moveFile" - ] - }, - "WriteFile": { - "methods": [ - "writeFile" - ] - }, - "GetCompilationResult": { - "methods": [ - "getCompilationResult" - ] - }, - "CreateCompilationResult": { - "methods": [ - "createCompilationResult" - ] - }, - "GetWorkflowInvocation": { - "methods": [ - "getWorkflowInvocation" - ] - }, - "CreateWorkflowInvocation": { - "methods": [ - "createWorkflowInvocation" - ] - }, - "DeleteWorkflowInvocation": { - "methods": [ - "deleteWorkflowInvocation" - ] - }, - "CancelWorkflowInvocation": { - "methods": [ - "cancelWorkflowInvocation" - ] - }, - "ListRepositories": { - "methods": [ - "listRepositories", - "listRepositoriesStream", - "listRepositoriesAsync" - ] - }, - "ListWorkspaces": { - "methods": [ - "listWorkspaces", - "listWorkspacesStream", - "listWorkspacesAsync" - ] - }, - "QueryDirectoryContents": { - "methods": [ - "queryDirectoryContents", - "queryDirectoryContentsStream", - "queryDirectoryContentsAsync" - ] - }, - "ListCompilationResults": { - "methods": [ - "listCompilationResults", - "listCompilationResultsStream", - "listCompilationResultsAsync" - ] - }, - "QueryCompilationResultActions": { - "methods": [ - "queryCompilationResultActions", - "queryCompilationResultActionsStream", - "queryCompilationResultActionsAsync" - ] - }, - "ListWorkflowInvocations": { - "methods": [ - "listWorkflowInvocations", - "listWorkflowInvocationsStream", - "listWorkflowInvocationsAsync" - ] - }, - "QueryWorkflowInvocationActions": { - "methods": [ - "queryWorkflowInvocationActions", - "queryWorkflowInvocationActionsStream", - "queryWorkflowInvocationActionsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index a1e4487..0000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DataformClient} from './dataform_client'; diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 5955dff..0000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const dataform = require('@google-cloud/dataform'); - -function main() { - const dataformClient = new dataform.DataformClient(); -} - -main(); diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 3f49bdd..0000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {DataformClient} from '@google-cloud/dataform'; - -// check that the client class type name can be used -function doStuffWithDataformClient(client: DataformClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const dataformClient = new DataformClient(); - doStuffWithDataformClient(dataformClient); -} - -main(); diff --git a/owl-bot-staging/v1beta1/system-test/install.ts b/owl-bot-staging/v1beta1/system-test/install.ts deleted file mode 100644 index 557a575..0000000 --- a/owl-bot-staging/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts deleted file mode 100644 index 8254cc4..0000000 --- a/owl-bot-staging/v1beta1/test/gapic_dataform_v1beta1.ts +++ /dev/null @@ -1,5251 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import {describe, it} from 'mocha'; -import * as dataformModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1beta1.DataformClient', () => { - describe('Common methods', () => { - it('has servicePath', () => { - const servicePath = dataformModule.v1beta1.DataformClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = dataformModule.v1beta1.DataformClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = dataformModule.v1beta1.DataformClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new dataformModule.v1beta1.DataformClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new dataformModule.v1beta1.DataformClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataformStub, undefined); - await client.initialize(); - assert(client.dataformStub); - }); - - it('has close method for the initialized client', done => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.dataformStub); - client.close().then(() => { - done(); - }); - }); - - it('has close method for the non-initialized client', done => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataformStub, undefined); - client.close().then(() => { - done(); - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - }); - - describe('getRepository', () => { - it('invokes getRepository without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); - client.innerApiCalls.getRepository = stubSimpleCall(expectedResponse); - const [response] = await client.getRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getRepository without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); - client.innerApiCalls.getRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getRepository( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getRepository with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getRepository(request), expectedError); - assert((client.innerApiCalls.getRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getRepository with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetRepositoryRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getRepository(request), expectedError); - }); - }); - - describe('createRepository', () => { - it('invokes createRepository without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); - client.innerApiCalls.createRepository = stubSimpleCall(expectedResponse); - const [response] = await client.createRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createRepository without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); - client.innerApiCalls.createRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createRepository( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createRepository with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createRepository(request), expectedError); - assert((client.innerApiCalls.createRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createRepository with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateRepositoryRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createRepository(request), expectedError); - }); - }); - - describe('updateRepository', () => { - it('invokes updateRepository without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedHeaderRequestParams = "repository.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); - client.innerApiCalls.updateRepository = stubSimpleCall(expectedResponse); - const [response] = await client.updateRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateRepository without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedHeaderRequestParams = "repository.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()); - client.innerApiCalls.updateRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateRepository( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateRepository with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedHeaderRequestParams = "repository.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateRepository(request), expectedError); - assert((client.innerApiCalls.updateRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateRepository with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.UpdateRepositoryRequest()); - request.repository = {}; - request.repository.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.updateRepository(request), expectedError); - }); - }); - - describe('deleteRepository', () => { - it('invokes deleteRepository without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteRepository = stubSimpleCall(expectedResponse); - const [response] = await client.deleteRepository(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteRepository without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteRepository = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteRepository( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteRepository with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteRepository = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteRepository(request), expectedError); - assert((client.innerApiCalls.deleteRepository as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteRepository with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteRepositoryRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteRepository(request), expectedError); - }); - }); - - describe('fetchRemoteBranches', () => { - it('invokes fetchRemoteBranches without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse()); - client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(expectedResponse); - const [response] = await client.fetchRemoteBranches(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchRemoteBranches without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesResponse()); - client.innerApiCalls.fetchRemoteBranches = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchRemoteBranches( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchRemoteBranchesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchRemoteBranches with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchRemoteBranches = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchRemoteBranches(request), expectedError); - assert((client.innerApiCalls.fetchRemoteBranches as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchRemoteBranches with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchRemoteBranchesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchRemoteBranches(request), expectedError); - }); - }); - - describe('getWorkspace', () => { - it('invokes getWorkspace without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); - client.innerApiCalls.getWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkspace without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); - client.innerApiCalls.getWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkspace( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkspace|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getWorkspace with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkspace(request), expectedError); - assert((client.innerApiCalls.getWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkspace with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkspaceRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getWorkspace(request), expectedError); - }); - }); - - describe('createWorkspace', () => { - it('invokes createWorkspace without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); - client.innerApiCalls.createWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.createWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkspace without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()); - client.innerApiCalls.createWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkspace( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkspace|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createWorkspace with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createWorkspace(request), expectedError); - assert((client.innerApiCalls.createWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkspace with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkspaceRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createWorkspace(request), expectedError); - }); - }); - - describe('deleteWorkspace', () => { - it('invokes deleteWorkspace without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkspace = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkspace(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkspace without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkspace = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkspace( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteWorkspace with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkspace = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteWorkspace(request), expectedError); - assert((client.innerApiCalls.deleteWorkspace as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkspace with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkspaceRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteWorkspace(request), expectedError); - }); - }); - - describe('installNpmPackages', () => { - it('invokes installNpmPackages without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesResponse()); - client.innerApiCalls.installNpmPackages = stubSimpleCall(expectedResponse); - const [response] = await client.installNpmPackages(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.installNpmPackages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes installNpmPackages without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesResponse()); - client.innerApiCalls.installNpmPackages = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.installNpmPackages( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IInstallNpmPackagesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.installNpmPackages as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes installNpmPackages with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.installNpmPackages = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.installNpmPackages(request), expectedError); - assert((client.innerApiCalls.installNpmPackages as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes installNpmPackages with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.InstallNpmPackagesRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.installNpmPackages(request), expectedError); - }); - }); - - describe('pullGitCommits', () => { - it('invokes pullGitCommits without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pullGitCommits = stubSimpleCall(expectedResponse); - const [response] = await client.pullGitCommits(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pullGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pullGitCommits without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pullGitCommits = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pullGitCommits( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pullGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pullGitCommits with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pullGitCommits = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pullGitCommits(request), expectedError); - assert((client.innerApiCalls.pullGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pullGitCommits with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PullGitCommitsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pullGitCommits(request), expectedError); - }); - }); - - describe('pushGitCommits', () => { - it('invokes pushGitCommits without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pushGitCommits = stubSimpleCall(expectedResponse); - const [response] = await client.pushGitCommits(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pushGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pushGitCommits without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.pushGitCommits = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.pushGitCommits( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.pushGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes pushGitCommits with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.pushGitCommits = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.pushGitCommits(request), expectedError); - assert((client.innerApiCalls.pushGitCommits as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes pushGitCommits with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.PushGitCommitsRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.pushGitCommits(request), expectedError); - }); - }); - - describe('fetchFileGitStatuses', () => { - it('invokes fetchFileGitStatuses without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse()); - client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(expectedResponse); - const [response] = await client.fetchFileGitStatuses(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileGitStatuses without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesResponse()); - client.innerApiCalls.fetchFileGitStatuses = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchFileGitStatuses( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchFileGitStatusesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchFileGitStatuses with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchFileGitStatuses = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchFileGitStatuses(request), expectedError); - assert((client.innerApiCalls.fetchFileGitStatuses as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileGitStatuses with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileGitStatusesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchFileGitStatuses(request), expectedError); - }); - }); - - describe('fetchGitAheadBehind', () => { - it('invokes fetchGitAheadBehind without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse()); - client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(expectedResponse); - const [response] = await client.fetchGitAheadBehind(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchGitAheadBehind without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindResponse()); - client.innerApiCalls.fetchGitAheadBehind = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchGitAheadBehind( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchGitAheadBehindResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchGitAheadBehind with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchGitAheadBehind = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchGitAheadBehind(request), expectedError); - assert((client.innerApiCalls.fetchGitAheadBehind as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchGitAheadBehind with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchGitAheadBehindRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchGitAheadBehind(request), expectedError); - }); - }); - - describe('commitWorkspaceChanges', () => { - it('invokes commitWorkspaceChanges without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(expectedResponse); - const [response] = await client.commitWorkspaceChanges(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes commitWorkspaceChanges without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.commitWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commitWorkspaceChanges( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes commitWorkspaceChanges with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.commitWorkspaceChanges = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commitWorkspaceChanges(request), expectedError); - assert((client.innerApiCalls.commitWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes commitWorkspaceChanges with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CommitWorkspaceChangesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.commitWorkspaceChanges(request), expectedError); - }); - }); - - describe('resetWorkspaceChanges', () => { - it('invokes resetWorkspaceChanges without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(expectedResponse); - const [response] = await client.resetWorkspaceChanges(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resetWorkspaceChanges without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.resetWorkspaceChanges = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resetWorkspaceChanges( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes resetWorkspaceChanges with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.resetWorkspaceChanges = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.resetWorkspaceChanges(request), expectedError); - assert((client.innerApiCalls.resetWorkspaceChanges as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes resetWorkspaceChanges with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ResetWorkspaceChangesRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.resetWorkspaceChanges(request), expectedError); - }); - }); - - describe('fetchFileDiff', () => { - it('invokes fetchFileDiff without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffResponse()); - client.innerApiCalls.fetchFileDiff = stubSimpleCall(expectedResponse); - const [response] = await client.fetchFileDiff(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileDiff as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileDiff without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffResponse()); - client.innerApiCalls.fetchFileDiff = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchFileDiff( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IFetchFileDiffResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.fetchFileDiff as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes fetchFileDiff with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchFileDiff = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchFileDiff(request), expectedError); - assert((client.innerApiCalls.fetchFileDiff as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes fetchFileDiff with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.FetchFileDiffRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.fetchFileDiff(request), expectedError); - }); - }); - - describe('makeDirectory', () => { - it('invokes makeDirectory without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryResponse()); - client.innerApiCalls.makeDirectory = stubSimpleCall(expectedResponse); - const [response] = await client.makeDirectory(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.makeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes makeDirectory without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryResponse()); - client.innerApiCalls.makeDirectory = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.makeDirectory( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IMakeDirectoryResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.makeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes makeDirectory with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.makeDirectory = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.makeDirectory(request), expectedError); - assert((client.innerApiCalls.makeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes makeDirectory with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MakeDirectoryRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.makeDirectory(request), expectedError); - }); - }); - - describe('removeDirectory', () => { - it('invokes removeDirectory without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeDirectory = stubSimpleCall(expectedResponse); - const [response] = await client.removeDirectory(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeDirectory without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeDirectory = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeDirectory( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeDirectory with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeDirectory = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeDirectory(request), expectedError); - assert((client.innerApiCalls.removeDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeDirectory with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveDirectoryRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeDirectory(request), expectedError); - }); - }); - - describe('moveDirectory', () => { - it('invokes moveDirectory without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryResponse()); - client.innerApiCalls.moveDirectory = stubSimpleCall(expectedResponse); - const [response] = await client.moveDirectory(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveDirectory without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryResponse()); - client.innerApiCalls.moveDirectory = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.moveDirectory( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IMoveDirectoryResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes moveDirectory with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.moveDirectory = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.moveDirectory(request), expectedError); - assert((client.innerApiCalls.moveDirectory as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveDirectory with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveDirectoryRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.moveDirectory(request), expectedError); - }); - }); - - describe('readFile', () => { - it('invokes readFile without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileResponse()); - client.innerApiCalls.readFile = stubSimpleCall(expectedResponse); - const [response] = await client.readFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFile without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileResponse()); - client.innerApiCalls.readFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.readFile( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IReadFileResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.readFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes readFile with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.readFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.readFile(request), expectedError); - assert((client.innerApiCalls.readFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes readFile with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ReadFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.readFile(request), expectedError); - }); - }); - - describe('removeFile', () => { - it('invokes removeFile without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeFile = stubSimpleCall(expectedResponse); - const [response] = await client.removeFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeFile without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.removeFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeFile( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeFile with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeFile(request), expectedError); - assert((client.innerApiCalls.removeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeFile with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.RemoveFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.removeFile(request), expectedError); - }); - }); - - describe('moveFile', () => { - it('invokes moveFile without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileResponse()); - client.innerApiCalls.moveFile = stubSimpleCall(expectedResponse); - const [response] = await client.moveFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveFile without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileResponse()); - client.innerApiCalls.moveFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.moveFile( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IMoveFileResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.moveFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes moveFile with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.moveFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.moveFile(request), expectedError); - assert((client.innerApiCalls.moveFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes moveFile with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.MoveFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.moveFile(request), expectedError); - }); - }); - - describe('writeFile', () => { - it('invokes writeFile without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileResponse()); - client.innerApiCalls.writeFile = stubSimpleCall(expectedResponse); - const [response] = await client.writeFile(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeFile without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileResponse()); - client.innerApiCalls.writeFile = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.writeFile( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWriteFileResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.writeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes writeFile with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.writeFile = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.writeFile(request), expectedError); - assert((client.innerApiCalls.writeFile as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes writeFile with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WriteFileRequest()); - request.workspace = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.writeFile(request), expectedError); - }); - }); - - describe('getCompilationResult', () => { - it('invokes getCompilationResult without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); - client.innerApiCalls.getCompilationResult = stubSimpleCall(expectedResponse); - const [response] = await client.getCompilationResult(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCompilationResult without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); - client.innerApiCalls.getCompilationResult = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCompilationResult( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResult|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getCompilationResult with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getCompilationResult = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCompilationResult(request), expectedError); - assert((client.innerApiCalls.getCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getCompilationResult with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetCompilationResultRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getCompilationResult(request), expectedError); - }); - }); - - describe('createCompilationResult', () => { - it('invokes createCompilationResult without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); - client.innerApiCalls.createCompilationResult = stubSimpleCall(expectedResponse); - const [response] = await client.createCompilationResult(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCompilationResult without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()); - client.innerApiCalls.createCompilationResult = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCompilationResult( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResult|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createCompilationResult with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createCompilationResult = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createCompilationResult(request), expectedError); - assert((client.innerApiCalls.createCompilationResult as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createCompilationResult with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateCompilationResultRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createCompilationResult(request), expectedError); - }); - }); - - describe('getWorkflowInvocation', () => { - it('invokes getWorkflowInvocation without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); - client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); - client.innerApiCalls.getWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getWorkflowInvocation with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.getWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.GetWorkflowInvocationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.getWorkflowInvocation(request), expectedError); - }); - }); - - describe('createWorkflowInvocation', () => { - it('invokes createWorkflowInvocation without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); - client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.createWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()); - client.innerApiCalls.createWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createWorkflowInvocation with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.createWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CreateWorkflowInvocationRequest()); - request.parent = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.createWorkflowInvocation(request), expectedError); - }); - }); - - describe('deleteWorkflowInvocation', () => { - it('invokes deleteWorkflowInvocation without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteWorkflowInvocation with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.deleteWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.DeleteWorkflowInvocationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.deleteWorkflowInvocation(request), expectedError); - }); - }); - - describe('cancelWorkflowInvocation', () => { - it('invokes cancelWorkflowInvocation without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(expectedResponse); - const [response] = await client.cancelWorkflowInvocation(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelWorkflowInvocation without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.protobuf.Empty()); - client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelWorkflowInvocation( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes cancelWorkflowInvocation with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelWorkflowInvocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); - assert((client.innerApiCalls.cancelWorkflowInvocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes cancelWorkflowInvocation with closed client', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CancelWorkflowInvocationRequest()); - request.name = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.cancelWorkflowInvocation(request), expectedError); - }); - }); - - describe('listRepositories', () => { - it('invokes listRepositories without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - ]; - client.innerApiCalls.listRepositories = stubSimpleCall(expectedResponse); - const [response] = await client.listRepositories(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listRepositories as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listRepositories without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - ]; - client.innerApiCalls.listRepositories = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listRepositories( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IRepository[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listRepositories as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listRepositories with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listRepositories = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listRepositories(request), expectedError); - assert((client.innerApiCalls.listRepositories as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listRepositoriesStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - ]; - client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listRepositoriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.Repository[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Repository) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); - assert.strictEqual( - (client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listRepositoriesStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listRepositories.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listRepositoriesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.Repository[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Repository) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listRepositories, request)); - assert.strictEqual( - (client.descriptors.page.listRepositories.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listRepositories without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Repository()), - ]; - client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.IRepository[] = []; - const iterable = client.listRepositoriesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listRepositories with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListRepositoriesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listRepositories.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listRepositoriesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.IRepository[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listRepositories.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listWorkspaces', () => { - it('invokes listWorkspaces without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - ]; - client.innerApiCalls.listWorkspaces = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkspaces(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkspaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkspaces without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - ]; - client.innerApiCalls.listWorkspaces = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkspaces( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkspace[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkspaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listWorkspaces with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkspaces = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkspaces(request), expectedError); - assert((client.innerApiCalls.listWorkspaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkspacesStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - ]; - client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkspacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.Workspace[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Workspace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listWorkspacesStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkspacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.Workspace[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.Workspace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkspaces, request)); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkspaces without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.Workspace()), - ]; - client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.IWorkspace[] = []; - const iterable = client.listWorkspacesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkspaces with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkspacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkspacesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.IWorkspace[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkspaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('queryDirectoryContents', () => { - it('invokes queryDirectoryContents without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.innerApiCalls.queryDirectoryContents = stubSimpleCall(expectedResponse); - const [response] = await client.queryDirectoryContents(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryDirectoryContents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryDirectoryContents without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.innerApiCalls.queryDirectoryContents = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryDirectoryContents( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryDirectoryContents as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryDirectoryContents with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryDirectoryContents = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryDirectoryContents(request), expectedError); - assert((client.innerApiCalls.queryDirectoryContents as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryDirectoryContentsStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryDirectoryContentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes queryDirectoryContentsStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedError = new Error('expected'); - client.descriptors.page.queryDirectoryContents.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryDirectoryContentsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryDirectoryContents, request)); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryDirectoryContents without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.DirectoryEntry()), - ]; - client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; - const iterable = client.queryDirectoryContentsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryDirectoryContents with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsRequest()); - request.workspace = ''; - const expectedHeaderRequestParams = "workspace=";const expectedError = new Error('expected'); - client.descriptors.page.queryDirectoryContents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryDirectoryContentsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.QueryDirectoryContentsResponse.IDirectoryEntry[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryDirectoryContents.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listCompilationResults', () => { - it('invokes listCompilationResults without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - ]; - client.innerApiCalls.listCompilationResults = stubSimpleCall(expectedResponse); - const [response] = await client.listCompilationResults(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCompilationResults as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCompilationResults without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - ]; - client.innerApiCalls.listCompilationResults = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listCompilationResults( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResult[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listCompilationResults as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listCompilationResults with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listCompilationResults = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listCompilationResults(request), expectedError); - assert((client.innerApiCalls.listCompilationResults as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listCompilationResultsStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - ]; - client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listCompilationResultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.CompilationResult[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listCompilationResultsStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listCompilationResults.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listCompilationResultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.CompilationResult[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResult) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listCompilationResults, request)); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCompilationResults without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResult()), - ]; - client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.ICompilationResult[] = []; - const iterable = client.listCompilationResultsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listCompilationResults with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListCompilationResultsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listCompilationResults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listCompilationResultsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.ICompilationResult[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listCompilationResults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('queryCompilationResultActions', () => { - it('invokes queryCompilationResultActions without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - ]; - client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(expectedResponse); - const [response] = await client.queryCompilationResultActions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryCompilationResultActions without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - ]; - client.innerApiCalls.queryCompilationResultActions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryCompilationResultActions( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryCompilationResultActions with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryCompilationResultActions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryCompilationResultActions(request), expectedError); - assert((client.innerApiCalls.queryCompilationResultActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryCompilationResultActionsStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - ]; - client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryCompilationResultActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.CompilationResultAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResultAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes queryCompilationResultActionsStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedError = new Error('expected'); - client.descriptors.page.queryCompilationResultActions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryCompilationResultActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.CompilationResultAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.CompilationResultAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryCompilationResultActions, request)); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryCompilationResultActions without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.CompilationResultAction()), - ]; - client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[] = []; - const iterable = client.queryCompilationResultActionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryCompilationResultActions with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryCompilationResultActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); - client.descriptors.page.queryCompilationResultActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryCompilationResultActionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.ICompilationResultAction[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryCompilationResultActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listWorkflowInvocations', () => { - it('invokes listWorkflowInvocations without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - ]; - client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkflowInvocations(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkflowInvocations without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - ]; - client.innerApiCalls.listWorkflowInvocations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkflowInvocations( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listWorkflowInvocations with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkflowInvocations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkflowInvocations(request), expectedError); - assert((client.innerApiCalls.listWorkflowInvocations as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listWorkflowInvocationsStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - ]; - client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkflowInvocationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocation[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listWorkflowInvocationsStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkflowInvocations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkflowInvocationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocation[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkflowInvocations, request)); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkflowInvocations without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocation()), - ]; - client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[] = []; - const iterable = client.listWorkflowInvocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listWorkflowInvocations with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.ListWorkflowInvocationsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listWorkflowInvocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkflowInvocationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listWorkflowInvocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('queryWorkflowInvocationActions', () => { - it('invokes queryWorkflowInvocationActions without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - ]; - client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(expectedResponse); - const [response] = await client.queryWorkflowInvocationActions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryWorkflowInvocationActions without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - ]; - client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.queryWorkflowInvocationActions( - request, - (err?: Error|null, result?: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes queryWorkflowInvocationActions with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.queryWorkflowInvocationActions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.queryWorkflowInvocationActions(request), expectedError); - assert((client.innerApiCalls.queryWorkflowInvocationActions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes queryWorkflowInvocationActionsStream without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - ]; - client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.queryWorkflowInvocationActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes queryWorkflowInvocationActionsStream with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedError = new Error('expected'); - client.descriptors.page.queryWorkflowInvocationActions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.queryWorkflowInvocationActionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction[] = []; - stream.on('data', (response: protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.queryWorkflowInvocationActions, request)); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryWorkflowInvocationActions without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - generateSampleMessage(new protos.google.cloud.dataform.v1beta1.WorkflowInvocationAction()), - ]; - client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[] = []; - const iterable = client.queryWorkflowInvocationActionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with queryWorkflowInvocationActions with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.dataform.v1beta1.QueryWorkflowInvocationActionsRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name=";const expectedError = new Error('expected'); - client.descriptors.page.queryWorkflowInvocationActions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.queryWorkflowInvocationActionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataform.v1beta1.IWorkflowInvocationAction[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.queryWorkflowInvocationActions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('compilationResult', () => { - const fakePath = "/rendered/path/compilationResult"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - compilation_result: "compilationResultValue", - }; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.compilationResultPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.compilationResultPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('compilationResultPath', () => { - const result = client.compilationResultPath("projectValue", "locationValue", "repositoryValue", "compilationResultValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.compilationResultPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromCompilationResultName', () => { - const result = client.matchProjectFromCompilationResultName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromCompilationResultName', () => { - const result = client.matchLocationFromCompilationResultName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromCompilationResultName', () => { - const result = client.matchRepositoryFromCompilationResultName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchCompilationResultFromCompilationResultName', () => { - const result = client.matchCompilationResultFromCompilationResultName(fakePath); - assert.strictEqual(result, "compilationResultValue"); - assert((client.pathTemplates.compilationResultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.locationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('repository', () => { - const fakePath = "/rendered/path/repository"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - }; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.repositoryPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.repositoryPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('repositoryPath', () => { - const result = client.repositoryPath("projectValue", "locationValue", "repositoryValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.repositoryPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRepositoryName', () => { - const result = client.matchProjectFromRepositoryName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromRepositoryName', () => { - const result = client.matchLocationFromRepositoryName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromRepositoryName', () => { - const result = client.matchRepositoryFromRepositoryName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.repositoryPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('workflowInvocation', () => { - const fakePath = "/rendered/path/workflowInvocation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - workflow_invocation: "workflowInvocationValue", - }; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.workflowInvocationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workflowInvocationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workflowInvocationPath', () => { - const result = client.workflowInvocationPath("projectValue", "locationValue", "repositoryValue", "workflowInvocationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workflowInvocationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkflowInvocationName', () => { - const result = client.matchProjectFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkflowInvocationName', () => { - const result = client.matchLocationFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromWorkflowInvocationName', () => { - const result = client.matchRepositoryFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowInvocationFromWorkflowInvocationName', () => { - const result = client.matchWorkflowInvocationFromWorkflowInvocationName(fakePath); - assert.strictEqual(result, "workflowInvocationValue"); - assert((client.pathTemplates.workflowInvocationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('workspace', () => { - const fakePath = "/rendered/path/workspace"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - repository: "repositoryValue", - workspace: "workspaceValue", - }; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.workspacePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.workspacePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('workspacePath', () => { - const result = client.workspacePath("projectValue", "locationValue", "repositoryValue", "workspaceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.workspacePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromWorkspaceName', () => { - const result = client.matchProjectFromWorkspaceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromWorkspaceName', () => { - const result = client.matchLocationFromWorkspaceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRepositoryFromWorkspaceName', () => { - const result = client.matchRepositoryFromWorkspaceName(fakePath); - assert.strictEqual(result, "repositoryValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkspaceFromWorkspaceName', () => { - const result = client.matchWorkspaceFromWorkspaceName(fakePath); - assert.strictEqual(result, "workspaceValue"); - assert((client.pathTemplates.workspacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/tsconfig.json b/owl-bot-staging/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c8..0000000 --- a/owl-bot-staging/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1beta1/webpack.config.js b/owl-bot-staging/v1beta1/webpack.config.js deleted file mode 100644 index b2259ed..0000000 --- a/owl-bot-staging/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'Dataform', - filename: './dataform.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js b/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js index 9ba5e29..65ab554 100644 --- a/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js +++ b/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.commit_workspace_changes.js b/samples/generated/v1alpha2/dataform.commit_workspace_changes.js index 205d23a..e4b9e76 100644 --- a/samples/generated/v1alpha2/dataform.commit_workspace_changes.js +++ b/samples/generated/v1alpha2/dataform.commit_workspace_changes.js @@ -23,6 +23,9 @@ function main(name, author) { // [START dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.create_compilation_result.js b/samples/generated/v1alpha2/dataform.create_compilation_result.js index 800f91d..42cafe8 100644 --- a/samples/generated/v1alpha2/dataform.create_compilation_result.js +++ b/samples/generated/v1alpha2/dataform.create_compilation_result.js @@ -23,6 +23,9 @@ function main(parent, compilationResult) { // [START dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.create_repository.js b/samples/generated/v1alpha2/dataform.create_repository.js index 50c7e43..b734380 100644 --- a/samples/generated/v1alpha2/dataform.create_repository.js +++ b/samples/generated/v1alpha2/dataform.create_repository.js @@ -23,6 +23,9 @@ function main(parent, repository, repositoryId) { // [START dataform_v1alpha2_generated_Dataform_CreateRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.create_workflow_invocation.js b/samples/generated/v1alpha2/dataform.create_workflow_invocation.js index cf83325..7aeaced 100644 --- a/samples/generated/v1alpha2/dataform.create_workflow_invocation.js +++ b/samples/generated/v1alpha2/dataform.create_workflow_invocation.js @@ -23,6 +23,9 @@ function main(parent, workflowInvocation) { // [START dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.create_workspace.js b/samples/generated/v1alpha2/dataform.create_workspace.js index 60695fc..2b55956 100644 --- a/samples/generated/v1alpha2/dataform.create_workspace.js +++ b/samples/generated/v1alpha2/dataform.create_workspace.js @@ -23,6 +23,9 @@ function main(parent, workspace, workspaceId) { // [START dataform_v1alpha2_generated_Dataform_CreateWorkspace_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.delete_repository.js b/samples/generated/v1alpha2/dataform.delete_repository.js index 5687647..bfe3dc9 100644 --- a/samples/generated/v1alpha2/dataform.delete_repository.js +++ b/samples/generated/v1alpha2/dataform.delete_repository.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_DeleteRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js b/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js index 5a02d8c..800461d 100644 --- a/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js +++ b/samples/generated/v1alpha2/dataform.delete_workflow_invocation.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_DeleteWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.delete_workspace.js b/samples/generated/v1alpha2/dataform.delete_workspace.js index db8f6bf..f773c39 100644 --- a/samples/generated/v1alpha2/dataform.delete_workspace.js +++ b/samples/generated/v1alpha2/dataform.delete_workspace.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.fetch_file_diff.js b/samples/generated/v1alpha2/dataform.fetch_file_diff.js index a600b93..df28731 100644 --- a/samples/generated/v1alpha2/dataform.fetch_file_diff.js +++ b/samples/generated/v1alpha2/dataform.fetch_file_diff.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js b/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js index c725234..ba0e827 100644 --- a/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js +++ b/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js b/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js index 3dea206..1dcc54b 100644 --- a/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js +++ b/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.fetch_remote_branches.js b/samples/generated/v1alpha2/dataform.fetch_remote_branches.js index fd74201..c6c2b7f 100644 --- a/samples/generated/v1alpha2/dataform.fetch_remote_branches.js +++ b/samples/generated/v1alpha2/dataform.fetch_remote_branches.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.get_compilation_result.js b/samples/generated/v1alpha2/dataform.get_compilation_result.js index 0f074d3..38711f9 100644 --- a/samples/generated/v1alpha2/dataform.get_compilation_result.js +++ b/samples/generated/v1alpha2/dataform.get_compilation_result.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_GetCompilationResult_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.get_repository.js b/samples/generated/v1alpha2/dataform.get_repository.js index 3c712d1..e633675 100644 --- a/samples/generated/v1alpha2/dataform.get_repository.js +++ b/samples/generated/v1alpha2/dataform.get_repository.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_GetRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.get_workflow_invocation.js b/samples/generated/v1alpha2/dataform.get_workflow_invocation.js index 7ffa345..8ed6ab4 100644 --- a/samples/generated/v1alpha2/dataform.get_workflow_invocation.js +++ b/samples/generated/v1alpha2/dataform.get_workflow_invocation.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.get_workspace.js b/samples/generated/v1alpha2/dataform.get_workspace.js index bf3447d..294d027 100644 --- a/samples/generated/v1alpha2/dataform.get_workspace.js +++ b/samples/generated/v1alpha2/dataform.get_workspace.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_GetWorkspace_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.install_npm_packages.js b/samples/generated/v1alpha2/dataform.install_npm_packages.js index aa80216..bfae9b7 100644 --- a/samples/generated/v1alpha2/dataform.install_npm_packages.js +++ b/samples/generated/v1alpha2/dataform.install_npm_packages.js @@ -23,6 +23,9 @@ function main(workspace) { // [START dataform_v1alpha2_generated_Dataform_InstallNpmPackages_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.list_compilation_results.js b/samples/generated/v1alpha2/dataform.list_compilation_results.js index 44528b5..f463dc1 100644 --- a/samples/generated/v1alpha2/dataform.list_compilation_results.js +++ b/samples/generated/v1alpha2/dataform.list_compilation_results.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1alpha2_generated_Dataform_ListCompilationResults_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.list_repositories.js b/samples/generated/v1alpha2/dataform.list_repositories.js index f203cdb..2f81c22 100644 --- a/samples/generated/v1alpha2/dataform.list_repositories.js +++ b/samples/generated/v1alpha2/dataform.list_repositories.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1alpha2_generated_Dataform_ListRepositories_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.list_workflow_invocations.js b/samples/generated/v1alpha2/dataform.list_workflow_invocations.js index 3ebf894..12e7d3e 100644 --- a/samples/generated/v1alpha2/dataform.list_workflow_invocations.js +++ b/samples/generated/v1alpha2/dataform.list_workflow_invocations.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1alpha2_generated_Dataform_ListWorkflowInvocations_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.list_workspaces.js b/samples/generated/v1alpha2/dataform.list_workspaces.js index e2c4f06..8a1f1c9 100644 --- a/samples/generated/v1alpha2/dataform.list_workspaces.js +++ b/samples/generated/v1alpha2/dataform.list_workspaces.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1alpha2_generated_Dataform_ListWorkspaces_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.make_directory.js b/samples/generated/v1alpha2/dataform.make_directory.js index 6111963..faf321e 100644 --- a/samples/generated/v1alpha2/dataform.make_directory.js +++ b/samples/generated/v1alpha2/dataform.make_directory.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1alpha2_generated_Dataform_MakeDirectory_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.move_directory.js b/samples/generated/v1alpha2/dataform.move_directory.js index 336a480..d50b32b 100644 --- a/samples/generated/v1alpha2/dataform.move_directory.js +++ b/samples/generated/v1alpha2/dataform.move_directory.js @@ -23,6 +23,9 @@ function main(workspace, path, newPath) { // [START dataform_v1alpha2_generated_Dataform_MoveDirectory_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.move_file.js b/samples/generated/v1alpha2/dataform.move_file.js index c95054b..7f04c99 100644 --- a/samples/generated/v1alpha2/dataform.move_file.js +++ b/samples/generated/v1alpha2/dataform.move_file.js @@ -23,6 +23,9 @@ function main(workspace, path, newPath) { // [START dataform_v1alpha2_generated_Dataform_MoveFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.pull_git_commits.js b/samples/generated/v1alpha2/dataform.pull_git_commits.js index edbefad..2b6de81 100644 --- a/samples/generated/v1alpha2/dataform.pull_git_commits.js +++ b/samples/generated/v1alpha2/dataform.pull_git_commits.js @@ -23,6 +23,9 @@ function main(name, author) { // [START dataform_v1alpha2_generated_Dataform_PullGitCommits_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.push_git_commits.js b/samples/generated/v1alpha2/dataform.push_git_commits.js index ea15c74..bdcd4b2 100644 --- a/samples/generated/v1alpha2/dataform.push_git_commits.js +++ b/samples/generated/v1alpha2/dataform.push_git_commits.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_PushGitCommits_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js b/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js index d310fd7..e829710 100644 --- a/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js +++ b/samples/generated/v1alpha2/dataform.query_compilation_result_actions.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_QueryCompilationResultActions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.query_directory_contents.js b/samples/generated/v1alpha2/dataform.query_directory_contents.js index 37c747b..2e5c0bc 100644 --- a/samples/generated/v1alpha2/dataform.query_directory_contents.js +++ b/samples/generated/v1alpha2/dataform.query_directory_contents.js @@ -23,6 +23,9 @@ function main(workspace) { // [START dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js b/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js index bc2f32d..0abc8a2 100644 --- a/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js +++ b/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.read_file.js b/samples/generated/v1alpha2/dataform.read_file.js index 0bd285c..7cd0572 100644 --- a/samples/generated/v1alpha2/dataform.read_file.js +++ b/samples/generated/v1alpha2/dataform.read_file.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1alpha2_generated_Dataform_ReadFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.remove_directory.js b/samples/generated/v1alpha2/dataform.remove_directory.js index f414ee4..157e012 100644 --- a/samples/generated/v1alpha2/dataform.remove_directory.js +++ b/samples/generated/v1alpha2/dataform.remove_directory.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1alpha2_generated_Dataform_RemoveDirectory_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.remove_file.js b/samples/generated/v1alpha2/dataform.remove_file.js index f8cfb94..396738b 100644 --- a/samples/generated/v1alpha2/dataform.remove_file.js +++ b/samples/generated/v1alpha2/dataform.remove_file.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1alpha2_generated_Dataform_RemoveFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.reset_workspace_changes.js b/samples/generated/v1alpha2/dataform.reset_workspace_changes.js index 7efa0a0..d91ec7f 100644 --- a/samples/generated/v1alpha2/dataform.reset_workspace_changes.js +++ b/samples/generated/v1alpha2/dataform.reset_workspace_changes.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1alpha2_generated_Dataform_ResetWorkspaceChanges_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.update_repository.js b/samples/generated/v1alpha2/dataform.update_repository.js index 067c1ab..48c5d61 100644 --- a/samples/generated/v1alpha2/dataform.update_repository.js +++ b/samples/generated/v1alpha2/dataform.update_repository.js @@ -23,6 +23,9 @@ function main(repository) { // [START dataform_v1alpha2_generated_Dataform_UpdateRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/dataform.write_file.js b/samples/generated/v1alpha2/dataform.write_file.js index c5f695a..08ed5bb 100644 --- a/samples/generated/v1alpha2/dataform.write_file.js +++ b/samples/generated/v1alpha2/dataform.write_file.js @@ -23,6 +23,9 @@ function main(workspace, path, contents) { // [START dataform_v1alpha2_generated_Dataform_WriteFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json b/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json index 1595f99..344d9ef 100644 --- a/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json +++ b/samples/generated/v1alpha2/snippet_metadata.google.cloud.dataform.v1alpha2.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -254,7 +254,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -294,7 +294,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -350,7 +350,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -390,7 +390,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -438,7 +438,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -518,7 +518,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -566,7 +566,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -610,7 +610,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -650,7 +650,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -694,7 +694,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -746,7 +746,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -794,7 +794,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -838,7 +838,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], @@ -890,7 +890,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -934,7 +934,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -978,7 +978,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -1026,7 +1026,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1070,7 +1070,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1114,7 +1114,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1162,7 +1162,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1210,7 +1210,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -1258,7 +1258,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1298,7 +1298,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1342,7 +1342,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], @@ -1394,7 +1394,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -1442,7 +1442,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1482,7 +1482,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1526,7 +1526,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1566,7 +1566,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1606,7 +1606,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], diff --git a/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js b/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js index 24d1ecc..2028cb6 100644 --- a/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js +++ b/samples/generated/v1beta1/dataform.cancel_workflow_invocation.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.commit_workspace_changes.js b/samples/generated/v1beta1/dataform.commit_workspace_changes.js index 09bfef8..01e533e 100644 --- a/samples/generated/v1beta1/dataform.commit_workspace_changes.js +++ b/samples/generated/v1beta1/dataform.commit_workspace_changes.js @@ -23,6 +23,9 @@ function main(name, author) { // [START dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.create_compilation_result.js b/samples/generated/v1beta1/dataform.create_compilation_result.js index 98e7d25..8826207 100644 --- a/samples/generated/v1beta1/dataform.create_compilation_result.js +++ b/samples/generated/v1beta1/dataform.create_compilation_result.js @@ -23,6 +23,9 @@ function main(parent, compilationResult) { // [START dataform_v1beta1_generated_Dataform_CreateCompilationResult_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.create_repository.js b/samples/generated/v1beta1/dataform.create_repository.js index e1ef1fd..b0d66cd 100644 --- a/samples/generated/v1beta1/dataform.create_repository.js +++ b/samples/generated/v1beta1/dataform.create_repository.js @@ -23,6 +23,9 @@ function main(parent, repository, repositoryId) { // [START dataform_v1beta1_generated_Dataform_CreateRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.create_workflow_invocation.js b/samples/generated/v1beta1/dataform.create_workflow_invocation.js index 179dfbb..9108d48 100644 --- a/samples/generated/v1beta1/dataform.create_workflow_invocation.js +++ b/samples/generated/v1beta1/dataform.create_workflow_invocation.js @@ -23,6 +23,9 @@ function main(parent, workflowInvocation) { // [START dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.create_workspace.js b/samples/generated/v1beta1/dataform.create_workspace.js index a99a33a..531becb 100644 --- a/samples/generated/v1beta1/dataform.create_workspace.js +++ b/samples/generated/v1beta1/dataform.create_workspace.js @@ -23,6 +23,9 @@ function main(parent, workspace, workspaceId) { // [START dataform_v1beta1_generated_Dataform_CreateWorkspace_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.delete_repository.js b/samples/generated/v1beta1/dataform.delete_repository.js index 172f3a1..ad2ad43 100644 --- a/samples/generated/v1beta1/dataform.delete_repository.js +++ b/samples/generated/v1beta1/dataform.delete_repository.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_DeleteRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.delete_workflow_invocation.js b/samples/generated/v1beta1/dataform.delete_workflow_invocation.js index 697d2e3..ab0aaac 100644 --- a/samples/generated/v1beta1/dataform.delete_workflow_invocation.js +++ b/samples/generated/v1beta1/dataform.delete_workflow_invocation.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.delete_workspace.js b/samples/generated/v1beta1/dataform.delete_workspace.js index c6e8ae2..5c0060d 100644 --- a/samples/generated/v1beta1/dataform.delete_workspace.js +++ b/samples/generated/v1beta1/dataform.delete_workspace.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_DeleteWorkspace_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.fetch_file_diff.js b/samples/generated/v1beta1/dataform.fetch_file_diff.js index 362137f..2df2eb2 100644 --- a/samples/generated/v1beta1/dataform.fetch_file_diff.js +++ b/samples/generated/v1beta1/dataform.fetch_file_diff.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1beta1_generated_Dataform_FetchFileDiff_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js b/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js index 53302d6..03cfe21 100644 --- a/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js +++ b/samples/generated/v1beta1/dataform.fetch_file_git_statuses.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js b/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js index e8b3db2..733dde9 100644 --- a/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js +++ b/samples/generated/v1beta1/dataform.fetch_git_ahead_behind.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.fetch_remote_branches.js b/samples/generated/v1beta1/dataform.fetch_remote_branches.js index 1c998ab..43c3d2a 100644 --- a/samples/generated/v1beta1/dataform.fetch_remote_branches.js +++ b/samples/generated/v1beta1/dataform.fetch_remote_branches.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_FetchRemoteBranches_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.get_compilation_result.js b/samples/generated/v1beta1/dataform.get_compilation_result.js index 19ed3d1..ee22ddb 100644 --- a/samples/generated/v1beta1/dataform.get_compilation_result.js +++ b/samples/generated/v1beta1/dataform.get_compilation_result.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_GetCompilationResult_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.get_repository.js b/samples/generated/v1beta1/dataform.get_repository.js index 2533229..071180c 100644 --- a/samples/generated/v1beta1/dataform.get_repository.js +++ b/samples/generated/v1beta1/dataform.get_repository.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_GetRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.get_workflow_invocation.js b/samples/generated/v1beta1/dataform.get_workflow_invocation.js index 3fa01e1..9e48759 100644 --- a/samples/generated/v1beta1/dataform.get_workflow_invocation.js +++ b/samples/generated/v1beta1/dataform.get_workflow_invocation.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.get_workspace.js b/samples/generated/v1beta1/dataform.get_workspace.js index a49c652..6c22c2e 100644 --- a/samples/generated/v1beta1/dataform.get_workspace.js +++ b/samples/generated/v1beta1/dataform.get_workspace.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_GetWorkspace_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.install_npm_packages.js b/samples/generated/v1beta1/dataform.install_npm_packages.js index 0d06ee6..d8ecbf9 100644 --- a/samples/generated/v1beta1/dataform.install_npm_packages.js +++ b/samples/generated/v1beta1/dataform.install_npm_packages.js @@ -23,6 +23,9 @@ function main(workspace) { // [START dataform_v1beta1_generated_Dataform_InstallNpmPackages_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.list_compilation_results.js b/samples/generated/v1beta1/dataform.list_compilation_results.js index 1ae1ad4..ec422dd 100644 --- a/samples/generated/v1beta1/dataform.list_compilation_results.js +++ b/samples/generated/v1beta1/dataform.list_compilation_results.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1beta1_generated_Dataform_ListCompilationResults_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.list_repositories.js b/samples/generated/v1beta1/dataform.list_repositories.js index 787e921..279161f 100644 --- a/samples/generated/v1beta1/dataform.list_repositories.js +++ b/samples/generated/v1beta1/dataform.list_repositories.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1beta1_generated_Dataform_ListRepositories_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.list_workflow_invocations.js b/samples/generated/v1beta1/dataform.list_workflow_invocations.js index 2d599f0..e9194a1 100644 --- a/samples/generated/v1beta1/dataform.list_workflow_invocations.js +++ b/samples/generated/v1beta1/dataform.list_workflow_invocations.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.list_workspaces.js b/samples/generated/v1beta1/dataform.list_workspaces.js index 708c9d0..fbf8647 100644 --- a/samples/generated/v1beta1/dataform.list_workspaces.js +++ b/samples/generated/v1beta1/dataform.list_workspaces.js @@ -23,6 +23,9 @@ function main(parent) { // [START dataform_v1beta1_generated_Dataform_ListWorkspaces_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.make_directory.js b/samples/generated/v1beta1/dataform.make_directory.js index fe239f6..b352c7b 100644 --- a/samples/generated/v1beta1/dataform.make_directory.js +++ b/samples/generated/v1beta1/dataform.make_directory.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1beta1_generated_Dataform_MakeDirectory_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.move_directory.js b/samples/generated/v1beta1/dataform.move_directory.js index 2d43a94..ec43257 100644 --- a/samples/generated/v1beta1/dataform.move_directory.js +++ b/samples/generated/v1beta1/dataform.move_directory.js @@ -23,6 +23,9 @@ function main(workspace, path, newPath) { // [START dataform_v1beta1_generated_Dataform_MoveDirectory_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.move_file.js b/samples/generated/v1beta1/dataform.move_file.js index 64efc20..c00db1f 100644 --- a/samples/generated/v1beta1/dataform.move_file.js +++ b/samples/generated/v1beta1/dataform.move_file.js @@ -23,6 +23,9 @@ function main(workspace, path, newPath) { // [START dataform_v1beta1_generated_Dataform_MoveFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.pull_git_commits.js b/samples/generated/v1beta1/dataform.pull_git_commits.js index d3590eb..18c8f38 100644 --- a/samples/generated/v1beta1/dataform.pull_git_commits.js +++ b/samples/generated/v1beta1/dataform.pull_git_commits.js @@ -23,6 +23,9 @@ function main(name, author) { // [START dataform_v1beta1_generated_Dataform_PullGitCommits_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.push_git_commits.js b/samples/generated/v1beta1/dataform.push_git_commits.js index a905849..0863cf3 100644 --- a/samples/generated/v1beta1/dataform.push_git_commits.js +++ b/samples/generated/v1beta1/dataform.push_git_commits.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_PushGitCommits_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.query_compilation_result_actions.js b/samples/generated/v1beta1/dataform.query_compilation_result_actions.js index 9d59881..1690b94 100644 --- a/samples/generated/v1beta1/dataform.query_compilation_result_actions.js +++ b/samples/generated/v1beta1/dataform.query_compilation_result_actions.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.query_directory_contents.js b/samples/generated/v1beta1/dataform.query_directory_contents.js index a086f74..c779211 100644 --- a/samples/generated/v1beta1/dataform.query_directory_contents.js +++ b/samples/generated/v1beta1/dataform.query_directory_contents.js @@ -23,6 +23,9 @@ function main(workspace) { // [START dataform_v1beta1_generated_Dataform_QueryDirectoryContents_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js b/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js index 7a276ef..9a7531e 100644 --- a/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js +++ b/samples/generated/v1beta1/dataform.query_workflow_invocation_actions.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.read_file.js b/samples/generated/v1beta1/dataform.read_file.js index 2893ceb..61d5eeb 100644 --- a/samples/generated/v1beta1/dataform.read_file.js +++ b/samples/generated/v1beta1/dataform.read_file.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1beta1_generated_Dataform_ReadFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.remove_directory.js b/samples/generated/v1beta1/dataform.remove_directory.js index 9f94153..c22c6a1 100644 --- a/samples/generated/v1beta1/dataform.remove_directory.js +++ b/samples/generated/v1beta1/dataform.remove_directory.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1beta1_generated_Dataform_RemoveDirectory_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.remove_file.js b/samples/generated/v1beta1/dataform.remove_file.js index e7ef6a1..22a7529 100644 --- a/samples/generated/v1beta1/dataform.remove_file.js +++ b/samples/generated/v1beta1/dataform.remove_file.js @@ -23,6 +23,9 @@ function main(workspace, path) { // [START dataform_v1beta1_generated_Dataform_RemoveFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.reset_workspace_changes.js b/samples/generated/v1beta1/dataform.reset_workspace_changes.js index b3c26c2..e611fb1 100644 --- a/samples/generated/v1beta1/dataform.reset_workspace_changes.js +++ b/samples/generated/v1beta1/dataform.reset_workspace_changes.js @@ -23,6 +23,9 @@ function main(name) { // [START dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.update_repository.js b/samples/generated/v1beta1/dataform.update_repository.js index d8975ad..ce879f0 100644 --- a/samples/generated/v1beta1/dataform.update_repository.js +++ b/samples/generated/v1beta1/dataform.update_repository.js @@ -23,6 +23,9 @@ function main(repository) { // [START dataform_v1beta1_generated_Dataform_UpdateRepository_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/dataform.write_file.js b/samples/generated/v1beta1/dataform.write_file.js index 9d60584..33502bd 100644 --- a/samples/generated/v1beta1/dataform.write_file.js +++ b/samples/generated/v1beta1/dataform.write_file.js @@ -23,6 +23,9 @@ function main(workspace, path, contents) { // [START dataform_v1beta1_generated_Dataform_WriteFile_async] /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. * TODO(developer): Uncomment these variables before running the sample. */ /** diff --git a/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json b/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json index 036ac39..4b31438 100644 --- a/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json +++ b/samples/generated/v1beta1/snippet_metadata.google.cloud.dataform.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -254,7 +254,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -294,7 +294,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 79, "type": "FULL" } ], @@ -350,7 +350,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -390,7 +390,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -438,7 +438,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -478,7 +478,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -518,7 +518,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -566,7 +566,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -610,7 +610,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -650,7 +650,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -694,7 +694,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -746,7 +746,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -794,7 +794,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -838,7 +838,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], @@ -890,7 +890,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -934,7 +934,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -978,7 +978,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -1026,7 +1026,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1070,7 +1070,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -1114,7 +1114,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1162,7 +1162,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -1210,7 +1210,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -1258,7 +1258,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1298,7 +1298,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1342,7 +1342,7 @@ "segments": [ { "start": 25, - "end": 71, + "end": 74, "type": "FULL" } ], @@ -1394,7 +1394,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -1442,7 +1442,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1482,7 +1482,7 @@ "segments": [ { "start": 25, - "end": 56, + "end": 59, "type": "FULL" } ], @@ -1526,7 +1526,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1566,7 +1566,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -1606,7 +1606,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], diff --git a/src/v1alpha2/dataform_client.ts b/src/v1alpha2/dataform_client.ts index 1168c91..2a4c45e 100644 --- a/src/v1alpha2/dataform_client.ts +++ b/src/v1alpha2/dataform_client.ts @@ -32,7 +32,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -337,7 +336,8 @@ export class DataformClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -3376,7 +3376,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRepositories.createStream( - this.innerApiCalls.listRepositories as gax.GaxCall, + this.innerApiCalls.listRepositories as GaxCall, request, callSettings ); @@ -3437,7 +3437,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listRepositories.asyncIterate( this.innerApiCalls['listRepositories'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3604,7 +3604,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkspaces.createStream( - this.innerApiCalls.listWorkspaces as gax.GaxCall, + this.innerApiCalls.listWorkspaces as GaxCall, request, callSettings ); @@ -3665,7 +3665,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listWorkspaces.asyncIterate( this.innerApiCalls['listWorkspaces'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3830,7 +3830,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.queryDirectoryContents.createStream( - this.innerApiCalls.queryDirectoryContents as gax.GaxCall, + this.innerApiCalls.queryDirectoryContents as GaxCall, request, callSettings ); @@ -3888,7 +3888,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.queryDirectoryContents.asyncIterate( this.innerApiCalls['queryDirectoryContents'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4047,7 +4047,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listCompilationResults.createStream( - this.innerApiCalls.listCompilationResults as gax.GaxCall, + this.innerApiCalls.listCompilationResults as GaxCall, request, callSettings ); @@ -4102,7 +4102,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listCompilationResults.asyncIterate( this.innerApiCalls['listCompilationResults'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4267,7 +4267,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.queryCompilationResultActions.createStream( - this.innerApiCalls.queryCompilationResultActions as gax.GaxCall, + this.innerApiCalls.queryCompilationResultActions as GaxCall, request, callSettings ); @@ -4325,7 +4325,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.queryCompilationResultActions.asyncIterate( this.innerApiCalls['queryCompilationResultActions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4484,7 +4484,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkflowInvocations.createStream( - this.innerApiCalls.listWorkflowInvocations as gax.GaxCall, + this.innerApiCalls.listWorkflowInvocations as GaxCall, request, callSettings ); @@ -4539,7 +4539,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listWorkflowInvocations.asyncIterate( this.innerApiCalls['listWorkflowInvocations'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4699,7 +4699,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.queryWorkflowInvocationActions.createStream( - this.innerApiCalls.queryWorkflowInvocationActions as gax.GaxCall, + this.innerApiCalls.queryWorkflowInvocationActions as GaxCall, request, callSettings ); @@ -4755,7 +4755,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.queryWorkflowInvocationActions.asyncIterate( this.innerApiCalls['queryWorkflowInvocationActions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/src/v1beta1/dataform_client.ts b/src/v1beta1/dataform_client.ts index 318b582..0e808b1 100644 --- a/src/v1beta1/dataform_client.ts +++ b/src/v1beta1/dataform_client.ts @@ -32,7 +32,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -337,7 +336,8 @@ export class DataformClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -3353,7 +3353,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRepositories.createStream( - this.innerApiCalls.listRepositories as gax.GaxCall, + this.innerApiCalls.listRepositories as GaxCall, request, callSettings ); @@ -3414,7 +3414,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listRepositories.asyncIterate( this.innerApiCalls['listRepositories'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3581,7 +3581,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkspaces.createStream( - this.innerApiCalls.listWorkspaces as gax.GaxCall, + this.innerApiCalls.listWorkspaces as GaxCall, request, callSettings ); @@ -3642,7 +3642,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listWorkspaces.asyncIterate( this.innerApiCalls['listWorkspaces'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -3807,7 +3807,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.queryDirectoryContents.createStream( - this.innerApiCalls.queryDirectoryContents as gax.GaxCall, + this.innerApiCalls.queryDirectoryContents as GaxCall, request, callSettings ); @@ -3865,7 +3865,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.queryDirectoryContents.asyncIterate( this.innerApiCalls['queryDirectoryContents'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4024,7 +4024,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listCompilationResults.createStream( - this.innerApiCalls.listCompilationResults as gax.GaxCall, + this.innerApiCalls.listCompilationResults as GaxCall, request, callSettings ); @@ -4079,7 +4079,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listCompilationResults.asyncIterate( this.innerApiCalls['listCompilationResults'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4244,7 +4244,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.queryCompilationResultActions.createStream( - this.innerApiCalls.queryCompilationResultActions as gax.GaxCall, + this.innerApiCalls.queryCompilationResultActions as GaxCall, request, callSettings ); @@ -4302,7 +4302,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.queryCompilationResultActions.asyncIterate( this.innerApiCalls['queryCompilationResultActions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4461,7 +4461,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listWorkflowInvocations.createStream( - this.innerApiCalls.listWorkflowInvocations as gax.GaxCall, + this.innerApiCalls.listWorkflowInvocations as GaxCall, request, callSettings ); @@ -4516,7 +4516,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.listWorkflowInvocations.asyncIterate( this.innerApiCalls['listWorkflowInvocations'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -4676,7 +4676,7 @@ export class DataformClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.queryWorkflowInvocationActions.createStream( - this.innerApiCalls.queryWorkflowInvocationActions as gax.GaxCall, + this.innerApiCalls.queryWorkflowInvocationActions as GaxCall, request, callSettings ); @@ -4732,7 +4732,7 @@ export class DataformClient { this.initialize(); return this.descriptors.page.queryWorkflowInvocationActions.asyncIterate( this.innerApiCalls['queryWorkflowInvocationActions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/test/gapic_dataform_v1alpha2.ts b/test/gapic_dataform_v1alpha2.ts index ac59e60..69dbd9c 100644 --- a/test/gapic_dataform_v1alpha2.ts +++ b/test/gapic_dataform_v1alpha2.ts @@ -113,99 +113,101 @@ function stubAsyncIterationCall( } describe('v1alpha2.DataformClient', () => { - it('has servicePath', () => { - const servicePath = dataformModule.v1alpha2.DataformClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = dataformModule.v1alpha2.DataformClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = dataformModule.v1alpha2.DataformClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = dataformModule.v1alpha2.DataformClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new dataformModule.v1alpha2.DataformClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = dataformModule.v1alpha2.DataformClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new dataformModule.v1alpha2.DataformClient({ - fallback: true, + it('has port', () => { + const port = dataformModule.v1alpha2.DataformClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new dataformModule.v1alpha2.DataformClient(); + assert(client); }); - assert.strictEqual(client.dataformStub, undefined); - await client.initialize(); - assert(client.dataformStub); - }); - it('has close method for the initialized client', done => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new dataformModule.v1alpha2.DataformClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.dataformStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + await client.initialize(); + assert(client.dataformStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataformStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.dataformStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1alpha2.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1alpha2.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getRepository', () => { diff --git a/test/gapic_dataform_v1beta1.ts b/test/gapic_dataform_v1beta1.ts index f559ab8..57db89a 100644 --- a/test/gapic_dataform_v1beta1.ts +++ b/test/gapic_dataform_v1beta1.ts @@ -113,99 +113,101 @@ function stubAsyncIterationCall( } describe('v1beta1.DataformClient', () => { - it('has servicePath', () => { - const servicePath = dataformModule.v1beta1.DataformClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = dataformModule.v1beta1.DataformClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = dataformModule.v1beta1.DataformClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = dataformModule.v1beta1.DataformClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new dataformModule.v1beta1.DataformClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = dataformModule.v1beta1.DataformClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new dataformModule.v1beta1.DataformClient({ - fallback: true, + it('has port', () => { + const port = dataformModule.v1beta1.DataformClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new dataformModule.v1beta1.DataformClient(); + assert(client); }); - assert.strictEqual(client.dataformStub, undefined); - await client.initialize(); - assert(client.dataformStub); - }); - it('has close method for the initialized client', done => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new dataformModule.v1beta1.DataformClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.dataformStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + await client.initialize(); + assert(client.dataformStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataformStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.dataformStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataformStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new dataformModule.v1beta1.DataformClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon - .stub() - .callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error | null, projectId?: string | null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dataformModule.v1beta1.DataformClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getRepository', () => {